Skip to content

Commit

Permalink
testsuite: add equality check for set-status vs JGF status
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
milroy committed Dec 22, 2023
1 parent 8ebed6d commit 25a817d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions t/t3025-resource-find.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ full_job="${SHARNESS_TEST_SRCDIR}/data/resource/jobspecs/find/full.yaml"
cmd_dir="${SHARNESS_TEST_SRCDIR}/data/resource/commands/find"
exp_dir="${SHARNESS_TEST_SRCDIR}/data/resource/expected/find"
grugs="${SHARNESS_TEST_SRCDIR}/data/resource/grugs/tiny.graphml"
jgf="${SHARNESS_TEST_SRCDIR}/data/resource/jgfs/tiny.json"
query="../../resource/utilities/resource-query"

skip_all_unless_have jq
Expand Down Expand Up @@ -309,4 +310,20 @@ EOF
test ${core} = "\"0\""
'

test_expect_success 'setting vertex down in JGF same as set-status' '
cat > cmds021 <<-EOF &&
set-status /tiny0/rack0/node0/socket0/core0 down
find status=down
quit
EOF
cat > cmds022 <<-EOF &&
find status=down
quit
EOF
${query} -L ${jgf} -f jgf -S CA -P high -t down21.out < cmds021 &&
sed "/\"uniq_id\": 8,/a \ \ \ \ \ \ \ \ \ \ \"status\": 1," ${jgf} > down21.json &&
${query} -L ./down21.json -f jgf -S CA -P high -t down22.out < cmds022 &&
test_cmp down21.out down22.out
'

test_done

0 comments on commit 25a817d

Please sign in to comment.