From 3116a810cba385ee41737dbc21639002482655d2 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Wed, 3 Jan 2018 10:59:51 -0800 Subject: [PATCH] t/kvs: Add test_kvs_key to kvs helper Adjust t1000-kvs and t1004-kvs-namespace accordingly. --- t/kvs/kvs-helper.sh | 8 ++++++++ t/t1000-kvs.t | 8 ++------ t/t1004-kvs-namespace.t | 6 ------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/t/kvs/kvs-helper.sh b/t/kvs/kvs-helper.sh index 6f86a4d36287..128e404dd13a 100755 --- a/t/kvs/kvs-helper.sh +++ b/t/kvs/kvs-helper.sh @@ -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() { diff --git a/t/t1000-kvs.t b/t/t1000-kvs.t index cb80707ea7ac..d6598ce247d4 100755 --- a/t/t1000-kvs.t +++ b/t/t1000-kvs.t @@ -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 @@ -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 # diff --git a/t/t1004-kvs-namespace.t b/t/t1004-kvs-namespace.t index 022a964bae79..96e38d53a95f 100755 --- a/t/t1004-kvs-namespace.t +++ b/t/t1004-kvs-namespace.t @@ -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