Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:openSUSE:QA:Leap:15
systemd-v234-testsuite
0012-TEST-03-JOBS-remove-qemu-from-test-runs.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0012-TEST-03-JOBS-remove-qemu-from-test-runs.patch of Package systemd-v234-testsuite
From ffa42671ba24400d080b3cc8256deaaffe4678cc Mon Sep 17 00:00:00 2001 From: Thomas Blume <thomas.blume@suse.com> Date: Wed, 6 Mar 2019 10:04:39 +0100 Subject: [PATCH 03/10] TEST-03-JOBS: remove qemu from testrun --- test/TEST-03-JOBS/test.sh | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/test/TEST-03-JOBS/test.sh b/test/TEST-03-JOBS/test.sh index 88bbf3cdac..21d6748e0e 100755 --- a/test/TEST-03-JOBS/test.sh +++ b/test/TEST-03-JOBS/test.sh @@ -4,17 +4,34 @@ set -e TEST_DESCRIPTION="Job-related tests" +export TEST_BASE_DIR=/var/opt/systemd-tests/test . $TEST_BASE_DIR/test-functions +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 @@ -25,21 +42,34 @@ Description=Testsuite service After=multi-user.target [Service] -ExecStart=/test-jobs.sh +ExecStart=$TESTDIR/nspawn-root/test-jobs.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_BASE_DIR/{hello.service,sleep.service,hello-after-sleep.target,unstoppable.service} \ $initdir/etc/systemd/system cp test-jobs.sh $initdir/ + for service in hello.service sleep.service hello-after-sleep.target unstoppable.service testsuite.service; do + cp $initdir/etc/systemd/system/$service /etc/systemd/system/ + done setup_testsuite ) || return 1 + setup_nspawn_root + rm -r $TESTDIR/root +} + +test_cleanup() { + for service in hello.service sleep.service hello-after-sleep.target unstoppable.service testsuite.service; do + rm /etc/systemd/system/$service + done + [[ -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