Skip to content

Commit 7b1939d

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 f3cccb7 commit 7b1939d

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
@@ -412,4 +412,54 @@ test_expect_success 'kvs: no pending requests at end of tests' '
412412
test $pendingcount -eq 0
413413
'
414414

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

0 commit comments

Comments
 (0)