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 4, 2018
1 parent 5d155cb commit 15b4363
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
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
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.
'

. `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
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 15b4363

Please sign in to comment.