diff --git a/t/data/dws2jgf/rabbits.json b/t/data/dws2jgf/rabbits.json new file mode 100644 index 0000000..f66c508 --- /dev/null +++ b/t/data/dws2jgf/rabbits.json @@ -0,0 +1,18 @@ +{ + "computes": { + "compute-01": "kind-worker2", + "compute-02": "kind-worker2", + "compute-03": "kind-worker2", + "compute-04": "kind-worker3" + }, + "rabbits": { + "kind-worker2": { + "capacity": 39582418599936, + "hostlist": "compute-[01-03]" + }, + "kind-worker3": { + "capacity": 39582418599936, + "hostlist": "compute-04" + } + } +} \ No newline at end of file diff --git a/t/t1002-dws-workflow-obj.t b/t/t1002-dws-workflow-obj.t index 4488384..7d9fd46 100755 --- a/t/t1002-dws-workflow-obj.t +++ b/t/t1002-dws-workflow-obj.t @@ -87,8 +87,9 @@ test_expect_success 'job submission with valid DW string works with fluxion-rabb test_expect_success 'load fluxion with rabbits' ' flux cancel ${DWS_JOBID} && + flux python ${FLUX_SOURCE_DIR}/src/cmd/flux-rabbitmapping.py > rabbits.json && flux R encode -l | flux python ${FLUX_SOURCE_DIR}/src/cmd/flux-dws2jgf.py \ - --no-validate | jq . > R.local && + --no-validate rabbits.json | jq . > R.local && flux kvs put resource.R="$(cat R.local)" && flux module remove -f sched-fluxion-qmanager && flux module remove -f sched-fluxion-resource && diff --git a/t/t1003-dws-nnf-watch.t b/t/t1003-dws-nnf-watch.t index 3db47b3..94f350a 100755 --- a/t/t1003-dws-nnf-watch.t +++ b/t/t1003-dws-nnf-watch.t @@ -30,8 +30,9 @@ test_expect_success 'job-manager: load alloc-bypass plugin' ' test_expect_success 'load Fluxion with rabbit resource graph' ' echo $PYTHONPATH >&2 && + flux python ${FLUX_SOURCE_DIR}/src/cmd/flux-rabbitmapping.py > rabbits.json && flux R encode -l | flux python ${FLUX_SOURCE_DIR}/src/cmd/flux-dws2jgf.py \ - --no-validate | jq . > R.local && + --no-validate rabbits.json | jq . > R.local && flux kvs put resource.R="$(cat R.local)" && flux module remove -f sched-fluxion-qmanager && flux module remove -f sched-fluxion-resource && @@ -172,7 +173,7 @@ test_expect_success 'exec Storage watching script with invalid --drain-queues ar test_expect_success 'configure flux with queues' ' flux R encode -l | jq ".execution.properties.debug = \"0\"" | \ flux python ${FLUX_SOURCE_DIR}/src/cmd/flux-dws2jgf.py \ - --no-validate | jq . > R.local.queues && + --no-validate rabbits.json | jq . > R.local.queues && flux kvs put resource.R="$(cat R.local.queues)" && flux module remove -f sched-fluxion-qmanager && flux module remove -f sched-fluxion-resource && diff --git a/t/t2000-dws2jgf.t b/t/t2000-dws2jgf.t index 9ca6ef8..816da09 100755 --- a/t/t2000-dws2jgf.t +++ b/t/t2000-dws2jgf.t @@ -33,27 +33,32 @@ test_expect_success HAVE_JQ 'smoke test to ensure the storage resources are expe test $(hostname) = compute-01 ' +test_expect_success HAVE_JQ 'flux-rabbitmapping outputs expected mapping' ' + flux python ${FLUX_SOURCE_DIR}/src/cmd/flux-rabbitmapping.py -i2 > rabbits.json + test_cmp ${DATADIR}/rabbits.json rabbits.json +' + test_expect_success HAVE_JQ 'flux-dws2jgf.py outputs expected JGF for single compute node' ' flux R encode -Hcompute-01 | flux python ${CMD} --no-validate --cluster-name=ElCapitan \ - | jq . > actual-compute-01.jgf && + rabbits.json | jq . > actual-compute-01.jgf && test_cmp ${DATADIR}/expected-compute-01.jgf actual-compute-01.jgf ' test_expect_success HAVE_JQ 'flux-dws2jgf.py outputs expected JGF for multiple compute nodes' ' flux R encode -Hcompute-[01-04] -c0-4 | flux python ${CMD} --no-validate --cluster-name=ElCapitan \ - | jq . > actual-compute-01-04.jgf && + rabbits.json | jq . > actual-compute-01-04.jgf && test_cmp ${DATADIR}/expected-compute-01-04.jgf actual-compute-01-04.jgf ' test_expect_success HAVE_JQ 'flux-dws2jgf.py outputs expected JGF for compute nodes not in DWS' ' flux R encode -Hcompute-[01-04],nodws[0-5] -c0-4 | \ - flux python ${CMD} --no-validate | jq . > actual-compute-01-nodws.jgf && + flux python ${CMD} --no-validate rabbits.json | jq . > actual-compute-01-nodws.jgf && test_cmp ${DATADIR}/expected-compute-01-nodws.jgf actual-compute-01-nodws.jgf ' test_expect_success HAVE_JQ 'flux-dws2jgf.py handles properties correctly' ' cat ${DATADIR}/R-properties | \ - flux python ${CMD} --no-validate | jq . > actual-properties.jgf && + flux python ${CMD} --no-validate rabbits.json | jq . > actual-properties.jgf && test_cmp ${DATADIR}/expected-properties.jgf actual-properties.jgf ' @@ -70,7 +75,8 @@ test_expect_success HAVE_JQ 'fluxion rejects a rack/rabbit job when no rabbits a test_expect_success HAVE_JQ 'fluxion can be loaded with output of dws2jgf' ' flux run -n1 hostname && - flux R encode -l | flux python ${CMD} --no-validate --cluster-name=ElCapitan | jq . > R.local && + flux R encode -l | flux python ${CMD} --no-validate --cluster-name=ElCapitan rabbits.json \ + | jq . > R.local && flux kvs put resource.R="$(cat R.local)" && flux module list && flux module remove -f sched-fluxion-qmanager &&