check-uninsane: test FTP over doof (and simplify)

This commit is contained in:
2024-06-18 08:09:06 +00:00
parent 478b443430
commit be84747ffc

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl -p dig -p iputils -p lftp -p openssh #!nix-shell -i bash -p curl -p dig -p iputils -p openssh
echo "this script will check that uninsane.org is baseline operational" echo "this script will check that uninsane.org is baseline operational"
echo "it doesn't check all services, just the most critical ones" echo "it doesn't check all services, just the most critical ones"
@@ -95,19 +95,8 @@ check "servo-hn wireguard network" ping -c 1 -W 3 servo-hn
check "git.uninsane.org" git ls-remote https://git.uninsane.org/colin/nix-files.git --quiet check "git.uninsane.org" git ls-remote https://git.uninsane.org/colin/nix-files.git --quiet
lftpgetIntoTmp() { check "ftps://ftp.uninsane.org" curl --silent ftps://ftp.uninsane.org/pub/test
local url="$1" check "[DOOF] ftps://ftp.uninsane.org" curl "--connect-to" "uninsane.org:80:$DOOF_IPV4:80" --silent ftps://ftp.uninsane.org/pub/test
local localName="$2"
(
# run these commands in a subshell to preserve the old PWD
pushd /tmp
rm -f "$localName"
lftpget "$url"
)
local contents=$(cat "/tmp/$localName")
test "$contents" = "automated tests read this file to probe connectivity"
}
check "ftps://ftp.uninsane.org" lftpgetIntoTmp ftps://ftp.uninsane.org/pub/test test
echo "" echo ""
echo "systemctl --failed:" echo "systemctl --failed:"