2022-11-09 01:29:35 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2023-09-21 21:02:36 +01:00
|
|
|
# This is a fake tailscale daemon that records its arguments, symlinks a
|
2022-11-09 01:29:35 +00:00
|
|
|
# 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"
|
2023-09-21 21:02:36 +01:00
|
|
|
trap 'rm -f "$socket"' EXIT
|
2022-11-09 01:29:35 +00:00
|
|
|
|
2023-09-21 21:02:36 +01:00
|
|
|
while sleep 10; do :; done
|