Skip to content

Commit

Permalink
testsuite: modify version number check for jobspec
Browse files Browse the repository at this point in the history
Problem: now that version numbers other than 1 continue to execute in
jobspec_parse, the test for "wrong version number" fails

Modify shell/test/jobspec.c by moving "wrong version number" test to
good_input[] and renaming as "different version number"
  • Loading branch information
sam-maloney committed Mar 6, 2025
1 parent 748e638 commit bd95a70
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/shell/test/jobspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ struct input good_input[] = {
"slot->core",
"{\"tasks\": [{\"slot\": \"task\", \"count\": {\"per_slot\": 1}, \"command\": [\"hostname\"], \"attributes\": {}}], \"attributes\": {\"system\": {\"cwd\": \"/home/garlick/proj/flux-core/src/cmd\"}}, \"version\": 1, \"resources\": [{\"count\": 1, \"with\": [{\"count\": 1, \"type\": \"core\"}], \"type\": \"slot\", \"label\": \"task\"}]}",
},
{
"slot->core (different version number)",
"{\"tasks\": [{\"slot\": \"task\", \"count\": {\"per_slot\": 1}, \"command\": [\"hostname\"], \"attributes\": {}}], \"attributes\": {\"system\": {\"cwd\": \"/home/garlick/proj/flux-core/src/cmd\"}}, \"version\": 256, \"resources\": [{\"count\": 1, \"with\": [{\"count\": 1, \"type\": \"core\"}], \"type\": \"slot\", \"label\": \"task\"}]}",
},
{
"node->socket->slot->core",
"{\"resources\": [{\"type\": \"node\", \"count\": 1, \"with\": [{\"type\": \"socket\", \"count\": 1, \"with\": [{\"type\": \"slot\", \"count\": 1, \"with\": [{\"type\": \"core\", \"count\": 1}], \"label\": \"task\"}]}]}], \"tasks\": [{\"command\": [\"hostname\"], \"slot\": \"task\", \"count\": {\"per_slot\": 1}}], \"attributes\": {\"system\": {\"duration\": 0, \"cwd\": \"/usr/libexec/flux\", \"environment\": {}}}, \"version\": 1}",
Expand Down Expand Up @@ -74,6 +78,7 @@ struct input good_input[] = {
};
struct output good_output[] =
{
{1, 1, 1, -1},
{1, 1, 1, -1},
{1, 1, 1, 1},
{30, 30, 3, 15},
Expand All @@ -91,10 +96,6 @@ struct input bad_input[] = {
"empty object",
"{}",
},
{
"wrong version",
"{\"tasks\": [{\"slot\": \"task\", \"count\": {\"per_slot\": 1}, \"command\": [\"hostname\"], \"attributes\": {}}], \"attributes\": {\"system\": {\"cwd\": \"/home/garlick/proj/flux-core/src/cmd\"}}, \"version\": 256, \"resources\": [{\"count\": 1, \"with\": [{\"count\": 1, \"type\": \"core\"}], \"type\": \"slot\", \"label\": \"task\"}]}",
},
{
"missing version",
"{\"tasks\": [{\"slot\": \"task\", \"count\": {\"per_slot\": 1}, \"command\": [\"hostname\"], \"attributes\": {}}], \"attributes\": {\"system\": {\"cwd\": \"/home/garlick/proj/flux-core/src/cmd\"}}, \"resources\": [{\"count\": 1, \"with\": [{\"count\": 1, \"type\": \"core\"}], \"type\": \"slot\", \"label\": \"task\"}]}",
Expand Down

0 comments on commit bd95a70

Please sign in to comment.