isle/go/integration_test.sh

18 lines
615 B
Bash
Raw Normal View History

2024-10-05 19:12:29 +00:00
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR" || exit
this_user="$(whoami)"
nix-shell -A testShell ../default.nix --run "
echo \"Requesting sudo in order to set thread capabilities, will drop back down to user '$this_user' immediately\"
sudo -E capsh \\
--caps=\"cap_net_admin,cap_net_bind_service+eip cap_setpcap,cap_setuid,cap_setgid+ep\" \\
--keep=1 \\
--user=\"$this_user\" \\
--addamb=cap_net_admin \\
--addamb=cap_net_bind_service \\
2024-10-06 15:15:40 +00:00
-- -c 'ISLE_INTEGRATION_TEST=1 go test $*'
2024-10-05 19:12:29 +00:00
"