-
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 1e9233b
Showing
11 changed files
with
79 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 @@ | ||
{"usage":{"status":1,"membytes":4341760,"inbytes":0,"outbytes":0,"runtime":0.023453,"cputime":0.003199},"inputs":[],"outputs":[],"run-host":"pe01.internal.sifive.com"} |
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 @@ | ||
{"usage":{"status":97,"membytes":4255744,"inbytes":0,"outbytes":0,"runtime":0.022961,"cputime":0.003021},"inputs":[],"outputs":[],"run-host":"pe01.internal.sifive.com"} |
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 |