test: drop || return 1 expression which is incompatible with set -e
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 8 Jul 2019 19:11:32 +0000 (21:11 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 8 Jul 2019 19:11:32 +0000 (21:11 +0200)
The `set -e` option is incompatible with a subshell/compound command,
which is followed by || <EXPR>. In such case, the -e option is ignored
in all affected subshells/functions (see man bash(1) for command `set`).

30 files changed:
test/TEST-01-BASIC/test.sh
test/TEST-02-CRYPTSETUP/test.sh
test/TEST-03-JOBS/test.sh
test/TEST-04-JOURNAL/test.sh
test/TEST-05-RLIMITS/test.sh
test/TEST-06-SELINUX/test.sh
test/TEST-07-ISSUE-1981/test.sh
test/TEST-08-ISSUE-2730/test.sh
test/TEST-09-ISSUE-2691/test.sh
test/TEST-10-ISSUE-2467/test.sh
test/TEST-11-ISSUE-3166/test.sh
test/TEST-12-ISSUE-3171/test.sh
test/TEST-13-NSPAWN-SMOKE/test.sh
test/TEST-14-MACHINE-ID/test.sh
test/TEST-16-EXTEND-TIMEOUT/test.sh
test/TEST-17-UDEV-WANTS/test.sh
test/TEST-18-FAILUREACTION/test.sh
test/TEST-19-DELEGATE/test.sh
test/TEST-20-MAINPIDGAMES/test.sh
test/TEST-23-TYPE-EXEC/test.sh
test/TEST-24-UNIT-TESTS/test.sh
test/TEST-25-IMPORT/test.sh
test/TEST-26-SETENV/test.sh
test/TEST-27-STDOUTFILE/test.sh
test/TEST-28-PERCENTJ-WANTEDBY/test.sh
test/TEST-29-UDEV-ID_RENAMING/test.sh
test/TEST-30-ONCLOCKCHANGE/test.sh
test/TEST-31-DEVICE-ENUMERATION/test.sh
test/TEST-32-OOMPOLICY/test.sh
test/TEST-34-DYNAMICUSERMIGRATE/test.sh

index 0f29ad7..a34e2ad 100755 (executable)
@@ -29,7 +29,7 @@ Type=oneshot
 EOF
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index aed1c59..9d25e94 100755 (executable)
@@ -75,7 +75,7 @@ EOF
         cat >>$initdir/etc/fstab <<EOF
 /dev/mapper/varcrypt    /var    ext4    defaults 0 1
 EOF
-    ) || return 1
+    )
 
     ddebug "umount $TESTDIR/root/var"
     umount $TESTDIR/root/var
index 8912510..2a7df79 100755 (executable)
@@ -44,7 +44,7 @@ EOF
         cp test-jobs.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index f24a8f6..a5ba7c8 100755 (executable)
@@ -46,7 +46,7 @@ EOF
         cp test-journal.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index 3c29b2e..176014d 100755 (executable)
@@ -42,7 +42,7 @@ EOF
         cp test-rlimits.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index 2b49b3d..5d26cb0 100755 (executable)
@@ -92,7 +92,7 @@ EOF
         dracut_install -o sesearch
         dracut_install runcon
         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
index 93ddb6f..e488cb4 100755 (executable)
@@ -40,7 +40,7 @@ EOF
         cp test-segfault.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index ef2aba0..d455d5d 100755 (executable)
@@ -60,7 +60,7 @@ ExecStart=/bin/systemctl reload /
 EOF
 
         setup_testsuite
-    ) || return 1
+    )
 
     ln -s /etc/systemd/system/-.mount $initdir/etc/systemd/system/root.mount
     mkdir -p $initdir/etc/systemd/system/local-fs.target.wants
index 8e7402f..bef31cd 100755 (executable)
@@ -32,7 +32,7 @@ TimeoutStopSec=270s
 EOF
 
         setup_testsuite
-    ) || 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
index dc7a9ac..081d22b 100755 (executable)
@@ -45,7 +45,7 @@ ExecStart=/bin/true
 EOF
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     # mask some services that we do not want to run in these tests
index 3419b78..267224c 100755 (executable)
@@ -64,7 +64,7 @@ EOF
 
         chmod 0755 $initdir/test-fail-on-restart.sh
         setup_testsuite
-    ) || return 1
+    )
 
     ddebug "umount $TESTDIR/root"
     umount $TESTDIR/root
index 31cf1b4..08b59ae 100755 (executable)
@@ -90,7 +90,7 @@ EOF
 
         chmod 0755 $initdir/test-socket-group.sh
         setup_testsuite
-    ) || return 1
+    )
 
     setup_nspawn_root
 
index 8252c4b..6a40beb 100755 (executable)
@@ -184,7 +184,7 @@ EOF
 
         chmod 0755 $initdir/test-nspawn.sh
         setup_testsuite
-    ) || return 1
+    )
 
     ddebug "umount $TESTDIR/root"
     umount $TESTDIR/root
index 33e311a..c22fc7c 100755 (executable)
@@ -73,7 +73,7 @@ EOF
 chmod +x $initdir/test-machine-id-setup.sh
 
         setup_testsuite
-    ) || 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
index 6613e32..7e6dc45 100755 (executable)
@@ -30,7 +30,7 @@ test_setup() {
         cp $BUILD_DIR/src/shared/libsystemd-shared-*.so ${initdir}/usr/lib
 
         setup_testsuite
-    ) || 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
index 9bd6e98..02578d3 100755 (executable)
@@ -38,7 +38,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
 
     ddebug "umount $TESTDIR/root"
     umount $TESTDIR/root
index 277cc2c..0cf6391 100755 (executable)
@@ -30,7 +30,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     # mask some services that we do not want to run in these tests
index 3ed6a1b..25461af 100755 (executable)
@@ -40,7 +40,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
 
     ddebug "umount $TESTDIR/root"
     umount $TESTDIR/root
index bf80e8b..8adaf49 100755 (executable)
@@ -38,7 +38,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index 6ed22be..6842363 100755 (executable)
@@ -38,7 +38,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index 038303e..5d60b54 100755 (executable)
@@ -91,7 +91,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     # mask some services that we do not want to run in these tests
index 7fe367c..4beaa64 100755 (executable)
@@ -31,7 +31,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index 9a2913d..b1a965a 100755 (executable)
@@ -30,7 +30,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index fb35f80..e78e317 100755 (executable)
@@ -40,7 +40,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"
index 67be1d5..42db3b6 100755 (executable)
@@ -49,7 +49,7 @@ ExecStart=/bin/true
 EOF
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
         # mask some services that we do not want to run in these tests
index 26ad2f9..3e29749 100755 (executable)
@@ -38,7 +38,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
 
     ddebug "umount $TESTDIR/root"
     umount $TESTDIR/root
index 40e6ff2..47f1fff 100755 (executable)
@@ -49,7 +49,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
 
     ddebug "umount $TESTDIR/root"
     umount $TESTDIR/root
index 7156528..1eda377 100755 (executable)
@@ -38,7 +38,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
 
     ddebug "umount $TESTDIR/root"
     umount $TESTDIR/root
index 7e9431d..aef3db5 100755 (executable)
@@ -41,7 +41,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
 
     ddebug "umount $TESTDIR/root"
     umount $TESTDIR/root
index 8ef28b0..5964311 100755 (executable)
@@ -38,7 +38,7 @@ EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
-    ) || return 1
+    )
     setup_nspawn_root
 
     ddebug "umount $TESTDIR/root"