Skip to content

Commit

Permalink
only execute last test when we are a pty
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
  • Loading branch information
Christian Brauner committed Apr 13, 2016
1 parent c87524b commit 804bd6e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/tests/lxc-test-lxc-attach
Expand Up @@ -190,14 +190,16 @@ fi

rm -f $out $err

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

rm -f /tmp/ptylog
rm -f /tmp/ptylog
fi

lxc-destroy -n busy -f

Expand Down

0 comments on commit 804bd6e

Please sign in to comment.