]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
only execute last test when we are a pty 970/head
authorChristian Brauner <christian.brauner@mailbox.org>
Wed, 13 Apr 2016 13:41:58 +0000 (15:41 +0200)
committerChristian Brauner <christian.brauner@mailbox.org>
Wed, 13 Apr 2016 14:54:15 +0000 (16:54 +0200)
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
src/tests/lxc-test-lxc-attach

index 27062e3e9e0a23d9a1a2d0c59816a0dd6b2a8f52..380a6db305b8c739177f793105d3a0885740c24c 100755 (executable)
@@ -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