Skip to content

Commit

Permalink
check more EPROTO requests
Browse files Browse the repository at this point in the history
  • Loading branch information
garlick committed Apr 18, 2019
1 parent 722cb79 commit e4ab54c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
22 changes: 20 additions & 2 deletions t/t0017-security.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ test_description='Test broker security'

test_under_flux 4 minimal

RPC=${FLUX_BUILD_DIR}/t/request/rpc

test_expect_success 'simulated local connector auth failure returns EPERM' '
flux comms info &&
flux module debug --set 1 connector-local &&
Expand Down Expand Up @@ -97,9 +99,25 @@ test_expect_success 'flux user can add/lookup bin user by name' '
flux module remove userdb
'

test_expect_success 'load userdb module' '
flux module load userdb
'

test_expect_success 'flux user cannot add user with no roles' '
flux module load userdb &&
! flux user addrole 1234 0 &&
test_must_fail flux user addrole 1234 0
'

test_expect_success 'lookup request with empty payload fails with EPROTO(71)' '
${RPC} userdb.lookup 71 </dev/null
'
test_expect_success 'addrole request with empty payload fails with EPROTO(71)' '
${RPC} userdb.addrole 71 </dev/null
'
test_expect_success 'delrole request with empty payload fails with EPROTO(71)' '
${RPC} userdb.delrole 71 </dev/null
'

test_expect_success 'unload userdb module' '
flux module remove userdb
'

Expand Down
5 changes: 5 additions & 0 deletions t/t1007-kvs-lookup-watch.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ test_description='Test KVS get --watch && --waitcreate'

test_under_flux 4 kvs

RPC=${FLUX_BUILD_DIR}/t/request/rpc

waitfile=${SHARNESS_TEST_SRCDIR}/scripts/waitfile.lua

test_expect_success 'flux kvs get --watch --count=1 works' '
Expand Down Expand Up @@ -660,4 +662,7 @@ test_expect_success 'flux kvs get --watch allows owner access to guest ns' '
flux kvs namespace remove testns4
'

test_expect_success 'kvs-watch.lookup request with empty payload fails with EPROTO(71)' '
${RPC} kvs-watch.lookup 71 </dev/null
'
test_done
6 changes: 5 additions & 1 deletion t/t1101-barrier-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ test_under_flux ${SIZE} minimal
tbarrier="${FLUX_BUILD_DIR}/t/barrier/tbarrier"
test "$verbose" = "t" || tbarrier="${tbarrier} -q"

RPC=${FLUX_BUILD_DIR}/t/request/rpc

test_expect_success 'barrier: load barrier module' '
flux module load -r all barrier
'
Expand Down Expand Up @@ -48,7 +50,9 @@ test_expect_success 'barrier: succeeds with name=NULL inside SLURM step' '
SLURM_STEPID=1 && export SLURM_STEPID &&
flux exec -n ${tbarrier} --nprocs ${SIZE}
'

test_expect_success 'enter request with empty payload fails with EPROTO(71)' '
${RPC} barrier.enter 71 </dev/null
'
test_expect_success 'barrier: remove barrier module' '
flux module remove -r all barrier
'
Expand Down
9 changes: 9 additions & 0 deletions t/t2204-job-info.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ test_description='Test flux job info service'

test_under_flux 4 job

RPC=${FLUX_BUILD_DIR}/t/request/rpc

# Usage: submit_job
# To ensure robustness of tests despite future job manager changes,
# cancel the job, and wait for clean event.
Expand Down Expand Up @@ -330,4 +332,11 @@ test_expect_success 'job-info stats works' '
flux module stats job-info | grep "watchers"
'

test_expect_success 'lookup request with empty payload fails with EPROTO(71)' '
${RPC} job-info.lookup 71 </dev/null
'
test_expect_success 'eventlog-watch request with empty payload fails with EPROTO(71)' '
${RPC} job-info.eventlog-watch 71 </dev/null
'

test_done

0 comments on commit e4ab54c

Please sign in to comment.