]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: move TEST-42-EXECSTOPPOST setup to static files
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Dec 2019 10:49:39 +0000 (11:49 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 28 Mar 2020 10:46:48 +0000 (11:46 +0100)
test/TEST-42-EXECSTOPPOST/test.sh
test/test-functions
test/units/testsuite-42.service [new file with mode: 0644]
test/units/testsuite-42.sh [moved from test/TEST-42-EXECSTOPPOST/testsuite.sh with 100% similarity]

index 0c393597c79838d8645487b274cce213abb518fc..e143fb6288e449f0c3abe77bf8d51476bea16119 100755 (executable)
@@ -12,38 +12,9 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
-
         mask_supporting_services
-
-        # setup policy for Type=dbus test
-        mkdir -p $initdir/etc/dbus-1/system.d
-        cat > $initdir/etc/dbus-1/system.d/systemd.test.ExecStopPost.conf <<EOF
-<?xml version="1.0"?>
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
-        "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-    <policy user="root">
-        <allow own="systemd.test.ExecStopPost"/>
-    </policy>
-</busconfig>
-EOF
-
-        # setup the testsuite service
-        cat >$initdir/etc/systemd/system/testsuite.service <<EOF
-[Unit]
-Description=Testsuite service
-Before=getty-pre.target
-Wants=getty-pre.target
-
-[Service]
-ExecStart=/testsuite.sh
-Type=oneshot
-EOF
-        cp testsuite.sh $initdir/
-
-        setup_testsuite
     )
     setup_nspawn_root
 }
 
-do_test "$@"
+do_test "$@" 42
index ca01a81d8e81c4466660a0e7f49bcd1e06e77a8e..eed3c3b9cdfe8432945d75c046f64dfaf6bffc45 100644 (file)
@@ -909,6 +909,19 @@ install_dbus() {
         | while read file; do
         inst $file
     done
+
+    # setup policy for Type=dbus test
+    mkdir -p $initdir/etc/dbus-1/system.d
+    cat > $initdir/etc/dbus-1/system.d/systemd.test.ExecStopPost.conf <<EOF
+<?xml version="1.0"?>
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+        "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+    <policy user="root">
+        <allow own="systemd.test.ExecStopPost"/>
+    </policy>
+</busconfig>
+EOF
 }
 
 install_user_dbus() {
diff --git a/test/units/testsuite-42.service b/test/units/testsuite-42.service
new file mode 100644 (file)
index 0000000..d5d102f
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=TEST-42-EXECSTOPPOST
+Before=getty-pre.target
+Wants=getty-pre.target
+
+[Service]
+ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
+Type=oneshot