From 3bba5802edfc5e7f5115ef58c43c0596e6c36fb4 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 12 Dec 2022 05:40:15 -0600 Subject: [PATCH] Better error reporting. --- scripts/test_mkroot.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/test_mkroot.sh b/scripts/test_mkroot.sh index e78a1f7b..11ee0b26 100755 --- a/scripts/test_mkroot.sh +++ b/scripts/test_mkroot.sh @@ -1,7 +1,9 @@ #!/bin/bash +die() { echo "$@"; exit 1; } + [ -n "$(which toybox)" -a -n "$(which mksquashfs)" ] || - { echo "Need toybox and mksquashfs in $PATH"; exit 1; } + die "Need toybox and mksquashfs in $PATH" mkdir -p "${TEST:=$PWD/root/build/test}" && @@ -18,12 +20,12 @@ chmod +x "$TEST"/init && mksquashfs "$TEST"/init "$TEST"/init.sqf -noappend >/dev/null && # Setup for network smoke test -echo === net ok > "$TEST"/index.html || exit 1 +echo === net ok > "$TEST"/index.html || die "smoketest setup" toybox netcat -p 65432 -s 127.0.0.1 -L toybox httpd "$TEST" & trap "kill $!" EXIT sleep .25 -[ -n "$(wget http://127.0.0.1:65432/ -O - | grep ===)" ] || exit 1 +[ -n "$(toybox wget http://127.0.0.1:65432/ -O - | grep ===)" ] || die "wget" COUNT=0 CPUS=$(($(nproc)+0)) for I in root/*/linux-kernel -- 2.39.2