Lines Matching refs:attach
8 # This is a test script for the lxc-attach program. It tests whether I/O
28 # lxc-attach allocates a pty on the host and attaches any standard file
30 # refer to a pty are not attached. In order to determine whether lxc-attach
33 # lxc-attach -n busy -- hostname < /dev/null
36 # /dev/null is (a) left alone and (b) that lxc-attach does not fail. When
37 # lxc-attach fails we know that it's behavior has been altered, e.g. by trying
38 # to attach a standard file descriptor that does not refer to a pty.
63 echo "Tests for lxc-attach pty allocation and I/O redirection"
71 attach=$(lxc-attach -n busy -- hostname || FAIL "to allocate or setup pty")
72 if [ "$attach" != "busy" ]; then
73 FAIL "lxc-attach -n busy -- hostname"
80 attach=$(lxc-attach -n busy -- hostname < /dev/null || FAIL "to allocate or setup pty")
81 if [ "$attach" != "busy" ]; then
82 FAIL "lxc-attach -n busy -- hostname < /dev/null"
88 attach=$(lxc-attach -n busy -- hostname > /dev/null || FAIL "to allocate or setup pty")
89 if [ -n "$attach" ]; then
90 FAIL "lxc-attach -n busy -- hostname > /dev/null"
96 attach=$(lxc-attach -n busy -- hostname 2> /dev/null || FAIL "to allocate or setup pty")
97 if [ "$attach" != "busy" ]; then
98 FAIL "lxc-attach -n busy -- hostname 2> /dev/null < /dev/null"
104 attach=$(lxc-attach -n busy -- hostname 2> /dev/null < /dev/null || FAIL "to allocate or setup pty")
105 if [ "$attach" != "busy" ]; then
106 FAIL "lxc-attach -n busy -- hostname 2> /dev/null < /dev/null"
113 # output in the attach variable.)
117 attach=$( ( lxc-attach -n busy -- sh -c 'hostname >&2' > /dev/null ) 2>&1 || FAIL "to allocate or setup pty")
118 if [ "$attach" != "busy" ]; then
119 FAIL "lxc-attach -n busy -- sh -c 'hostname >&2' > /dev/null"
125 # to stdout for the subshell and capture the output in the attach variable.)
127 # stdout --> attach to pty
129 attach=$( ( lxc-attach -n busy -- sh -c 'hostname >&2' 2> /dev/null ) 2>&1 || FAIL "to allocate or setup pty")
130 if [ -n "$attach" ]; then
131 FAIL "lxc-attach -n busy -- sh -c 'hostname >&2' 2> /dev/null"
139 attach=$(lxc-attach -n busy -- sh -c 'rm 2>&1' > /dev/null || true)
140 if [ -n "$attach" ]; then
141 FAIL "lxc-attach -n busy -- sh -c 'rm 2>&1' > /dev/null"
149 attach=$(lxc-attach -n busy -- sh -c 'rm 2>&1' 2> /dev/null || true)
150 if [ -z "$attach" ]; then
151 FAIL "lxc-attach -n busy -- sh -c 'rm 2>&1' 2> /dev/null"
157 attach=$(echo hostname | lxc-attach -n busy -- || FAIL "to allocate or setup pty")
158 if [ "$attach" != "busy" ]; then
159 FAIL "echo hostname | lxc-attach -n busy --"
168 lxc-attach -n busy -- sh -c 'echo OUT; echo ERR >&2' > $out 2> $err || FAIL "to allocate or setup pty"
172 FAIL "lxc-attach -n busy -- sh -c 'echo OUT; echo ERR >&2' > $out 2> $err"
184 echo "hostname; rm" | lxc-attach -n busy > $out 2> $err || true
188 FAIL "echo 'hostname; rm' | lxc-attach -n busy > $out 2> $err"
196 lxc-attach -n busy -L /tmp/ptylog -- hostname || FAIL "to allocate or setup pty"
198 FAIL "lxc-attach -n busy -L /tmp/ptylog -- hostname"