vinix-ports / tests / busybox / release.sh
32 lines · 29 sloc · 995 bytes · 6986ca64f9d98f27ccbb5d41decbfe3e3cd60561
Raw
1#!/bin/sh
2# BusyBox init runs this from the signed release package root.
3set -eu
4export PATH=/bin:/usr/bin:/sbin:/usr/sbin LC_ALL=C
5trap '/sbin/poweroff -f' EXIT
6
7test "$(uname -s)" = Vinix
8test "$(uname -o)" = Vinix
9machine=$(uname -m)
10count=0
11while IFS= read -r applet; do
12 test -L "/$applet"
13 test "$(readlink -f "/$applet")" = /bin/busybox
14 count=$((count + 1))
15done </etc/busybox-paths.d/busybox
16test "$count" -gt 280
17test -x /usr/bin/ssl_client
18
19mkdir -p /tmp/busybox-release/hooks
20cd /tmp/busybox-release
21printf '#!/bin/sh\necho ran > /tmp/busybox-release/result\n' >hooks/01-check
22chmod 755 hooks/01-check
23test "$(/bin/run-parts --test hooks)" = hooks/01-check
24/bin/run-parts hooks
25test "$(cat result)" = ran
26
27if [ "$machine" = aarch64 ]; then
28 test "$(/bin/env /bin/awk 'BEGIN { print 6 * 7 }')" = 42
29 test "$(/bin/find hooks -name 01-check)" = hooks/01-check
30fi
31echo "Vinix $machine verified $count installed BusyBox links and ran a hook"
32echo 'VPAC FIXTURE GUEST PASS'
33