-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wakebox: add some unit tests (#1404)
- Loading branch information
1 parent
6e926cd
commit 4dae10d
Showing
9 changed files
with
77 additions
and
0 deletions.
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 @@ | ||
|
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,6 @@ | ||
#!/bin/sh | ||
# It's not valid to call wakebox with an empty PATH. | ||
# So we fill PATH with some typical values. | ||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin | ||
|
||
${1}/wakebox -p input.json |
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,16 @@ | ||
{ | ||
"command": [ | ||
"false" | ||
], | ||
"environment": [ | ||
"USER=root", | ||
"HOME=/root", | ||
"PATH=/usr/bin:/bin:/usr/sbin:/sbin" | ||
], | ||
"directory": ".", | ||
"stdin": "", | ||
"user-id": 0, | ||
"group-id": 0, | ||
"mount-ops": [], | ||
"visible": [] | ||
} |
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 @@ | ||
|
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,16 @@ | ||
{ | ||
"command": [ | ||
"sh", "-c", "exit 97" | ||
], | ||
"environment": [ | ||
"USER=root", | ||
"HOME=/root", | ||
"PATH=/usr/bin:/bin:/usr/sbin:/sbin" | ||
], | ||
"directory": ".", | ||
"stdin": "", | ||
"user-id": 0, | ||
"group-id": 0, | ||
"mount-ops": [], | ||
"visible": [] | ||
} |
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,14 @@ | ||
#!/bin/sh | ||
# It's not valid to call wakebox with an empty PATH. | ||
# So we fill PATH with some typical values. | ||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin | ||
|
||
|
||
${1}/wakebox -I -p input.json -o result.json | ||
RET=$? | ||
|
||
[ $RET -ne 0 ] && exit 99 | ||
|
||
[ $(cat result.json | jq .usage.status) -ne 97 ] && exit 98 | ||
|
||
exit 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 @@ | ||
|
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,16 @@ | ||
{ | ||
"command": [ | ||
"true" | ||
], | ||
"environment": [ | ||
"USER=root", | ||
"HOME=/root", | ||
"PATH=/usr/bin:/bin:/usr/sbin:/sbin" | ||
], | ||
"directory": ".", | ||
"stdin": "", | ||
"user-id": 0, | ||
"group-id": 0, | ||
"mount-ops": [], | ||
"visible": [] | ||
} |
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,6 @@ | ||
#!/bin/sh | ||
# It's not valid to call wakebox with an empty PATH. | ||
# So we fill PATH with some typical values. | ||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin | ||
|
||
${1}/wakebox -p input.json |