From 3a04bec92d3010a9be4628928aca9abb675a84c7 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 27 Feb 2024 12:33:20 +0100 Subject: [PATCH] test: drop --interactive in non-interactive docker sessions With a self-hosted runner we get the following classic error when calling `make test-unit`: make[1]: Entering directory '/home/runner/_work/infix/infix/buildroot' /home/runner/_work/infix/infix/test/env /home/runner/_work/infix/infix/test/9pm/9pm.py /home/runner/_work/infix/infix/test/case/all-repo.yaml /home/runner/_work/infix/infix/test/case/all-unit.yaml the input device is not a TTY make[2]: *** [/home/runner/_work/infix/infix/board/x86_64/board.mk:14: test-unit] Error 1 This patch drops interactive from all non-interactive docker sessions. Signed-off-by: Joachim Wiberg --- board/x86_64/board.mk | 2 +- test/env | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/board/x86_64/board.mk b/board/x86_64/board.mk index 79ddc00a..a9739d14 100644 --- a/board/x86_64/board.mk +++ b/board/x86_64/board.mk @@ -18,7 +18,7 @@ test test-qeneth: $(BR2_EXTERNAL_INFIX_PATH)/test/9pm/9pm.py \ $(INFIX_TESTS)) test-sh test-qeneth-sh: - $(call test-env-qeneth,/bin/sh) + $(call test-env-qeneth,-i /bin/sh) test-run: | ~/.infix-test-venv $(call test-env-run,\ diff --git a/test/env b/test/env index 85c582e8..85d62d6d 100755 --- a/test/env +++ b/test/env @@ -104,7 +104,7 @@ name() containerize=yes [ -c /dev/kvm ] && kvm="--device=/dev/kvm" -while getopts "Cf:hKp:q:t:" opt; do +while getopts "Cf:hiKp:q:t:" opt; do case ${opt} in C) containerize= @@ -115,6 +115,9 @@ while getopts "Cf:hKp:q:t:" opt; do h) usage && exit 0 ;; + i) + interactive="--interactive" + ;; K) kvm= ;; @@ -146,7 +149,7 @@ if [ "$containerize" ]; then --expose 9001-9010 --publish-all \ --hostname "$(name)" \ --name "$(name)" \ - --interactive \ + $interactive \ --rm \ --security-opt seccomp=unconfined \ --sysctl net.ipv6.conf.all.disable_ipv6=0 \