Skip to content

Commit 07f7b2c

Browse files
committed
testsuite: test validator detection of invalid hosts
Problem: No tests in the testsuite ensure that the job validator catches invalid hosts in a hostlist constraint. Add a couple tests to t2110-job-ingest-validator.t.
1 parent 71be116 commit 07f7b2c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/t2110-job-ingest-validator.t

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ test_expect_success 'job-ingest: all valid jobspecs accepted' '
117117
test_expect_success 'job-ingest: invalid jobs rejected' '
118118
test_invalid ${JOBSPEC}/invalid/*
119119
'
120+
test_expect_success 'job-ingest: invalid hostlist constraint is caught' '
121+
test_must_fail flux run --requires=host:badhost true \
122+
2>host-inval.err &&
123+
test_debug "cat host-inval.err" &&
124+
grep "invalid host.*badhost.*not found" host-inval.err
125+
'
126+
test_expect_success 'job-ingest: one invalid host among multiple is caught' '
127+
host=$(hostname) &&
128+
test_must_fail flux run --requires=host:$host,badhost true \
129+
2>hosts-inval.err &&
130+
test_debug "cat hosts-inval.err" &&
131+
grep "invalid host.*badhost.*not found" hosts-inval.err
132+
'
120133
test_expect_success 'job-ingest: stop the queue so no more jobs run' '
121134
flux queue stop
122135
'

0 commit comments

Comments
 (0)