only execute last test when we are a pty

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
This commit is contained in:
Christian Brauner 2016-04-13 15:41:58 +02:00
parent c87524b77b
commit 804bd6e32f

View File

@ -190,14 +190,16 @@ fi
rm -f $out $err rm -f $out $err
# Test whether logging pty output to a file works. if [ $allocate_pty = "pty" ]; then
trap "rm -f /tmp/ptylog" EXIT INT QUIT PIPE # Test whether logging pty output to a file works.
lxc-attach -n busy -L /tmp/ptylog -- hostname || FAIL "to allocate or setup pty" trap "rm -f /tmp/ptylog" EXIT INT QUIT PIPE
if [ $allocate_pty == "pty" ] && [ ! -s /tmp/ptylog ]; then lxc-attach -n busy -L /tmp/ptylog -- hostname || FAIL "to allocate or setup pty"
FAIL "lxc-attach -n busy -L /tmp/ptylog -- hostname" if [ ! -s /tmp/ptylog ]; then
fi FAIL "lxc-attach -n busy -L /tmp/ptylog -- hostname"
fi
rm -f /tmp/ptylog rm -f /tmp/ptylog
fi
lxc-destroy -n busy -f lxc-destroy -n busy -f