[systemd-devel] [PATCH] tests: add set -e

Daniel Buch boogiewasthere at gmail.com
Fri Feb 28 14:20:29 PST 2014


---
 TODO                            | 1 -
 test/TEST-01-BASIC/test.sh      | 2 ++
 test/TEST-02-CRYPTSETUP/test.sh | 2 ++
 test/TEST-03-JOBS/test-jobs.sh  | 1 +
 test/TEST-03-JOBS/test.sh       | 2 ++
 test/rules-test.sh              | 2 ++
 6 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/TODO b/TODO
index 6cac3e2..a790683 100644
--- a/TODO
+++ b/TODO
@@ -215,7 +215,6 @@ Features:
 * cgtop: make cgtop useful in a container
 
 * test/:
-  - add 'set -e' to scripts in test/
   - make stuff in test/ work with separate output dir
 
 * systemctl delete x.snapshot leaves no trace in logs (at least at default level).
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index 84ccf26..19b6ee7 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -1,6 +1,8 @@
 #!/bin/bash
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
+set -e
+
 TEST_DESCRIPTION="Basic systemd setup"
 
 . $TEST_BASE_DIR/test-functions
diff --git a/test/TEST-02-CRYPTSETUP/test.sh b/test/TEST-02-CRYPTSETUP/test.sh
index b243254..aaa48fe 100755
--- a/test/TEST-02-CRYPTSETUP/test.sh
+++ b/test/TEST-02-CRYPTSETUP/test.sh
@@ -1,6 +1,8 @@
 #!/bin/bash
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
+set -e
+
 TEST_DESCRIPTION="cryptsetup systemd setup"
 
 . $TEST_BASE_DIR/test-functions
diff --git a/test/TEST-03-JOBS/test-jobs.sh b/test/TEST-03-JOBS/test-jobs.sh
index 12b38af..dabee54 100755
--- a/test/TEST-03-JOBS/test-jobs.sh
+++ b/test/TEST-03-JOBS/test-jobs.sh
@@ -1,4 +1,5 @@
 #!/bin/bash -x
+set -e
 
 # Test merging of a --ignore-dependencies job into a previously
 # installed job.
diff --git a/test/TEST-03-JOBS/test.sh b/test/TEST-03-JOBS/test.sh
index 41e02e2..0bcef5f 100755
--- a/test/TEST-03-JOBS/test.sh
+++ b/test/TEST-03-JOBS/test.sh
@@ -1,6 +1,8 @@
 #!/bin/bash
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
+set -e
+
 TEST_DESCRIPTION="Job-related tests"
 
 . $TEST_BASE_DIR/test-functions
diff --git a/test/rules-test.sh b/test/rules-test.sh
index 47d42cb..25cfc98 100755
--- a/test/rules-test.sh
+++ b/test/rules-test.sh
@@ -17,6 +17,8 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
+set -e
+
 [ -n "$srcdir" ] || srcdir=`dirname $0`/..
 
 # skip if we don't have python
-- 
1.9.0



More information about the systemd-devel mailing list