test: make sure to reset state before starting integration tests

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-12-13 12:34:41 +01:00
parent 8a59e79c09
commit 4962ed9f33
45 changed files with 49 additions and 0 deletions

View File

@@ -1899,6 +1899,9 @@ test_setup() {
}
test_run() {
mount_initdir
rm -f "$initdir"/{testok,failed,skipped}
if [ -z "$TEST_NO_QEMU" ]; then
if run_qemu "$1"; then
check_result_qemu || return 1

View File

@@ -3,5 +3,6 @@ Description=TEST-01-BASIC
After=multi-user.target
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=sh -e -x -c 'systemctl --state=failed --no-legend --no-pager >/failed ; systemctl daemon-reload ; echo OK >/testok'
Type=oneshot

View File

@@ -3,5 +3,6 @@ Description=TEST-02-CRYPTSETUP
After=multi-user.target
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=sh -x -c 'systemctl --state=failed --no-legend --no-pager >/failed ; echo OK > /testok'
Type=oneshot

View File

@@ -3,5 +3,6 @@ Description=TEST-03-JOBS
After=multi-user.target
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -2,5 +2,6 @@
Description=TEST-04-JOURNAL
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -2,5 +2,6 @@
Description=TEST-05-RLIMITS
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -5,5 +5,6 @@ Requires=load-systemd-test-module.service
After=load-systemd-test-module.service
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -2,5 +2,6 @@
Description=TEST-07-ISSUE-1981
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -2,5 +2,6 @@
Description=TEST-08-ISSUE-2730
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=sh -x -c 'mount -o remount,rw /dev/sda1 && echo OK >/testok; systemctl poweroff'
Type=oneshot

View File

@@ -2,6 +2,7 @@
Description=TEST-09-ISSUE-2691
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=sh -c '>/testok'
ExecStop=sh -c 'kill -SEGV $$$$'
Type=oneshot

View File

@@ -2,5 +2,6 @@
Description=TEST-10-ISSUE-2467
[Service]
ExecStartPre=rm -f /failed /testok
Type=oneshot
ExecStart=sh -e -x -c 'rm -f /tmp/nonexistent; systemctl start test10.socket; printf x >test.file; socat -t20 OPEN:test.file UNIX-CONNECT:/run/test.ctl; >/testok'

View File

@@ -2,5 +2,6 @@
Description=TEST-11-ISSUE-3166
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -3,5 +3,6 @@ Description=TEST-12-ISSUE-3171
After=multi-user.target
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -2,5 +2,6 @@
Description=TEST-13-NSPAWN-SMOKE
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -2,6 +2,7 @@
Description=TEST-14-MACHINE-ID
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
ExecStart=/bin/sh -e -x -c 'systemctl --state=failed --no-legend --no-pager >/failed ; echo OK >/testok'
Type=oneshot

View File

@@ -2,5 +2,6 @@
Description=TEST-15-DROPIN
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -12,6 +12,7 @@ Wants=fail-runtime.service
StopWhenUnneeded=yes
[Service]
ExecStartPre=rm -f /failed /testok
Type=simple
TimeoutStartSec=infinity
ExecStartPre=/usr/lib/systemd/tests/testdata/units/%N.sh

View File

@@ -2,5 +2,6 @@
Description=TEST-17-UDEV-WANTS
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -2,5 +2,6 @@
Description=TEST-18-FAILUREACTION
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@@ -2,5 +2,6 @@
Description=TEST-19-DELEGATE
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

Some files were not shown because too many files have changed in this diff Show More