Skip to content

Commit

Permalink
t/kvs: Add symlink w/ namespace security tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chu11 committed Jan 28, 2019
1 parent a1fd558 commit ca64dd7
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions t/t1005-kvs-security.t
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,37 @@ test_expect_success 'kvs: namespace remove still works (owner)' '
! flux kvs --namespace=$NAMESPACETMP-USER get --json $DIR.tmp
'

#
# namespace link cross
#

test_expect_success 'kvs: namespace create works (owner, for user)' '
flux kvs namespace-create -o 9000 $NAMESPACETMP-SYMLINKNS1 &&
flux kvs namespace-create -o 9001 $NAMESPACETMP-SYMLINKNS2 &&
flux kvs namespace-create -o 9001 $NAMESPACETMP-SYMLINKNS3
'

test_expect_success 'kvs: symlink w/ Namespace works (owner)' '
flux kvs --namespace=${NAMESPACETMP}-SYMLINKNS1 put $DIR.linktest=1 &&
flux kvs --namespace=${NAMESPACETMP}-SYMLINKNS2 put $DIR.linktest=2 &&
flux kvs --namespace=${NAMESPACETMP}-SYMLINKNS1 link --target-namespace=${NAMESPACETMP}-SYMLINKNS2 $DIR.linktest $DIR.link &&
test_kvs_key_namespace ${NAMESPACETMP}-SYMLINKNS1 $DIR.link 2
'

test_expect_success 'kvs: symlinkw/ Namespace fails (wrong user)' '
set_userid 9000 &&
! flux kvs --namespace=${NAMESPACETMP}-SYMLINKNS1 get $DIR.link &&
unset_userid
'

test_expect_success 'kvs: symlink w/ Namespace works (user)' '
set_userid 9001 &&
flux kvs --namespace=${NAMESPACETMP}-SYMLINKNS3 put $DIR.linktest=3 &&
flux kvs --namespace=${NAMESPACETMP}-SYMLINKNS2 link --target-namespace=${NAMESPACETMP}-SYMLINKNS3 $DIR.linktest $DIR.link &&
test_kvs_key_namespace ${NAMESPACETMP}-SYMLINKNS2 $DIR.link 3 &&
unset_userid
'

#
# Basic tests, user can't perform non-namespace operations
#
Expand Down

0 comments on commit ca64dd7

Please sign in to comment.