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 480bd9f commit cf3c416
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 10 additions & 0 deletions t/kvs/kvs-helper.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/bin/sh
#

# KVS Common helper functions

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

# KVS Watch helper functions

# Various loops to wait for conditions before moving on. There is
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.
'

. `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 cf3c416

Please sign in to comment.