Debian Codegraph @

debian/tests/network-test

raw
1 #!/bin/bash
2
3 LOGFILE="$AUTOPKGTEST_TMP/test-network.log"
4
5 sed -i 's/^\(restricted-network .*\)/#\1/' /etc/firejail/firejail.config
6 sed -i 's/^\(cgroup .*\)/#\1/' /etc/firejail/firejail.config
7
8 # copy tests to temporary directory, as current one might be read-only
9 cp -a test "$AUTOPKGTEST_TMP"
10 cd "$AUTOPKGTEST_TMP/test"
11 [ -z "$AUTOPKGTEST_NORMAL_USER" ] && AUTOPKGTEST_NORMAL_USER="nobody"
12
13 pushd network
14 bash -x ./configure
15 echo $AUTOPKGTEST_NORMAL_USER > /etc/firejail/firejail.users
16 runuser -u $AUTOPKGTEST_NORMAL_USER -g nogroup -- bash -x ./network.sh | tee "$LOGFILE"
17 popd
18
19 echo "======================================"
20 grep "TESTING" "$LOGFILE"
21 echo "======================================"
22
23 [ $(grep -c "TESTING ERROR" "$LOGFILE") -gt 0 ] && exit 1
24
25 exit 0