15 lines
827 B
Bash
15 lines
827 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
repo=$(realpath "$(dirname "$0")/..")
|
|
binary=$(realpath "$1")
|
|
[[ -x $binary ]]
|
|
sudo -n systemd-run --unit="archy-radio-abi-$$" --wait --pipe --collect \
|
|
--property=CPUQuota=200% --property=MemoryMax=8G --property=MemorySwapMax=0 \
|
|
--property=PrivateNetwork=yes --property=PrivateDevices=yes --property=PrivateTmp=no \
|
|
--property=ProtectSystem=strict --property=ProtectHome=read-only \
|
|
"--property=BindReadOnlyPaths=$binary:/opt/radio-native" \
|
|
--property='TemporaryFileSystem=/run:rw /tmp:rw,size=512M /var/tmp:rw /root:rw /var/lib/archipelago:rw /etc/archipelago-c01:rw /var/lib/archipelago-radio-work:rw,size=256M,mode=700' \
|
|
--setenv=ARCHY_RADIO_ABI=1 \
|
|
/usr/bin/unshare --pid --fork --mount-proc --kill-child \
|
|
/usr/bin/python3 -B "$repo/tests/regression/radio-abi.py"
|