summaryrefslogtreecommitdiffstats
path: root/debian/tests/upstream-system-tests
blob: bd28a0c084e0899d91aca39981608d26f2560048 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# Run the upstream system tests in a container. Destructive tests will be run in
# a VM as they may adjust/step the system clock, block the RTC, etc.
# In case of failure, test’s logs will be put into the directory specified by
# the $AUTOPKGTEST_ARTIFACTS environment variable.

set -e

testdir=$PWD/test/system
logdir="$testdir/tmp/*"

# some tests need chrony installed, but make sure to avoid the test daemon is
# fighting with the systems chrony service over the clock
systemctl stop chrony.service 2>/dev/null || true

run_test() {
     cd "$testdir" && ./run "$@"
}

artifacts() {
    cp $logdir "$AUTOPKGTEST_ARTIFACTS" && exit 1
}

run_test "$@" || artifacts