-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
t/t0013-config-file.t: test config file bootstrap
- Loading branch information
Showing
9 changed files
with
154 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
session-id = "test" | ||
|
||
# missing tbon-endpoints array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
session-id = "test" | ||
|
||
size = 1 | ||
|
||
# rank is out of range | ||
rank = -1 | ||
|
||
tbon-endpoints = [ | ||
"ipc://@test", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bad-toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
session-id = "test2" | ||
|
||
size = 2 | ||
rank = 0 | ||
|
||
# The @ prefix says use the "abstract namespace" | ||
# See unix(7), zmq_ipc(7) | ||
tbon-endpoints = [ | ||
"ipc://@flux-test-2-0", | ||
"ipc://@flux-test-2-1", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
session-id = "test2" | ||
|
||
size = 2 | ||
rank = 1 | ||
|
||
# The @ prefix says use the "abstract namespace" | ||
# See unix(7), zmq_ipc(7) | ||
tbon-endpoints = [ | ||
"ipc://@flux-test-2-0", | ||
"ipc://@flux-test-2-1", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
session-id = "test" | ||
|
||
size = 1 | ||
rank = 0 | ||
|
||
tbon-endpoints = [ | ||
"ipc://@flux-test-1-0", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
session-id = "test" | ||
|
||
tbon-endpoints = [ | ||
"tcp://127.0.0.1:8500", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#!/bin/sh | ||
# | ||
|
||
test_description='Test config file overlay bootstrap' | ||
|
||
. `dirname $0`/sharness.sh | ||
|
||
TCONFDIR=${FLUX_SOURCE_DIR}/t/conf.d | ||
|
||
# | ||
# check boot.method | ||
# | ||
|
||
test_expect_success 'flux broker with explicit PMI boot method works' ' | ||
flux broker -Sboot.method=pmi /bin/true | ||
' | ||
|
||
test_expect_success 'flux broker with unknown boot method fails' ' | ||
test_must_fail flux broker -Sboot.method=badmethod /bin/true | ||
' | ||
|
||
# | ||
# check boot.config_file | ||
# | ||
|
||
test_expect_success 'flux broker without boot.config_file fails' ' | ||
test_must_fail flux broker -Sboot.method=config /bin/true | ||
' | ||
|
||
test_expect_success 'flux broker with boot.config_file=/badfile fails' ' | ||
test_must_fail flux broker -Sboot.method=config \ | ||
-Sboot.config_file=/badfile /bin/true | ||
' | ||
|
||
test_expect_success 'flux broker with boot.config_file=bad-toml fails' ' | ||
test_must_fail flux broker -Sboot.method=config \ | ||
-Sboot.config_file=${TCONFDIR}/bad-toml.conf /bin/true | ||
' | ||
|
||
test_expect_success 'flux broker with missing required items fails' ' | ||
test_must_fail flux broker -Sboot.method=config \ | ||
-Sboot.config_file=${TCONFDIR}/bad-missing.conf /bin/true | ||
' | ||
|
||
test_expect_success 'flux broker with boot.config_file=bad-rank fails' ' | ||
test_must_fail flux broker -Sboot.method=config \ | ||
-Sboot.config_file=${TCONFDIR}/bad-rank.conf /bin/true | ||
' | ||
|
||
# | ||
# trigger config_file boot failure due to incompat attr setting | ||
# | ||
|
||
test_expect_success 'flux broker with incompat attrs fails' ' | ||
test_must_fail flux broker -Sboot.method=config \ | ||
-Sboot.config_file=${TCONFDIR}/shared.conf \ | ||
-Ssession-id=xyz \ | ||
/bin/true | ||
' | ||
|
||
# | ||
# size=1 boot from config file | ||
# | ||
|
||
test_expect_success 'start size=1 with shared config file, expected attrs set' ' | ||
run_timeout 5 flux broker -Sboot.method=config \ | ||
-Sboot.config_file=${TCONFDIR}/shared.conf \ | ||
flux lsattr -v >1s.out && | ||
grep -q "session-id[ ]*test$" 1s.out && | ||
grep -q "tbon.endpoint[ ]*tcp://127.0.0.1:8500$" 1s.out && | ||
grep -q "mcast.endpoint[ ]*tbon$" 1s.out | ||
' | ||
|
||
test_expect_success 'start size=1 with private config file' ' | ||
run_timeout 5 flux broker -Sboot.method=config \ | ||
-Sboot.config_file=${TCONFDIR}/private.conf /bin/true | ||
' | ||
|
||
# | ||
# size=2 boot from config file | ||
# | ||
|
||
test_expect_success 'start size=2 with private config files' ' | ||
flux broker -Sboot.method=config \ | ||
-Sboot.config_file=${TCONFDIR}/priv2.0.conf \ | ||
flux exec flux getattr tbon.endpoint >2p.out & | ||
run_timeout 5 flux broker -Sboot.method=config \ | ||
-Sboot.config_file=${TCONFDIR}/priv2.1.conf && | ||
run_timeout 5 wait && | ||
echo "ipc://@flux-test-2-0" >2p.exp && | ||
echo "ipc://@flux-test-2-1" >>2p.exp && | ||
test_cmp 2p.exp 2p.out | ||
' | ||
|
||
test_done |