]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: move part of TEST-02-CRYPTSETUP setup to static files
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 12 Dec 2019 08:59:53 +0000 (09:59 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 28 Mar 2020 10:46:47 +0000 (11:46 +0100)
Since we create an encrypted partition for this test, let's create a separate image here.

test/TEST-02-CRYPTSETUP/test.sh
test/units/testsuite-02.service [new file with mode: 0644]

index a859b345d08d10f8c5d453362d1c81192c9d5646..2afc6f8ed4c360431bcf070898928589c70afeba 100755 (executable)
@@ -42,25 +42,12 @@ test_setup() {
         setup_basic_environment
         mask_supporting_services
 
-        # setup the testsuite service
-        cat >$initdir/etc/systemd/system/testsuite.service <<EOF
-[Unit]
-Description=Testsuite service
-After=multi-user.target
-
-[Service]
-ExecStart=/bin/sh -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; echo OK > /testok'
-Type=oneshot
-EOF
-
-        setup_testsuite
-
         install_dmevent
         generate_module_dependencies
         cat >$initdir/etc/crypttab <<EOF
 $DM_NAME UUID=$ID_FS_UUID /etc/varkey
 EOF
-        echo -n test > $initdir/etc/varkey
+        echo -n test >$initdir/etc/varkey
         cat $initdir/etc/crypttab | ddebug
 
         cat >>$initdir/etc/fstab <<EOF
@@ -86,4 +73,4 @@ test_setup_cleanup() {
     _test_setup_cleanup
 }
 
-do_test "$@"
+do_test "$@" 02
diff --git a/test/units/testsuite-02.service b/test/units/testsuite-02.service
new file mode 100644 (file)
index 0000000..ddb4729
--- /dev/null
@@ -0,0 +1,7 @@
+[Unit]
+Description=TEST-02-CRYPTSETUP
+After=multi-user.target
+
+[Service]
+ExecStart=sh -x -c 'systemctl --state=failed --no-legend --no-pager >/failed ; echo OK > /testok'
+Type=oneshot