File: getent-timeout

package info (click to toggle)
auto-apt-proxy 17
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: sh: 428; makefile: 11
file content (23 lines) | stat: -rwxr-xr-x 434 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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