isle/tests.sh

17 lines
454 B
Bash
Raw Normal View History

2023-09-01 16:28:22 +00:00
#!/usr/bin/env bash
set -e
entrypoint="$(nix-build --no-out-link -A tests)"
this_user="$(whoami)"
echo "Requesting sudo in order to set thread capabilities, will drop back down to user '$this_user' immediately"
sudo -E capsh \
2023-09-06 19:55:05 +00:00
--caps="cap_net_admin,cap_net_bind_service+eip cap_setpcap,cap_setuid,cap_setgid+ep" \
2023-09-01 16:28:22 +00:00
--keep=1 \
--user="$this_user" \
--addamb=cap_net_admin \
2023-09-06 19:55:05 +00:00
--addamb=cap_net_bind_service \
2023-09-01 16:28:22 +00:00
-- "$entrypoint" "$@"