9
if {! (( [policy_exists "$test/a"]) ||
10
[create_policy "$test/a"])} {
11
error_and_restart "$test: couldn't create policy \"$test/a\""
16
ovsec_kadm_init admin admin $OVSEC_KADM_CHANGEPW_SERVICE null \
17
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
20
perror "$test: unexpected failure in init"
23
one_line_fail_test [format {
24
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
25
{OVSEC_KADM_PW_MAX_LIFE}
26
} $test] "AUTH_MODIFY"
27
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
28
perror "$test: unexpected failure in destroy"
34
test "modify-policy 4"
38
if {! ([policy_exists "$test/a"] ||
39
[create_policy "$test/a"])} {
40
error_and_restart "$test: couldn't create policy \"$test/a\""
44
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
45
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
48
perror "$test: unexpected failure in init"
51
one_line_fail_test [format {
52
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
53
{OVSEC_KADM_REF_COUNT}
55
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
56
perror "$test: unexpected failure in destroy"
62
test "modify-policy 8"
66
# setup_xfail {*-*-*} $prms_id
68
if {! (( [policy_exists "$test/a"]) ||
69
[create_policy "$test/a"])} {
70
error_and_restart "$test: couldn't create policy \"$test/a\""
75
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
76
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
79
perror "$test: unexpected failure in init"
83
ovsec_kadm_modify_policy $server_handle [simple_policy ""] \
84
{OVSEC_KADM_PW_MAX_LIFE}
86
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
87
perror "$test: unexpected failure in destroy"
93
test "modify-policy 9"
97
if {! (( [policy_exists "$test/a"]) ||
98
[create_policy "$test/a"])} {
99
error_and_restart "$test: couldn't create policy \"$test/a\""
104
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
105
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
108
perror "$test: unexpected failure in init"
112
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
113
{OVSEC_KADM_PW_MIN_LIFE}
119
ovsec_kadm_get_policy $server_handle "%s/a" policy
121
fail "$test: can not retrieve policy"
124
send "lindex \$policy 1\n"
126
-re "0\n$prompt$" { pass "$test" }
127
timeout { fail "$test" }
130
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
131
perror "$test: unexpected failure in destroy"
137
test "modify-policy 10"
141
if {! (( [policy_exists "$test/a"]) ||
142
[create_policy "$test/a"])} {
143
error_and_restart "$test: couldn't create policy \"$test/a\""
147
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
148
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
151
perror "$test: unexpected failure in init"
155
ovsec_kadm_modify_policy $server_handle {"%s/a" 32 0 0 0 0 0} \
156
{OVSEC_KADM_PW_MIN_LIFE}
162
ovsec_kadm_get_policy $server_handle "%s/a" policy
164
fail "$test: can not retrieve policy"
167
send "lindex \$policy 1\n"
169
-re "32\n$prompt$" { pass "$test" }
170
timeout { fail "$test" }
172
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
173
perror "$test: unexpected failure in destroy"
180
test "modify-policy 11"
185
if {! (( [policy_exists "$test/a"]) ||
186
[create_policy "$test/a"])} {
187
error_and_restart "$test: couldn't create policy \"$test/a\""
192
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
193
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
196
perror "$test: unexpected failure in init"
200
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
201
{OVSEC_KADM_PW_MAX_LIFE}
207
ovsec_kadm_get_policy $server_handle "%s/a" policy
209
fail "$test: can not retrieve policy"
212
send "lindex \$policy 2\n"
214
-re "0\n$prompt$" { pass "$test" }
215
timeout { fail "$test" }
217
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
218
perror "$test: unexpected failure in destroy"
224
test "modify-policy 12"
229
if {! (( [policy_exists "$test/a"]) ||
230
[create_policy "$test/a"])} {
231
error_and_restart "$test: couldn't create policy \"$test/a\""
236
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
237
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
240
perror "$test: unexpected failure in init"
244
ovsec_kadm_modify_policy $server_handle {"%s/a" 0 32 0 0 0 0} \
245
{OVSEC_KADM_PW_MAX_LIFE}
251
ovsec_kadm_get_policy $server_handle "%s/a" policy
253
fail "$test: can not retrieve policy"
256
send "lindex \$policy 2\n"
258
-re "32\n$prompt$" { pass "$test" }
259
timeout { fail "$test" }
261
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
262
perror "$test: unexpected failure in destroy"
268
test "modify-policy 13"
271
if {! (( [policy_exists "$test/a"]) ||
272
[create_policy "$test/a"])} {
273
error_and_restart "$test: couldn't create policy \"$test/a\""
278
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
279
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
282
perror "$test: unexpected failure in init"
285
one_line_fail_test [format {
286
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
287
{OVSEC_KADM_PW_MIN_LENGTH}
288
} $test] "BAD_LENGTH"
289
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
290
perror "$test: unexpected failure in destroy"
296
test "modify-policy 14"
301
if {! (( [policy_exists "$test/a"]) ||
302
[create_policy "$test/a"])} {
303
error_and_restart "$test: couldn't create policy \"$test/a\""
308
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
309
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
312
perror "$test: unexpected failure in init"
316
ovsec_kadm_modify_policy $server_handle {"%s/a" 0 0 8 0 0 0} \
317
{OVSEC_KADM_PW_MIN_LENGTH}
323
ovsec_kadm_get_policy $server_handle "%s/a" policy
325
fail "$test: can not retrieve policy"
328
send "lindex \$policy 3\n"
330
-re "8\n$prompt$" { pass "$test" }
331
timeout { fail "$test" }
333
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
334
perror "$test: unexpected failure in destroy"
340
test "modify-policy 15"
343
if {! (( [policy_exists "$test/a"]) ||
344
[create_policy "$test/a"])} {
345
error_and_restart "$test: couldn't create policy \"$test/a\""
350
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
351
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
354
perror "$test: unexpected failure in init"
357
one_line_fail_test [format {
358
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
359
{OVSEC_KADM_PW_MIN_CLASSES}
361
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
362
perror "$test: unexpected failure in destroy"
368
test "modify-policy 16"
373
if {! (( [policy_exists "$test/a"]) ||
374
[create_policy "$test/a"])} {
375
error_and_restart "$test: couldn't create policy \"$test/a\""
380
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
381
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
384
perror "$test: unexpected failure in init"
388
ovsec_kadm_modify_policy $server_handle {"%s/a" 0 0 0 1 0 0} \
389
{OVSEC_KADM_PW_MIN_CLASSES}
395
ovsec_kadm_get_policy $server_handle "%s/a" policy
397
fail "$test: can not retrieve policy"
400
send "lindex \$policy 4\n"
402
-re "1\n$prompt$" { pass "$test" }
403
timeout { fail "$test" }
407
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
408
perror "$test: unexpected failure in destroy"
414
test "modify-policy 17"
419
if {! (( [policy_exists "$test/a"]) ||
420
[create_policy "$test/a"])} {
421
error_and_restart "$test: couldn't create policy \"$test/a\""
426
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
427
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
430
perror "$test: unexpected failure in init"
434
ovsec_kadm_modify_policy $server_handle {"%s/a" 0 0 0 5 0 0} \
435
{OVSEC_KADM_PW_MIN_CLASSES}
441
ovsec_kadm_get_policy $server_handle "%s/a" policy
443
fail "$test: can not retrieve policy"
446
send "lindex \$policy 4\n"
448
-re "5\n$prompt$" { pass "$test" }
449
timeout { fail "$test" }
452
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
453
perror "$test: unexpected failure in destroy"
459
test "modify-policy 18"
464
if {! (( [policy_exists "$test/a"]) ||
465
[create_policy "$test/a" ])} {
466
error_and_restart "$test: couldn't create policy \"$test/a\""
471
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
472
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
475
perror "$test: unexpected failure in init"
478
one_line_fail_test [format {
479
ovsec_kadm_modify_policy $server_handle {"%s/a" 0 0 0 6 0 0} \
480
{OVSEC_KADM_PW_MIN_CLASSES}
482
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
483
perror "$test: unexpected failure in destroy"
489
test "modify-policy 19"
493
if {! (( [policy_exists "$test/a"]) ||
494
[create_policy "$test/a" ])} {
495
error_and_restart "$test: couldn't create policy \"$test/a\""
500
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
501
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
504
perror "$test: unexpected failure in init"
507
one_line_fail_test [format {
508
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
509
{OVSEC_KADM_PW_HISTORY_NUM}
510
} $test] "BAD_HISTORY"
511
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
512
perror "$test: unexpected failure in destroy"
518
test "modify-policy 20"
523
if {! (( [policy_exists "$test/a"]) ||
524
[create_policy "$test/a" ])} {
525
error_and_restart "$test: couldn't create policy \"$test/a\""
530
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
531
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
534
perror "$test: unexpected failure in init"
538
ovsec_kadm_modify_policy $server_handle {"%s/a" 0 0 0 0 1 0} \
539
{OVSEC_KADM_PW_HISTORY_NUM}
545
ovsec_kadm_get_policy $server_handle "%s/a" policy
547
fail "$test: can not retrieve policy"
550
send "lindex \$policy 5\n"
552
-re "1\n$prompt$" { pass "$test" }
553
timeout { fail "$test" }
556
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
557
perror "$test: unexpected failure in destroy"
563
test "modify-policy 21"
568
if {! (( [policy_exists "$test/a"]) ||
569
[create_policy "$test/a" ])} {
570
error_and_restart "$test: couldn't create policy \"$test/a\""
575
ovsec_kadm_init admin admin $OVSEC_KADM_ADMIN_SERVICE null \
576
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
579
perror "$test: unexpected failure in init"
583
ovsec_kadm_modify_policy $server_handle {"%s/a" 0 0 0 0 10 0} \
584
{OVSEC_KADM_PW_HISTORY_NUM}
590
ovsec_kadm_get_policy $server_handle "%s/a" policy
592
fail "$test: can not retrieve policy"
595
send "lindex \$policy 5\n"
597
-re "10\n$prompt$" { pass "$test" }
598
timeout { fail "$test" }
601
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
602
perror "$test: unexpected failure in destroy"
608
test "modify-policy 22"
611
if {! (( [policy_exists "$test/a"]) ||
612
[create_policy "$test/a" ])} {
613
error_and_restart "$test: couldn't create policy \"$test/a\""
618
ovsec_kadm_init admin/none admin $OVSEC_KADM_ADMIN_SERVICE null \
619
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
622
perror "$test: unexpected failure in init"
625
one_line_fail_test [format {
626
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
627
{OVSEC_KADM_PW_MAX_LIFE}
628
} $test] "AUTH_MODIFY"
629
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
630
perror "$test: unexpected failure in destroy"
636
test "modify-policy 23"
639
if {! (( [policy_exists "$test/a"]) ||
640
[create_policy "$test/a" ])} {
641
error_and_restart "$test: couldn't create policy \"$test/a\""
646
ovsec_kadm_init admin/get admin $OVSEC_KADM_ADMIN_SERVICE null \
647
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
650
perror "$test: unexpected failure in init"
653
one_line_fail_test [format {
654
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
655
{OVSEC_KADM_PW_MAX_LIFE}
656
} $test] "AUTH_MODIFY"
657
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
658
perror "$test: unexpected failure in destroy"
664
test "modify-policy 26"
667
if {! (( [policy_exists "$test/a"]) ||
668
[create_policy "$test/a" ])} {
669
error_and_restart "$test: couldn't create policy \"$test/a\""
674
ovsec_kadm_init admin/modify admin $OVSEC_KADM_ADMIN_SERVICE null \
675
$OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \
678
perror "$test: unexpected failure in init"
681
one_line_succeed_test [format {
682
ovsec_kadm_modify_policy $server_handle [simple_policy "%s/a"] \
683
{OVSEC_KADM_PW_MAX_LIFE}
685
if { ! [cmd {ovsec_kadm_destroy $server_handle}]} {
686
perror "$test: unexpected failure in destroy"
692
test "modify-policy 30"
696
one_line_fail_test [format {
697
ovsec_kadm_modify_policy null [simple_policy "%s/a"] \
698
{OVSEC_KADM_PW_MAX_LIFE}
699
} $test] "BAD_SERVER_HANDLE"