mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
a82a74f2cf
The test was sending SIGKILL to containerboot, which results in no signal propagation down to the bash script that is running as a child process, thus it leaks. Minor changes to the test daemon script, so that it cleans up the socket that it creates on exit, and spawns fewer processes. Fixes tailscale/corp#14833 Signed-off-by: James Tucker <james@tailscale.com>
39 lines
636 B
Bash
39 lines
636 B
Bash
#!/usr/bin/env bash
|
|
#
|
|
# This is a fake tailscale daemon that records its arguments, symlinks a
|
|
# fake LocalAPI socket into place, and does nothing until terminated.
|
|
#
|
|
# It is used by main_test.go to test the behavior of containerboot.
|
|
|
|
set -eu
|
|
|
|
echo $0 $@ >>$TS_TEST_RECORD_ARGS
|
|
|
|
socket=""
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
--socket=*)
|
|
socket="${1#--socket=}"
|
|
shift
|
|
;;
|
|
--socket)
|
|
shift
|
|
socket="$1"
|
|
shift
|
|
;;
|
|
*)
|
|
shift
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ -z "$socket" ]]; then
|
|
echo "didn't find socket path in args"
|
|
exit 1
|
|
fi
|
|
|
|
ln -s "$TS_TEST_SOCKET" "$socket"
|
|
trap 'rm -f "$socket"' EXIT
|
|
|
|
while sleep 10; do :; done
|