Skip to content

Commit d245914

Browse files
committed
t: cover kvs max ops configs
Problem: There is no coverage for the new kvs transaction-max-ops and fence-max-ops configurations. Add coverage in t1005-kvs-security.t.
1 parent 72740fb commit d245914

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed

t/t1005-kvs-security.t

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,4 +442,119 @@ test_expect_success 'kvs: no pending requests at end of tests' '
442442
test $pendingcount -eq 0
443443
'
444444

445+
#
446+
# test transaction-max-ops / fence-max-ops
447+
#
448+
449+
test_expect_success 'configure illegal transaction-max-ops' '
450+
test_must_fail flux config load <<-EOF
451+
[kvs]
452+
transaction-max-ops = "foobar"
453+
EOF
454+
'
455+
456+
test_expect_success 'configure bad transaction-max-ops' '
457+
test_must_fail flux config load <<-EOF
458+
[kvs]
459+
transaction-max-ops = 0
460+
EOF
461+
'
462+
463+
test_expect_success 'configure illegal fence-max-ops' '
464+
test_must_fail flux config load <<-EOF
465+
[kvs]
466+
fence-max-ops = "foobar"
467+
EOF
468+
'
469+
470+
test_expect_success 'configure bad fence-max-ops' '
471+
test_must_fail flux config load <<-EOF
472+
[kvs]
473+
fence-max-ops = 0
474+
EOF
475+
'
476+
477+
test_expect_success 'configure small transaction-max-ops and fence-max-ops' '
478+
flux exec flux config load <<-EOF
479+
[kvs]
480+
transaction-max-ops = 3
481+
fence-max-ops = 12
482+
EOF
483+
'
484+
485+
# N.B. flux kvs put will place each key=val on command line into 1
486+
# transaction
487+
488+
test_expect_success 'kvs: txns of small size work' '
489+
flux kvs put test.a=1 &&
490+
flux kvs put test.b=1 test.c=1 &&
491+
flux kvs put test.d=1 test.e=1 test.f=1
492+
'
493+
494+
test_expect_success 'kvs: txns of small size work (not rank 0)' '
495+
flux exec -r 1 flux kvs put test.a=1 &&
496+
flux exec -r 1 flux kvs put test.b=1 test.c=1 &&
497+
flux exec -r 1 flux kvs put test.d=1 test.e=1 test.f=1
498+
'
499+
500+
test_expect_success 'kvs: txns above limit fail' '
501+
test_must_fail flux kvs put test.a=2 test.b=2 test.c=2 test.d=2 2> fence1.err &&
502+
grep "Argument list too long" fence1.err
503+
'
504+
505+
test_expect_success 'kvs: txns above limit fail (not rank 0)' '
506+
test_must_fail flux exec -r 1 flux kvs put test.a=3 test.b=3 test.c=3 test.d=3 2> fence2.err &&
507+
grep "Argument list too long" fence2.err
508+
'
509+
510+
# N.B. fence_api issues one operation per thread by default
511+
512+
test_expect_success 'kvs: small total fence ops works' '
513+
${FLUX_BUILD_DIR}/t/kvs/fence_api 11 fence3
514+
'
515+
516+
test_expect_success 'kvs: small fence ops per fence work' '
517+
${FLUX_BUILD_DIR}/t/kvs/fence_api --opcount=3 2 fence4
518+
'
519+
520+
test_expect_success 'kvs: small fence ops per fence work (not rank 0)' '
521+
flux exec -r 1 ${FLUX_BUILD_DIR}/t/kvs/fence_api --opcount=3 2 fence5
522+
'
523+
524+
test_expect_success 'kvs: fence ops per fence above limit fails' '
525+
test_must_fail ${FLUX_BUILD_DIR}/t/kvs/fence_api --opcount=4 2 fence6 2> fence6.err &&
526+
count=$(grep "Argument list too long" fence6.err | wc -l) &&
527+
test $count -eq 2
528+
'
529+
530+
test_expect_success 'kvs: fence ops per fence above limit fails (not rank 0)' '
531+
test_must_fail flux exec -r 1 ${FLUX_BUILD_DIR}/t/kvs/fence_api --opcount=4 2 fence7 2> fence7.err &&
532+
count=$(grep "Argument list too long" fence7.err | wc -l) &&
533+
test $count -eq 2
534+
'
535+
536+
test_expect_success 'kvs: total fence ops above limit fail (1 op per fence)' '
537+
test_must_fail ${FLUX_BUILD_DIR}/t/kvs/fence_api 13 fence8 2> fence8.err &&
538+
count=$(grep "Argument list too long" fence8.err | wc -l) &&
539+
test $count -eq 13
540+
'
541+
542+
test_expect_success 'kvs: total fence ops above limit fail (1 op per fence, not rank 0)' '
543+
test_must_fail flux exec -r 1 ${FLUX_BUILD_DIR}/t/kvs/fence_api 13 fence9 2> fence9.err &&
544+
count=$(grep "Argument list too long" fence9.err | wc -l) &&
545+
test $count -eq 13
546+
'
547+
548+
test_expect_success 'kvs: total fence ops above limit fail (4 op per fence)' '
549+
test_must_fail ${FLUX_BUILD_DIR}/t/kvs/fence_api --opcount=4 4 fence10 2> fence10.err &&
550+
count=$(grep "Argument list too long" fence10.err | wc -l) &&
551+
test $count -eq 4
552+
'
553+
554+
test_expect_success 'kvs: total fence ops above limit fail (3 op per fence, not rank 0)' '
555+
test_must_fail flux exec -r 1 ${FLUX_BUILD_DIR}/t/kvs/fence_api --opcount=4 4 fence11 2> fence11.err &&
556+
count=$(grep "Argument list too long" fence11.err | wc -l) &&
557+
test $count -eq 4
558+
'
559+
445560
test_done

0 commit comments

Comments
 (0)