3 # not enabling `errtrace` and `pipefail` since those are bash specific
4 set -o errexit
# failing commands causes script to fail
5 set -o nounset
# undefined variables causes script to fail
11 [ -n "${CI_HELPER:=''}" ] || CI_HELPER
="/ci/.github/workflows/ci_helpers.sh"
13 for PKG
in /ci
/*.ipk
; do
14 tar -xzOf "$PKG" .
/control.
tar.gz |
tar xzf
- .
/control
15 # package name including variant
16 PKG_NAME
=$
(sed -ne 's#^Package: \(.*\)$#\1#p' .
/control
)
17 # package version without release
18 PKG_VERSION
=$
(sed -ne 's#^Version: \(.*\)-[0-9]*$#\1#p' .
/control
)
19 # package source contianing test.sh script
20 PKG_SOURCE
=$
(sed -ne 's#^Source: .*/\(.*\)$#\1#p' .
/control
)
22 echo "Testing package $PKG_NAME in version $PKG_VERSION from $PKG_SOURCE"
26 export PKG_NAME PKG_VERSION CI_HELPER
28 TEST_SCRIPT
=$
(find /ci
/ -name "$PKG_SOURCE" -type d
)/test.sh
30 if [ -f "$TEST_SCRIPT" ]; then
31 echo "Use package specific test.sh"
32 if sh
"$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then
33 echo "Test successful"
39 echo "No test.sh script available"
42 opkg remove
"$PKG_NAME" --force-removal-of-dependent-packages --force-remove