Skip to content

Commit

Permalink
t/kvs: Add test_kvs_key to kvs helper
Browse files Browse the repository at this point in the history
Adjust t1000-kvs and t1004-kvs-namespace accordingly.
  • Loading branch information
chu11 committed Jan 3, 2018
1 parent 52ff959 commit 3116a81
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
8 changes: 8 additions & 0 deletions t/kvs/kvs-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ loophandlereturn() {
return 0
}

# arg1 - key to retrieve
# arg2 - expected value
test_kvs_key() {
flux kvs get --json "$1" >output
echo "$2" >expected
test_cmp expected output
}

# arg1 - key to retrieve
# arg2 - value to wait for
wait_watch_put() {
Expand Down
8 changes: 2 additions & 6 deletions t/t1000-kvs.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ These are the basic/core flux kvs tests and should be run before
any other tests that require kvs functionality.
'

source `dirname $0`/kvs/kvs-helper.sh

. `dirname $0`/sharness.sh

if test "$TEST_LONG" = "t"; then
Expand All @@ -23,12 +25,6 @@ KEY=test.a.b.c
SUBDIR1=test.a.b.d
SUBDIR2=test.a.b.e

test_kvs_key() {
flux kvs get --json "$1" >output
echo "$2" >expected
test_cmp expected output
}

#
# Basic put, get, unlink tests
#
Expand Down
6 changes: 0 additions & 6 deletions t/t1004-kvs-namespace.t
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ NAMESPACETEST=namespacetest
NAMESPACETMP=namespacetmp
NAMESPACERANK1=namespacerank1

test_kvs_key() {
flux kvs get --json "$1" >output
echo "$2" >expected
test_cmp expected output
}

test_kvs_key_namespace() {
export FLUX_KVS_NAMESPACE=$1
flux kvs get --json "$2" >output
Expand Down

0 comments on commit 3116a81

Please sign in to comment.