]> arthur.barton.de Git - bup.git/commitdiff
Detect root-status failures
authorRob Browning <rlb@defaultvalue.org>
Sat, 10 Sep 2016 17:28:40 +0000 (12:28 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 10 Sep 2016 17:55:13 +0000 (12:55 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
t/test-fuse.sh
t/test-index-check-device.sh
t/test-restore-map-owner.sh
t/test-xdev.sh

index 36ebfe54a6712ad3bb31a8c290243d363ca6abe5..4603e80f79e3b3a57a3073c440fd38d41302ed94 100755 (executable)
@@ -6,6 +6,8 @@ set -o pipefail
 
 unset BLOCKSIZE BLOCK_SIZE DF_BLOCK_SIZE
 
+root_status="$(t/root-status)" || exit $?
+
 if ! bup-python -c 'import fuse' 2> /dev/null; then
     WVSTART 'unable to import fuse; skipping test'
     exit 0
@@ -21,7 +23,7 @@ if ! fusermount -V; then
     exit 0
 fi
 
-if ! groups | grep -q fuse && test "$(t/root-status)" != root; then
+if ! groups | grep -q fuse && test "$root_status" != root; then
     echo 'skipping FUSE tests: you are not root and not in the fuse group'
     exit 0
 fi
index 9c50534a8d92157ad34f1f94e5a2f45340515ff3..41382344a967bf284cf8504cb70781f969d3b2eb 100755 (executable)
@@ -4,7 +4,9 @@
 
 set -o pipefail
 
-if [ $(t/root-status) != root ]; then
+root_status="$(t/root-status)" || exit $?
+
+if [ "$root_status" != root ]; then
     echo 'Not root: skipping --check-device tests.'
     exit 0 # FIXME: add WVSKIP.
 fi
index f307826eeb48cd979ee7f8874c14fa37ef3fbb53..bf9362e46dc39614e900ddf6df68875649d25d73 100755 (executable)
@@ -2,7 +2,9 @@
 . ./wvtest-bup.sh || exit $?
 . t/lib.sh || exit $?
 
-if [ $(t/root-status) != root ]; then
+root_status="$(t/root-status)" || exit $?
+
+if [ "$root_status" != root ]; then
     echo 'Not root: skipping restore --map-* tests.'
     exit 0 # FIXME: add WVSKIP.
 fi
index 424692aa461b8571ca8cab2248e229b4d2580e0c..66dc81e611579d37ad2fccd12ec169c03e46b119 100755 (executable)
@@ -3,7 +3,9 @@
 
 set -o pipefail
 
-if [ $(t/root-status) != root ]; then
+root_status="$(t/root-status)" || exit $?
+
+if [ "$root_status" != root ]; then
     WVSTART 'not root: skipping tests'
     exit 0 # FIXME: add WVSKIP.
 fi