Unverified Commit cbec95c1 by Po-Hsu Lin Committed by Christian Brauner

lxc-test-unpriv: check user existence before removing it

Check the test user (lxcunpriv) before calling deluser command, otherwise it will print unnecessary error message: /usr/sbin/deluser: The user 'lxcunpriv' does not exist. Signed-off-by: 's avatarPo-Hsu Lin <po-hsu.lin@canonical.com>
parent 74941f9a
......@@ -104,7 +104,7 @@ fi
trap cleanup EXIT SIGHUP SIGINT SIGTERM
set -eu
deluser $TUSER && rm -Rf $HDIR || true
id $TUSER &> /dev/null && deluser -q --remove-home $TUSER
useradd $TUSER
mkdir -p $HDIR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment