mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-26 05:55:35 +00:00
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:
parent
177f2cd2c2
commit
c26adb8253
@ -34,15 +34,15 @@ FAIL() {
|
|||||||
# Only run on a normally configured ubuntu lxc system
|
# Only run on a normally configured ubuntu lxc system
|
||||||
if [ ! -d /sys/class/net/lxcbr0 ]; then
|
if [ ! -d /sys/class/net/lxcbr0 ]; then
|
||||||
echo "lxcbr0 is not configured."
|
echo "lxcbr0 is not configured."
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "$(id -u)" != "0" ]; then
|
if [ "$(id -u)" != "0" ]; then
|
||||||
echo "Must run as root."
|
echo "ERROR: Must run as root."
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! which host 2>&1 > /dev/null; then
|
if ! which host 2>&1 > /dev/null; then
|
||||||
echo "'host' program not found. Please install bind9-host"
|
echo "'host' program not found. Please install bind9-host"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for template in ubuntu ubuntu-cloud; do
|
for template in ubuntu ubuntu-cloud; do
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
# This test assumes an Ubuntu host
|
# This test assumes an Ubuntu host
|
||||||
|
|
||||||
if [ $(id -u) -ne 0 ]; then
|
if [ $(id -u) -ne 0 ]; then
|
||||||
echo 'run as root'
|
echo "ERROR: Must run as root."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
which newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; }
|
which newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; }
|
||||||
|
Loading…
Reference in New Issue
Block a user