]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: Clarify error message and fix return codes
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 9 Jul 2014 17:17:54 +0000 (13:17 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 9 Jul 2014 17:17:54 +0000 (13:17 -0400)
Reported-by: Michael J. Evans
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/tests/lxc-test-ubuntu
src/tests/lxc-test-unpriv

index 01eb056295f9e789df6d6ac0def2ef62cdec2bd6..6b4f17cde62f49277bbdf8d6956909394ae4c372 100755 (executable)
@@ -34,15 +34,15 @@ FAIL() {
 # Only run on a normally configured ubuntu lxc system
 if [ ! -d /sys/class/net/lxcbr0 ]; then
        echo "lxcbr0 is not configured."
-       exit 0
+       exit 1
 fi
 if [ "$(id -u)" != "0" ]; then
-       echo "Must run as root."
-       exit 0
+       echo "ERROR: Must run as root."
+       exit 1
 fi
 if ! which host 2>&1 > /dev/null; then
        echo "'host' program not found.  Please install bind9-host"
-       exit 0
+       exit 1
 fi
 
 for template in ubuntu ubuntu-cloud; do
index 5e06e23696813108ed6f5a64eed42daba0ce20da..5ab75243f080dbbff8c2c240b9f59cf985d45cf4 100755 (executable)
@@ -24,7 +24,7 @@
 # This test assumes an Ubuntu host
 
 if [ $(id -u) -ne 0 ]; then
-       echo 'run as root'
+       echo "ERROR: Must run as root."
        exit 1
 fi
 which newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; }