Skip to content

Commit 01053e8

Browse files
committed
testsuite: add equality check for set-status vs JGF status
Add a check to test if setting a vertex down in resource-query is equivalent to setting the same vertex status to 1 in the JGF file. The equivalence is a test of the correct behavior of the resource_pool_t ctor and ensures the JGF reader fetcher is properly scrubbed.
1 parent 373b36e commit 01053e8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

t/t3025-resource-find.t

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ full_job="${SHARNESS_TEST_SRCDIR}/data/resource/jobspecs/find/full.yaml"
1111
cmd_dir="${SHARNESS_TEST_SRCDIR}/data/resource/commands/find"
1212
exp_dir="${SHARNESS_TEST_SRCDIR}/data/resource/expected/find"
1313
grugs="${SHARNESS_TEST_SRCDIR}/data/resource/grugs/tiny.graphml"
14+
jgf="${SHARNESS_TEST_SRCDIR}/data/resource/jgfs/tiny.json"
1415
query="../../resource/utilities/resource-query"
1516

1617
skip_all_unless_have jq
@@ -309,4 +310,20 @@ EOF
309310
test ${core} = "\"0\""
310311
'
311312

313+
test_expect_success 'setting vertex down in JGF same as set-status' '
314+
cat > cmds021 <<-EOF &&
315+
set-status /tiny0/rack0/node0/socket0/core0 down
316+
find status=down
317+
quit
318+
EOF
319+
cat > cmds022 <<-EOF &&
320+
find status=down
321+
quit
322+
EOF
323+
${query} -L ${jgf} -f jgf -S CA -P high -t down21.out < cmds021 &&
324+
sed "/\"uniq_id\": 8,/a \ \ \ \ \ \ \ \ \ \ \"status\": 1," ${jgf} > down21.json &&
325+
${query} -L ./down21.json -f jgf -S CA -P high -t down22.out < cmds022 &&
326+
test_cmp down21.out down22.out
327+
'
328+
312329
test_done

0 commit comments

Comments
 (0)