|
173 | 173 | # test tty width and height against original process.json |
174 | 174 | [[ ${lines[0]} =~ "rows 10; columns 110" ]] |
175 | 175 | } |
| 176 | + |
| 177 | +@test "runc create [terminal=false]" { |
| 178 | + # Disable terminal creation. |
| 179 | + sed -i 's|"terminal": true,|"terminal": false,|g' config.json |
| 180 | + # Replace sh script with sleep. |
| 181 | + sed -i 's|"sh"|"sleep", "1000s"|' config.json |
| 182 | + |
| 183 | + # Make sure that the handling of detached IO is done properly. See #1354. |
| 184 | + __runc create test_busybox |
| 185 | + |
| 186 | + # Start the command. |
| 187 | + runc start test_busybox |
| 188 | + [ "$status" -eq 0 ] |
| 189 | + |
| 190 | + testcontainer test_busybox running |
| 191 | + |
| 192 | + # Kill the container. |
| 193 | + runc kill test_busybox KILL |
| 194 | + [ "$status" -eq 0 ] |
| 195 | +} |
| 196 | + |
| 197 | +@test "runc run [terminal=false]" { |
| 198 | + # Disable terminal creation. |
| 199 | + sed -i 's|"terminal": true,|"terminal": false,|g' config.json |
| 200 | + # Replace sh script with sleep. |
| 201 | + sed -i 's|"sh"|"sleep", "1000s"|' config.json |
| 202 | + |
| 203 | + # Make sure that the handling of non-detached IO is done properly. See #1354. |
| 204 | + ( |
| 205 | + __runc run test_busybox |
| 206 | + ) & |
| 207 | + |
| 208 | + wait_for_container 15 1 test_busybox |
| 209 | + testcontainer test_busybox running |
| 210 | + |
| 211 | + # Kill the container. |
| 212 | + runc kill test_busybox KILL |
| 213 | + [ "$status" -eq 0 ] |
| 214 | +} |
| 215 | + |
| 216 | +@test "runc run -d [terminal=false]" { |
| 217 | + # Disable terminal creation. |
| 218 | + sed -i 's|"terminal": true,|"terminal": false,|g' config.json |
| 219 | + # Replace sh script with sleep. |
| 220 | + sed -i 's|"sh"|"sleep", "1000s"|' config.json |
| 221 | + |
| 222 | + # Make sure that the handling of detached IO is done properly. See #1354. |
| 223 | + __runc run -d test_busybox |
| 224 | + |
| 225 | + testcontainer test_busybox running |
| 226 | + |
| 227 | + # Kill the container. |
| 228 | + runc kill test_busybox KILL |
| 229 | + [ "$status" -eq 0 ] |
| 230 | +} |
0 commit comments