#!/bin/sh

exec 2>&1
set -eu

export AUTO_APT_PROXY_NO_CACHE=1
cd ${AUTOPKGTEST_TMP:-${TMPDIR:-/tmp}}

mkdir bin
cat > bin/getent <<EOF
#!/bin/sh
set -eu
sleep 3600
echo 127.0.0.1 auto-apt-proxy
EOF
chmod +x bin/getent

export PATH=$(pwd)/bin:${PATH}
set -x

# auto-apt-proxy should timeout and exit 0 in aproximately 10 seconds. If it
# doesn't finish in 20 seconds, then this test will fail.
timeout --signal=KILL 20 auto-apt-proxy
