Skip to content

Commit

Permalink
t2003-recurse.t: verify URI in enclosing instance
Browse files Browse the repository at this point in the history
Add a few tests to ensure that Flux running Flux results
in KVS content that can be found by "flux wreck uri".

N.B. this sharness script needed to drop the "wreck"
personality and use the default full personality
in order to execute the rc1.d script that updates
the enclosing KVS.
  • Loading branch information
garlick committed Apr 6, 2018
1 parent 0a774a7 commit f90c8dc
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion t/t2003-recurse.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_description='Test that Flux can launch Flux'
. `dirname $0`/sharness.sh

mock_bootstrap_instance
test_under_flux 4 wreck
test_under_flux 4

test_expect_success 'recurse: Flux launches Flux ' '
printenv FLUX_URI >old_uri &&
Expand Down Expand Up @@ -55,4 +55,30 @@ test_expect_success 'recurse: Flux launches Flux launches Flux' '
test_cmp hello_expected hello_out
'

test_expect_success 'recurse: FLUX_JOB_KVSPATH is set in child job' '
flux wreckrun -n1 -N1 flux start \
printenv FLUX_JOB_KVSPATH >kvspath &&
test -s kvspath
'

test_expect_success 'recurse: flux.local_uri is set in enclosing KVS' '
flux wreckrun -n1 -N1 flux start flux getattr local-uri >curi &&
key=$(flux wreck kvs-path $(flux wreck last-jobid)).flux.local_uri &&
flux kvs get --json $key >curi.out &&
test_cmp curi curi.out
'

test_expect_success 'recurse: flux.remote_uri is set in enclosing KVS' '
flux wreckrun -n1 -N1 flux start flux getattr local-uri >curi2 &&
key=$(flux wreck kvs-path $(flux wreck last-jobid)).flux.remote_uri &&
flux kvs get --json $key >ruri.out &&
grep -q "$(sed -e ,local://,, <curi2)" ruri.out
'

test_expect_success 'recurse: flux wreck uri works for child job' '
flux wreckrun -n1 -N1 flux start flux getattr local-uri >child_uri &&
flux wreck uri --bare $(flux wreck last-jobid) >list_uri &&
grep -q "$(sed -e ,local://,, <child_uri)" list_uri
'

test_done

0 comments on commit f90c8dc

Please sign in to comment.