]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/README.testsuite
docs: document new description field
[thirdparty/systemd.git] / test / README.testsuite
CommitLineData
64d14b7e 1The extended testsuite only works with UID=0. It contains of several
c452e372
HH
2subdirectories named "test/TEST-??-*", which are run one by one.
3
4To run the extended testsuite do the following:
5
64d14b7e
ZJS
6$ ninja -C build # Avoid building anything as root later
7$ sudo test/run-integration-tests.sh
8ninja: Entering directory `/home/zbyszek/src/systemd/build'
9ninja: no work to do.
10--x-- Running TEST-01-BASIC --x--
11+ make -C TEST-01-BASIC BUILD_DIR=/home/zbyszek/src/systemd/build clean setup run
12make: Entering directory '/home/zbyszek/src/systemd/test/TEST-01-BASIC'
8af10ca3
ZJS
13TEST-01-BASIC CLEANUP: Basic systemd setup
14TEST-01-BASIC SETUP: Basic systemd setup
c452e372 15...
8af10ca3 16TEST-01-BASIC RUN: Basic systemd setup [OK]
64d14b7e
ZJS
17make: Leaving directory '/home/zbyszek/src/systemd/test/TEST-01-BASIC'
18--x-- Result of TEST-01-BASIC: 0 --x--
19--x-- Running TEST-02-CRYPTSETUP --x--
20+ make -C TEST-02-CRYPTSETUP BUILD_DIR=/home/zbyszek/src/systemd/build clean setup run
c452e372
HH
21
22If one of the tests fails, then $subdir/test.log contains the log file of
23the test.
24
64d14b7e 25To run just one of the cases:
c452e372 26
64d14b7e 27$ sudo make -C test/TEST-01-BASIC clean setup run
c452e372 28
64d14b7e
ZJS
29Specifying the build directory
30==============================
c6a77179 31
64d14b7e
ZJS
32If the build directory is not detected automatically, it can be specified
33with BUILD_DIR=:
c452e372 34
64d14b7e 35$ sudo BUILD_DIR=some-other-build/ test/run-integration-tests
c452e372 36
64d14b7e 37or
c452e372 38
64d14b7e 39$ sudo make -C test/TEST-01-BASIC BUILD_DIR=../../some-other-build/ ...
c6a77179 40
64d14b7e
ZJS
41Note that in the second case, the path is relative to the test case directory.
42An absolute path may also be used in both cases.
43
44Configuration variables
45=======================
46
5a2114b6
FS
47TEST_NO_QEMU=1
48 Don't run tests under QEMU
64d14b7e 49
5a2114b6
FS
50TEST_NO_NSPAWN=1
51 Don't run tests under systemd-nspawn
c6a77179 52
5a2114b6 53TEST_NO_KVM=1
46c41478 54 Disable QEMU KVM auto-detection (may be necessary when you're trying to run the
5a2114b6
FS
55 *vanilla* QEMU and have both qemu and qemu-kvm installed)
56
501deda1
FS
57TEST_NESTED_KVM=1
58 Allow tests to run with nested KVM. By default, the testsuite disables
59 nested KVM if the host machine already runs under KVM. Setting this
60 variable disables such checks
61
5a2114b6
FS
62QEMU_MEM=512M
63 Configure amount of memory for QEMU VMs (defaults to 512M)
64
65QEMU_SMP=1
66 Configure number of CPUs for QEMU VMs (defaults to 1)
67
68KERNEL_APPEND='...'
69 Append additional parameters to the kernel command line
70
71NSPAWN_ARGUMENTS='...'
72 Specify additional arguments for systemd-nspawn
73
74QEMU_TIMEOUT=infinity
75 Set a timeout for tests under QEMU (defaults to infinity)
76
77NSPAWN_TIMEOUT=infinity
78 Set a timeout for tests under systemd-nspawn (defaults to infinity)
79
80INTERACTIVE_DEBUG=1
81 Configure the machine to be more *user-friendly* for interactive debuggung
82 (e.g. by setting a usable default terminal, suppressing the shutdown after
83 the test, etc.)
64d14b7e
ZJS
84
85The kernel and initramfs can be specified with $KERNEL_BIN and $INITRD.
86(Fedora's or Debian's default kernel path and initramfs are used by default)
c6a77179
RC
87
88A script will try to find your QEMU binary. If you want to specify a different
64d14b7e
ZJS
89one with $QEMU_BIN.
90
91Debugging the qemu image
92========================
93
94If you want to log in the testsuite virtual machine, you can specify additional
95kernel command line parameter with $KERNEL_APPEND and then log in as root.
96
97$ sudo make -C test/TEST-01-BASIC KERNEL_APPEND="systemd.unit=multi-user.target" run
c6a77179 98
64d14b7e 99Root password is empty.
b4532d65
DS
100
101Ubuntu CI
102=========
103
104New PR submitted to the project are run through regression tests, and one set
105of those is the 'autopkgtest' runs for several different architectures, called
106'Ubuntu CI'. Part of that testing is to run all these tests. Sometimes these
825cba0d 107tests are temporarily deny-listed from running in the 'autopkgtest' tests while
b4532d65 108debugging a flaky test; that is done by creating a file in the test directory
825cba0d 109named 'deny-list-ubuntu-ci', for example to prevent the TEST-01-BASIC test from
b4532d65 110running in the 'autopkgtest' runs, create the file
825cba0d 111'TEST-01-BASIC/deny-list-ubuntu-ci'.
b4532d65 112
825cba0d 113The tests may be disabled only for specific archs, by creating a deny-list file
b4532d65 114with the arch name at the end, e.g.
825cba0d 115'TEST-01-BASIC/deny-list-ubuntu-ci-arm64' to disable the TEST-01-BASIC test
b4532d65
DS
116only on test runs for the 'arm64' architecture.
117
118Note the arch naming is not from 'uname -m', it is Debian arch names:
119https://wiki.debian.org/ArchitectureSpecificsMemo
120
825cba0d
DS
121For PRs that fix a currently deny-listed test, the PR should include removal
122of the deny-list file.