Skip to content

Commit 6bcbcfe

Browse files
committed
t: cover kvs transaction-max-ops config option
Problem: There is no coverage for the new kvs transaction-max-ops configuration. Add coverage in t1005-kvs-security.t.
1 parent 5929f29 commit 6bcbcfe

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

t/t1005-kvs-security.t

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,54 @@ test_expect_success 'kvs: no pending requests at end of tests' '
400400
test $pendingcount -eq 0
401401
'
402402

403+
#
404+
# test transaction-max-ops
405+
#
406+
407+
test_expect_success 'configure illegal transaction-max-ops' '
408+
test_must_fail flux config load <<-EOF
409+
[kvs]
410+
transaction-max-ops = "foobar"
411+
EOF
412+
'
413+
414+
test_expect_success 'configure bad transaction-max-ops' '
415+
test_must_fail flux config load <<-EOF
416+
[kvs]
417+
transaction-max-ops = 0
418+
EOF
419+
'
420+
421+
test_expect_success 'configure small transaction-max-ops' '
422+
flux exec flux config load <<-EOF
423+
[kvs]
424+
transaction-max-ops = 3
425+
EOF
426+
'
427+
428+
# N.B. flux kvs put will place each key=val on command line into 1
429+
# transaction
430+
431+
test_expect_success 'kvs: txns of small size work' '
432+
flux kvs put test.a=1 &&
433+
flux kvs put test.b=1 test.c=1 &&
434+
flux kvs put test.d=1 test.e=1 test.f=1
435+
'
436+
437+
test_expect_success 'kvs: txns of small size work (not rank 0)' '
438+
flux exec -r 1 flux kvs put test.a=1 &&
439+
flux exec -r 1 flux kvs put test.b=1 test.c=1 &&
440+
flux exec -r 1 flux kvs put test.d=1 test.e=1 test.f=1
441+
'
442+
443+
test_expect_success 'kvs: txns above limit fail' '
444+
test_must_fail flux kvs put test.a=2 test.b=2 test.c=2 test.d=2 2> fence1.err &&
445+
grep "Argument list too long" fence1.err
446+
'
447+
448+
test_expect_success 'kvs: txns above limit fail (not rank 0)' '
449+
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 &&
450+
grep "Argument list too long" fence2.err
451+
'
452+
403453
test_done

0 commit comments

Comments
 (0)