#!/usr/bin/env bats load helpers function setup() { setup_busybox } function teardown() { teardown_bundle } @test "runc run [stdin not a tty]" { # stty size fails without a tty update_config '(.. | select(.[]? == "sh")) += ["-c", "stty size"]' # note that stdout/stderr are already redirected by bats' run runc run test_busybox /tmp/tty-info" ], "cwd": "/" } EOF ) # run the exec runc exec -t --pid-file pid.txt -d --console-socket "$CONSOLE_SOCKET" -p <(echo "$tty_info_with_consize_size") test_busybox [ "$status" -eq 0 ] # check the pid was generated [ -e pid.txt ] # wait for the process to finish timeout 5 tail --pid="$(head -n 1 pid.txt)" -f /dev/null tty_info=$( cat <