Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:openSUSE:QA:Leap:15
systemd-v234-testsuite
0015-TEST-06-SELINUX-remove-qemu-from-testrun.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0015-TEST-06-SELINUX-remove-qemu-from-testrun.patch of Package systemd-v234-testsuite
From d19129c626e20ab8322987d7679aede3cc1f5f2b Mon Sep 17 00:00:00 2001 From: Thomas Blume <thomas.blume@suse.com> Date: Thu, 7 Mar 2019 13:41:43 +0100 Subject: [PATCH 06/10] TEST-06-SELINUX: remove qemu from testrun --- test/TEST-06-SELINUX/test.sh | 46 ++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/test/TEST-06-SELINUX/test.sh b/test/TEST-06-SELINUX/test.sh index e0c4c10e1c..9db173d1fa 100755 --- a/test/TEST-06-SELINUX/test.sh +++ b/test/TEST-06-SELINUX/test.sh @@ -10,24 +10,41 @@ TEST_NO_NSPAWN=1 # selinux-policy-targeted # selinux-policy-devel +export TEST_BASE_DIR=/var/opt/systemd-tests/test . $TEST_BASE_DIR/test-functions SETUP_SELINUX=yes KERNEL_APPEND="$KERNEL_APPEND selinux=1 security=selinux" +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 # setup the testsuite service - cat <<EOF >$initdir/etc/systemd/system/testsuite.service + cat >$initdir/etc/systemd/system/testsuite.service <<EOF [Unit] Description=Testsuite service After=multi-user.target @@ -94,15 +111,20 @@ EOF dracut_install checkmodule semodule semodule_package m4 make /usr/libexec/selinux/hll/pp load_policy sefcontext_compile ) || return 1 - # mask some services that we do not want to run in these tests - ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service - ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service - ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service - ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket - ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service + 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