Skip to content

Commit

Permalink
[procps-ng] Fix license, add tests
Browse files Browse the repository at this point in the history
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
James Stocks authored and gavindidrichsen committed Mar 25, 2020
1 parent bc820f2 commit 185df61
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 1 deletion.
2 changes: 1 addition & 1 deletion procps-ng/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ system dynamically generated by the kernel to provide information about the \
status of entries in its process table.\
"
pkg_upstream_url="https://gitlab.com/procps-ng/procps"
pkg_license=('gpl' 'lgpl')
pkg_license=('GPL-2.0-or-later')
pkg_source="https://downloads.sourceforge.net/project/${pkg_name}/Production/${pkg_name}-${pkg_version}.tar.xz"
pkg_shasum="10bd744ffcb3de2d591d2f6acf1a54a7ba070fdcc432a855931a5057149f0465"
pkg_deps=(
Expand Down
81 changes: 81 additions & 0 deletions procps-ng/tests/test.bats
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 ]
}
18 changes: 18 additions & 0 deletions procps-ng/tests/test.sh
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"

0 comments on commit 185df61

Please sign in to comment.