Skip to content

Commit

Permalink
t/kvs: Update fence_namespace_remove test
Browse files Browse the repository at this point in the history
Update test so that fence_namespace_remove binary takes a namespace
as a parameter.
  • Loading branch information
chu11 committed Feb 8, 2018
1 parent f173ad1 commit da059f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 10 additions & 3 deletions t/kvs/fence_namespace_remove.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static char *prefix = NULL;

static void usage (void)
{
fprintf (stderr, "Usage: fence_namespace_remove prefix\n");
fprintf (stderr, "Usage: fence_namespace_remove namespace prefix\n");
exit (1);
}

Expand All @@ -56,22 +56,29 @@ int main (int argc, char *argv[])
flux_t *h = NULL;
uint32_t rank;
char *key = NULL;
char *namespace = NULL;
char *fence_name = NULL;
flux_future_t *f = NULL;
flux_kvs_txn_t *txn = NULL;

log_init (basename (argv[0]));

if (argc != 2)
if (argc != 3)
usage ();

prefix = argv[1];
namespace = argv[1];
prefix = argv[2];

if (!(h = flux_open (NULL, 0))) {
log_err_exit ("flux_open");
goto done;
}

if (flux_kvs_set_namespace (h, namespace) < 0) {
log_err_exit ("flux_kvs_set_namespace");
goto done;
}

if (flux_get_rank (h, &rank) < 0) {
log_err ("flux_get_rank");
goto done;
Expand Down
6 changes: 2 additions & 4 deletions t/t1004-kvs-namespace.t
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,12 @@ test_expect_success NO_CHAIN_LINT 'kvs: watch on rank 1 gets ENOTSUP when namesp
# non-zero to know it's ready for this test.
test_expect_success NO_CHAIN_LINT 'kvs: incomplete fence gets ENOTSUP when namespace is removed' '
flux kvs namespace-create $NAMESPACETMP-REMOVE-FENCE0 &&
export FLUX_KVS_NAMESPACE=$NAMESPACETMP-REMOVE-FENCE0 &&
rm -f fence_out
stdbuf -oL ${FLUX_BUILD_DIR}/t/kvs/fence_namespace_remove fence0 > fence_out &
stdbuf -oL ${FLUX_BUILD_DIR}/t/kvs/fence_namespace_remove $NAMESPACETMP-REMOVE-FENCE0 fence0 > fence_out &
watchpid=$! &&
wait_fencecount_nonzero 0 $NAMESPACETMP-REMOVE-FENCE0 &&
flux kvs namespace-remove $NAMESPACETMP-REMOVE-FENCE0 &&
wait $watchpid &&
unset FLUX_KVS_NAMESPACE &&
grep "flux_future_get: Operation not supported" fence_out
'

Expand All @@ -428,7 +426,7 @@ test_expect_success NO_CHAIN_LINT 'kvs: incomplete fence gets ENOTSUP when names
test_expect_success NO_CHAIN_LINT 'kvs: incomplete fence on rank 1 gets ENOTSUP when namespace is removed' '
flux kvs namespace-create $NAMESPACETMP-REMOVE-FENCE1 &&
rm -f fence_out
stdbuf -oL flux exec -r 1 sh -c "export FLUX_KVS_NAMESPACE=$NAMESPACETMP-REMOVE-FENCE1 ; ${FLUX_BUILD_DIR}/t/kvs/fence_namespace_remove fence1" > fence_out &
stdbuf -oL flux exec -r 1 sh -c "${FLUX_BUILD_DIR}/t/kvs/fence_namespace_remove $NAMESPACETMP-REMOVE-FENCE1 fence1" > fence_out &
watchpid=$! &&
wait_fencecount_nonzero 1 $NAMESPACETMP-REMOVE-FENCE1 &&
flux kvs namespace-remove $NAMESPACETMP-REMOVE-FENCE1 &&
Expand Down

0 comments on commit da059f5

Please sign in to comment.