From c26adb82536952e27b05d237049b938d697e8ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Wed, 9 Jul 2014 13:17:54 -0400 Subject: [PATCH] tests: Clarify error message and fix return codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: Michael J. Evans Signed-off-by: Stéphane Graber --- src/tests/lxc-test-ubuntu | 8 ++++---- src/tests/lxc-test-unpriv | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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; }