forked from habitat-sh/core-plans
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
License set according to https://gitlab.com/procps-ng/procps This plan should source the package from Gitlab and not from sourceforge, but Gitlab does not seem to have releases (only tags) - I will raise an issue for this. Signed-off-by: James Stocks <jstocks@chef.io>
- Loading branch information
1 parent
bc820f2
commit 185df61
Showing
3 changed files
with
100 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,81 @@ | ||
expected_version="$(echo $TEST_PKG_IDENT | cut -d/ -f 3)" | ||
|
||
@test "free version is $expected_version" { | ||
run hab pkg exec $TEST_PKG_IDENT free --version | ||
[ "$output" = "free from procps-ng $expected_version" ] | ||
} | ||
|
||
@test "free runs" { | ||
run hab pkg exec $TEST_PKG_IDENT free | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "pgrep runs" { | ||
run hab pkg exec $TEST_PKG_IDENT pgrep -v no_such_pids | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "pidof runs" { | ||
run hab pkg exec $TEST_PKG_IDENT pidof pidof | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "pkill runs" { | ||
run hab pkg exec $TEST_PKG_IDENT pkill -h | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "pmap runs" { | ||
run hab pkg exec $TEST_PKG_IDENT pmap -h | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "ps runs" { | ||
run hab pkg exec $TEST_PKG_IDENT ps | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "pwdx runs" { | ||
run hab pkg exec $TEST_PKG_IDENT pwdx -h | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "slaptop runs" { | ||
run hab pkg exec $TEST_PKG_IDENT slabtop -o | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "sysctl runs" { | ||
run hab pkg exec $TEST_PKG_IDENT sysctl -a | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "tload runs" { | ||
run hab pkg exec $TEST_PKG_IDENT tload -h | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "top runs" { | ||
run hab pkg exec $TEST_PKG_IDENT top -h | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "uptime runs" { | ||
run hab pkg exec $TEST_PKG_IDENT uptime | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "vmstat runs" { | ||
run hab pkg exec $TEST_PKG_IDENT vmstat | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "w runs" { | ||
run hab pkg exec $TEST_PKG_IDENT w | ||
[ $status -eq 0 ] | ||
} | ||
|
||
@test "watch runs" { | ||
run hab pkg exec $TEST_PKG_IDENT watch -h | ||
[ $status -eq 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,18 @@ | ||
#!/bin/sh | ||
|
||
set -euo pipefail | ||
|
||
TESTDIR="$(dirname "${0}")" | ||
|
||
if [ -z "${1:-}" ]; then | ||
echo "Usage: $0 FULLY_QUALIFIED_PACKAGE_IDENT" | ||
exit 1 | ||
fi | ||
|
||
TEST_PKG_IDENT="$1" | ||
|
||
hab pkg install --binlink core/bats | ||
hab pkg install "$TEST_PKG_IDENT" | ||
|
||
export TEST_PKG_IDENT | ||
bats "${TESTDIR}/test.bats" |