Build legacy drivers and publish per-OS packages with web activation and DEB
This commit is contained in:
34
tests/test_publish_winclient.sh
Executable file
34
tests/test_publish_winclient.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
[[ $EUID == 0 ]] || { echo 'SKIP: publisher requires root'; exit 0; }
|
||||
t=$(mktemp -d); trap 'rm -rf "$t"' EXIT
|
||||
export MARS_CONF=$t/nwserv.conf MARS_GATEWAY_CONFIG=$t/ipxpkt.json MARS_IPX_INTERFACES=$t/interfaces
|
||||
mkdir -p "$t/sys/public"
|
||||
printf '1 SYS %s/sys\n' "$t" > "$MARS_CONF"
|
||||
printf '%s\n' '{"enabled":true,"network":"0x101","gateway":"10.250.0.1"}' > "$MARS_GATEWAY_CONFIG"
|
||||
printf '%s\n' 'Network Node_Address Primary Device Frame_Type' '00000101 020908070605 No eth0 802.2' > "$MARS_IPX_INTERFACES"
|
||||
./publish-winclient.sh --config-only
|
||||
for os in win95 win98 winme winnt40 win2000 winxp; do
|
||||
f=$t/sys/public/clients/$os/gateway.ini
|
||||
test -f "$f"; tr -d '\r' < "$f" | grep -qx 'network=00000101'; tr -d '\r' < "$f" | grep -qx 'server=020908070605'; tr -d '\r' < "$f" | grep -qx 'ip=10.250.0.1'
|
||||
done
|
||||
if ./publish-winclient.sh --config-only; then echo 'FAIL overwrite'; exit 1; fi
|
||||
rm -r "$t/sys/public/clients"
|
||||
mkdir "$t/binaries"; echo NOT-EXE > "$t/binaries/MARSNET.EXE"
|
||||
if ./publish-winclient.sh "$t/binaries"; then echo 'FAIL invalid EXE'; exit 1; fi
|
||||
[[ ! -e $t/sys/public/clients ]]
|
||||
# Test fixture only; the MZ check is a format sanity check, NOT code authentication.
|
||||
printf MZfixture > "$t/binaries/MARSNET.EXE"
|
||||
printf MZfixture > "$t/binaries/MARSIPX.EXE"
|
||||
if ./publish-winclient.sh "$t/binaries"; then echo 'FAIL incomplete native package'; exit 1; fi
|
||||
printf MZfixture > "$t/binaries/MARSNDIS.SYS"; printf 'fixture\n' > "$t/binaries/MARSNDIS.INF"
|
||||
./publish-winclient.sh "$t/binaries"
|
||||
[[ -f $t/sys/public/clients/winxp/marsndis.sys && -f $t/sys/public/clients/win95/marsnet.exe && ! -e $t/sys/public/clients/win95/marsndis.sys ]]
|
||||
echo 'PASS: publisher network config, six folders, no overwrite, reject invalid/incomplete input, target selection (fixtures only)'
|
||||
rm -r "$t/sys/public/clients"
|
||||
mkdir "$t/legacy"; printf MZfixture > "$t/legacy/MARSNET.EXE"; printf MZfixture > "$t/legacy/MARSNET3.SYS"; printf 'fixture\n' > "$t/legacy/MARSNET.INF"
|
||||
if ./publish-winclient.sh "$t/legacy"; then echo 'FAIL preview gate'; exit 1; fi
|
||||
MARS_ALLOW_PREVIEW=1 ./publish-winclient.sh "$t/legacy"
|
||||
[[ -f $t/sys/public/clients/win95/marsnet3.sys && -f $t/sys/public/clients/winme/marsnet.inf && ! -e $t/sys/public/clients/winnt40/marsnet3.sys && ! -e $t/sys/public/clients/winxp/marsnet.exe ]]
|
||||
echo 'PASS: legacy preview gate and Win9x target routing'
|
||||
Reference in New Issue
Block a user