-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test for add/rm dep via dinitctl
- Loading branch information
Showing
9 changed files
with
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[{+} ] main | ||
[{+} ] secondary |
Empty file.
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,2 @@ | ||
[{+} ] main | ||
[ {-}] secondary |
Empty file.
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 @@ | ||
Service started. |
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,58 @@ | ||
#!/bin/sh | ||
|
||
../../dinit -d sd -u -p socket -q main & | ||
DINITPID=$! | ||
|
||
# give time for socket to open | ||
while [ ! -e socket ]; do | ||
sleep 0.1 | ||
done | ||
|
||
STATUS=FAIL | ||
|
||
DINITCTL="../../dinitctl -p socket" | ||
|
||
while | ||
|
||
out=$($DINITCTL list) | ||
if [ $? != 0 ]; then break; fi | ||
if [ "$out" != "$(cat expected1)" ]; then break; fi | ||
# both "main" and "secondary" should be running | ||
|
||
out=$($DINITCTL rm-dep waits-for main secondary) | ||
if [ $? != 0 ]; then break; fi | ||
if [ "$out" != "$(cat expected2)" ]; then break; fi | ||
# "secondary" should stop | ||
|
||
out=$($DINITCTL list) | ||
if [ $? != 0 ]; then break; fi | ||
if [ "$out" != "$(cat expected3)" ]; then break; fi | ||
|
||
out=$($DINITCTL add-dep waits-for main secondary) | ||
if [ $? != 0 ]; then break; fi | ||
if [ "$out" != "$(cat expected4)" ]; then break; fi | ||
# "secondary" will not automatically start, this is a waits-for dep | ||
|
||
out=$($DINITCTL list) | ||
if [ $? != 0 ]; then break; fi | ||
if [ "$out" != "$(cat expected3)" ]; then break; fi | ||
|
||
out=$($DINITCTL wake secondary) | ||
if [ $? != 0 ]; then break; fi | ||
if [ "$out" != "$(cat expected5)" ]; then break; fi | ||
# if we wake "secondary" it should start and remain started | ||
|
||
out=$($DINITCTL list) | ||
if [ $? != 0 ]; then break; fi | ||
if [ "$out" != "$(cat expected1)" ]; then break; fi | ||
|
||
STATUS=PASS | ||
false | ||
|
||
do :; done | ||
|
||
kill $DINITPID | ||
wait $DINITPID | ||
|
||
if [ $STATUS = PASS ]; then exit 0; fi | ||
exit 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,2 @@ | ||
type = internal | ||
waits-for = secondary |
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 @@ | ||
type = internal |
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