From: Stéphane Graber Date: Wed, 9 Jul 2014 17:17:54 +0000 (-0400) Subject: tests: Clarify error message and fix return codes X-Git-Tag: lxc-1.1.0.alpha2~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c26adb82536952e27b05d237049b938d697e8ed9;p=thirdparty%2Flxc.git tests: Clarify error message and fix return codes Reported-by: Michael J. Evans Signed-off-by: Stéphane Graber --- diff --git a/src/tests/lxc-test-ubuntu b/src/tests/lxc-test-ubuntu index 01eb05629..6b4f17cde 100755 --- a/src/tests/lxc-test-ubuntu +++ b/src/tests/lxc-test-ubuntu @@ -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 diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv index 5e06e2369..5ab75243f 100755 --- a/src/tests/lxc-test-unpriv +++ b/src/tests/lxc-test-unpriv @@ -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; }