Skip to content

Commit 21c1498

Browse files
committed
testsuite: test for invalid exclude host in t2312-resource-exclude.t
Problem: No tests in t2312-resource-exclude.t ensure that an invalid hostname in resource.exclude results in a reasonable error. Add a test to t2312-resource-exclude.t.
1 parent fd67007 commit 21c1498

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

t/t2312-resource-exclude.t

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,19 @@ test_expect_success 'instance with configured R can exclude hostnames' '
9797
test $(flux start -s1 -o,--config-path=exclude3.toml \
9898
flux resource status -s exclude -no {nnodes}) -eq 1
9999
'
100+
test_expect_success 'incorrect excluded hostnames raises correct error' '
101+
cat >exclude4.toml <<-EOT &&
102+
[resource]
103+
exclude = "badhost"
104+
noverify = true
105+
[[resource.config]]
106+
hosts = "$(hostname -s)"
107+
cores = "0"
108+
EOT
109+
test_must_fail flux start -o,--config-path=exclude4.toml true \
110+
2>exclude4.err &&
111+
test_debug "cat exclude4.err" &&
112+
grep "invalid hosts: badhost" exclude4.err
113+
'
100114

101115
test_done

0 commit comments

Comments
 (0)