tests: Clarify error message and fix return codes

Reported-by: Michael J. Evans
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Stéphane Graber 2014-07-09 13:17:54 -04:00
parent 177f2cd2c2
commit c26adb8253
No known key found for this signature in database
GPG Key ID: C638974D64792D67
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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; }