Skip to content

Commit 745e3e0

Browse files
authored
Merge pull request #1125 from milroy/ctor-fix
Fix `resource_pool_t` ctor and JGF reader
2 parents fe872c8 + 01053e8 commit 745e3e0

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

resource/readers/resource_reader_jgf.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ void fetch_helper_t::scrub ()
139139
size = -1;
140140
uniq_id = -1;
141141
exclusive = -1;
142+
status = resource_pool_t::status_t::UP;
142143
type = NULL;
143144
name = NULL;
144145
unit = NULL;

resource/schema/resource_data.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ resource_pool_t::resource_pool_t (const resource_pool_t &o)
4141
id = o.id;
4242
uniq_id = o.uniq_id;
4343
rank = o.rank;
44+
status = o.status;
4445
size = o.size;
4546
unit = o.unit;
4647
schedule = o.schedule;
@@ -57,6 +58,7 @@ resource_pool_t &resource_pool_t::operator= (const resource_pool_t &o)
5758
id = o.id;
5859
uniq_id = o.uniq_id;
5960
rank = o.rank;
61+
status = o.status;
6062
size = o.size;
6163
unit = o.unit;
6264
schedule = o.schedule;

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)