Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:openSUSE:QA:Leap:15
systemd-v234-testsuite
0016-TEST-07-ISSUE-1981-remove-qemu-from-testru...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0016-TEST-07-ISSUE-1981-remove-qemu-from-testrun.patch of Package systemd-v234-testsuite
From b54108bb2944962e167e763f1e6dbae540ecb126 Mon Sep 17 00:00:00 2001 From: Thomas Blume <thomas.blume@suse.com> Date: Thu, 7 Mar 2019 13:45:32 +0100 Subject: [PATCH 07/10] TEST-07-ISSUE-1981: remove qemu from testrun --- test/TEST-07-ISSUE-1981/test-segfault.sh | 4 +-- test/TEST-07-ISSUE-1981/test.sh | 45 +++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/test/TEST-07-ISSUE-1981/test-segfault.sh b/test/TEST-07-ISSUE-1981/test-segfault.sh index 48f05d89fb..0e8e0feb34 100755 --- a/test/TEST-07-ISSUE-1981/test-segfault.sh +++ b/test/TEST-07-ISSUE-1981/test-segfault.sh @@ -5,13 +5,13 @@ set -e >/failed -cat <<'EOL' >/lib/systemd/system/my.service +cat <<'EOL' >/usr/lib/systemd/system/my.service [Service] Type=oneshot ExecStart=/bin/echo Timer runs me EOL -cat <<'EOL' >/lib/systemd/system/my.timer +cat <<'EOL' >/usr/lib/systemd/system/my.timer [Timer] OnBootSec=10s OnUnitInactiveSec=1h diff --git a/test/TEST-07-ISSUE-1981/test.sh b/test/TEST-07-ISSUE-1981/test.sh index 88d143e479..c648d72419 100755 --- a/test/TEST-07-ISSUE-1981/test.sh +++ b/test/TEST-07-ISSUE-1981/test.sh @@ -5,19 +5,36 @@ set -e TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/1981" TEST_NO_QEMU=1 +export TEST_BASE_DIR=/var/opt/systemd-tests/test . $TEST_BASE_DIR/test-functions NSPAWN_TIMEOUT=30s +test_run() { + ret=1 + systemctl daemon-reload + systemctl start testsuite.service || return 1 + systemctl status --full testsuite.service + if [ -z "$TEST_NO_NSPAWN" ]; then + if run_nspawn; then + check_result_nspawn || return 1 + else + dwarn "can't run systemd-nspawn, skipping" + fi + fi + test -s /failed && ret=$(($ret+1)) + [[ -e /testok ]] && ret=0 + return $ret +} + test_setup() { - create_empty_image mkdir -p $TESTDIR/root - mount ${LOOPDEV}p1 $TESTDIR/root + initdir=$TESTDIR/root + STRIP_BINARIES=no # Create what will eventually be our root filesystem onto an overlay ( LOG_LEVEL=5 - eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) setup_basic_environment @@ -28,18 +45,32 @@ Description=Testsuite service After=multi-user.target [Service] -ExecStart=/test-segfault.sh +ExecStart=$TESTDIR/nspawn-root/test-segfault.sh +ExecStartPost=/bin/sh -x -c 'echo -e "\nfailed:" > /failed; systemctl --state=failed --no-pager >> /failed; echo -e "\ntestresult:\nOK" > /testok' Type=oneshot EOF - + # copy the units used by this test + cp $initdir/etc/systemd/system/testsuite.service /etc/systemd/system/testsuite.service cp test-segfault.sh $initdir/ setup_testsuite ) || return 1 + setup_nspawn_root + rm -r $TESTDIR/root +} + +test_cleanup() { + for file in testsuite.service my.timer.d ; do + rm -rf /etc/systemd/system/$service + done + rm /usr/lib/systemd/system/my.service + rm /usr/lib/systemd/system/my.timer + + [[ -e /testok ]] && rm /testok + [[ -e /failed ]] && rm /failed + return 0 - ddebug "umount $TESTDIR/root" - umount $TESTDIR/root } do_test "$@" -- 2.16.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor