]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: move TEST-28-PERCENTJ-WANTEDBY setup to static files
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Dec 2019 08:32:44 +0000 (09:32 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 28 Mar 2020 10:46:47 +0000 (11:46 +0100)
test/TEST-28-PERCENTJ-WANTEDBY/test.sh
test/meson.build
test/testsuite-28.units/specifier-j-depends-wants.service [new file with mode: 0644]
test/testsuite-28.units/specifier-j-wants.service [new file with mode: 0644]
test/units/testsuite-28.service [new file with mode: 0644]

index 934e1bc70c3965fe3270279f1a919ccc5bbdfad7..477eb15cbec5df425cde4b08b6802b13bb699755 100755 (executable)
@@ -15,42 +15,8 @@ test_setup() {
 
         setup_basic_environment
         mask_supporting_services
-
-        # Set up the services.
-        cat >$initdir/etc/systemd/system/specifier-j-wants.service << EOF
-[Unit]
-Description=Wants with percent-j specifier
-Wants=specifier-j-depends-%j.service
-After=specifier-j-depends-%j.service
-
-[Service]
-Type=oneshot
-ExecStart=test -f /tmp/test-specifier-j-%j
-ExecStart=/bin/sh -c 'echo OK > /testok'
-EOF
-        cat >$initdir/etc/systemd/system/specifier-j-depends-wants.service << EOF
-[Unit]
-Description=Dependent service for percent-j specifier
-
-[Service]
-Type=oneshot
-ExecStart=touch /tmp/test-specifier-j-wants
-EOF
-        cat >$initdir/etc/systemd/system/testsuite.service << EOF
-[Unit]
-Description=Testsuite: Ensure %j Wants directives work
-Wants=specifier-j-wants.service
-After=specifier-j-wants.service
-
-[Service]
-Type=oneshot
-ExecStart=/bin/true
-EOF
-
-        setup_testsuite
     )
-
     setup_nspawn_root
 }
 
-do_test "$@"
+do_test "$@" 28
index 6fea0fc93d2e1b13d1fdb96f6d932dca5ff83287..6b85854d205f68308357e95f482befec69e97258 100644 (file)
@@ -22,6 +22,8 @@ install_subdir('testsuite-11.units',
                install_dir : testdata_dir)
 install_subdir('testsuite-16.units',
                install_dir : testdata_dir)
+install_subdir('testsuite-28.units',
+               install_dir : testdata_dir)
 
 testsuite08_dir = testdata_dir + '/testsuite-08.units'
 install_data('testsuite-08.units/-.mount',
diff --git a/test/testsuite-28.units/specifier-j-depends-wants.service b/test/testsuite-28.units/specifier-j-depends-wants.service
new file mode 100644 (file)
index 0000000..1db4d85
--- /dev/null
@@ -0,0 +1,6 @@
+[Unit]
+Description=Dependent service for percent-j specifier
+
+[Service]
+Type=oneshot
+ExecStart=touch /tmp/test-specifier-j-wants
diff --git a/test/testsuite-28.units/specifier-j-wants.service b/test/testsuite-28.units/specifier-j-wants.service
new file mode 100644 (file)
index 0000000..10c3590
--- /dev/null
@@ -0,0 +1,9 @@
+[Unit]
+Description=Wants with percent-j specifier
+Wants=specifier-j-depends-%j.service
+After=specifier-j-depends-%j.service
+
+[Service]
+Type=oneshot
+ExecStart=test -f /tmp/test-specifier-j-%j
+ExecStart=sh -c 'echo OK > /testok'
diff --git a/test/units/testsuite-28.service b/test/units/testsuite-28.service
new file mode 100644 (file)
index 0000000..c4be0c6
--- /dev/null
@@ -0,0 +1,9 @@
+[Unit]
+Description=TEST-28-PERCENTJ-WANTEDBY
+# Testsuite: Ensure %j Wants directives work
+Wants=specifier-j-wants.service
+After=specifier-j-wants.service
+
+[Service]
+ExecStart=true
+Type=oneshot