From 83264efc195c3d0845cbafeae7ef98b0b69ad77d Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Thu, 2 Jan 2020 00:05:40 +0100 Subject: [PATCH] Fix github actions tty error --- 13_integrated_testing/Makefile | 15 ++++++------ 13_integrated_testing/README.md | 43 +++++++++++++++++++++++++++++---- 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/13_integrated_testing/Makefile b/13_integrated_testing/Makefile index b8eb3ae1..09a9c6dd 100644 --- a/13_integrated_testing/Makefile +++ b/13_integrated_testing/Makefile @@ -64,7 +64,8 @@ OBJCOPY_CMD = cargo objcopy \ CONTAINER_UTILS = rustembedded/osdev-utils -DOCKER_CMD = docker run -it --rm +DOCKER_CMD_TEST = docker run -i --rm +DOCKER_CMD_USER = $(DOCKER_CMD_TEST) -t DOCKER_ARG_CURDIR = -v $(shell pwd):/work -w /work DOCKER_ARG_TTY = --privileged -v /dev:/dev DOCKER_ARG_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/jtag @@ -98,7 +99,7 @@ test: @echo $(QEMU_MISSING_STRING) else qemu: all - $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ + $(DOCKER_CMD_USER) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ $(DOCKER_EXEC_QEMU) $(QEMU_RELEASE_ARGS) \ -kernel $(OUTPUT) @@ -107,7 +108,7 @@ define KERNEL_TEST_RUNNER $(OBJCOPY_CMD) $$1 $$1.img TEST_BINARY=$$(echo $$1.img | sed -e 's/.*target/target/g') - $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ + $(DOCKER_CMD_TEST) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ ruby tests/runner.rb $(DOCKER_EXEC_QEMU) $(QEMU_TEST_ARGS) -kernel $$TEST_BINARY endef @@ -120,23 +121,23 @@ test: $(SOURCES) endif chainboot: all - $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(DOCKER_ARG_TTY) \ + $(DOCKER_CMD_USER) $(DOCKER_ARG_CURDIR) $(DOCKER_ARG_TTY) \ $(CONTAINER_UTILS) $(DOCKER_EXEC_RASPBOOT) $(DOCKER_EXEC_RASPBOOT_DEV) \ $(OUTPUT) jtagboot: - $(DOCKER_CMD) $(DOCKER_ARG_TTY) $(DOCKER_ARG_JTAG) $(CONTAINER_UTILS) \ + $(DOCKER_CMD_USER) $(DOCKER_ARG_TTY) $(DOCKER_ARG_JTAG) $(CONTAINER_UTILS) \ $(DOCKER_EXEC_RASPBOOT) $(DOCKER_EXEC_RASPBOOT_DEV) \ /jtag/$(JTAG_BOOT_IMAGE) openocd: - $(DOCKER_CMD) $(DOCKER_ARG_TTY) $(DOCKER_ARG_NET) $(CONTAINER_UTILS) \ + $(DOCKER_CMD_USER) $(DOCKER_ARG_TTY) $(DOCKER_ARG_NET) $(CONTAINER_UTILS) \ openocd $(OPENOCD_ARG) define gen_gdb RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" $(XRUSTC_CMD) $1 cp $(CARGO_OUTPUT) kernel_for_jtag - $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(DOCKER_ARG_NET) $(CONTAINER_UTILS) \ + $(DOCKER_CMD_USER) $(DOCKER_ARG_CURDIR) $(DOCKER_ARG_NET) $(CONTAINER_UTILS) \ gdb-multiarch -q kernel_for_jtag endef diff --git a/13_integrated_testing/README.md b/13_integrated_testing/README.md index 7d25c4d6..1ddacefd 100644 --- a/13_integrated_testing/README.md +++ b/13_integrated_testing/README.md @@ -346,7 +346,7 @@ define KERNEL_TEST_RUNNER $(OBJCOPY_CMD) $$1 $$1.img TEST_BINARY=$$(echo $$1.img | sed -e 's/.*target/target/g') - $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ + $(DOCKER_CMD_TEST) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ ruby tests/runner.rb $(DOCKER_EXEC_QEMU) $(QEMU_TEST_ARGS) -kernel $$TEST_BINARY endef @@ -869,7 +869,15 @@ diff -uNr 12_cpu_exceptions_part1/Makefile 13_integrated_testing/Makefile CARGO_OUTPUT = target/$(TARGET)/release/kernel OBJCOPY_CMD = cargo objcopy \ -@@ -55,12 +70,12 @@ +@@ -49,18 +64,19 @@ + + CONTAINER_UTILS = rustembedded/osdev-utils + +-DOCKER_CMD = docker run -it --rm ++DOCKER_CMD_TEST = docker run -i --rm ++DOCKER_CMD_USER = $(DOCKER_CMD_TEST) -t + DOCKER_ARG_CURDIR = -v $(shell pwd):/work -w /work + DOCKER_ARG_TTY = --privileged -v /dev:/dev DOCKER_ARG_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/jtag DOCKER_ARG_NET = --network host @@ -884,7 +892,7 @@ diff -uNr 12_cpu_exceptions_part1/Makefile 13_integrated_testing/Makefile all: clean $(OUTPUT) -@@ -73,15 +88,35 @@ +@@ -73,35 +89,55 @@ doc: cargo xdoc --target=$(TARGET) --features bsp_$(BSP) --document-private-items @@ -900,8 +908,9 @@ diff -uNr 12_cpu_exceptions_part1/Makefile 13_integrated_testing/Makefile + @echo $(QEMU_MISSING_STRING) else qemu: all - $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ +- $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ - $(DOCKER_EXEC_QEMU) $(OUTPUT) ++ $(DOCKER_CMD_USER) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ + $(DOCKER_EXEC_QEMU) $(QEMU_RELEASE_ARGS) \ + -kernel $(OUTPUT) + @@ -910,7 +919,7 @@ diff -uNr 12_cpu_exceptions_part1/Makefile 13_integrated_testing/Makefile + + $(OBJCOPY_CMD) $$1 $$1.img + TEST_BINARY=$$(echo $$1.img | sed -e 's/.*target/target/g') -+ $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ ++ $(DOCKER_CMD_TEST) $(DOCKER_ARG_CURDIR) $(CONTAINER_UTILS) \ + ruby tests/runner.rb $(DOCKER_EXEC_QEMU) $(QEMU_TEST_ARGS) -kernel $$TEST_BINARY +endef + @@ -923,6 +932,30 @@ diff -uNr 12_cpu_exceptions_part1/Makefile 13_integrated_testing/Makefile endif chainboot: all +- $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(DOCKER_ARG_TTY) \ ++ $(DOCKER_CMD_USER) $(DOCKER_ARG_CURDIR) $(DOCKER_ARG_TTY) \ + $(CONTAINER_UTILS) $(DOCKER_EXEC_RASPBOOT) $(DOCKER_EXEC_RASPBOOT_DEV) \ + $(OUTPUT) + + jtagboot: +- $(DOCKER_CMD) $(DOCKER_ARG_TTY) $(DOCKER_ARG_JTAG) $(CONTAINER_UTILS) \ ++ $(DOCKER_CMD_USER) $(DOCKER_ARG_TTY) $(DOCKER_ARG_JTAG) $(CONTAINER_UTILS) \ + $(DOCKER_EXEC_RASPBOOT) $(DOCKER_EXEC_RASPBOOT_DEV) \ + /jtag/$(JTAG_BOOT_IMAGE) + + openocd: +- $(DOCKER_CMD) $(DOCKER_ARG_TTY) $(DOCKER_ARG_NET) $(CONTAINER_UTILS) \ ++ $(DOCKER_CMD_USER) $(DOCKER_ARG_TTY) $(DOCKER_ARG_NET) $(CONTAINER_UTILS) \ + openocd $(OPENOCD_ARG) + + define gen_gdb + RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" $(XRUSTC_CMD) $1 + cp $(CARGO_OUTPUT) kernel_for_jtag +- $(DOCKER_CMD) $(DOCKER_ARG_CURDIR) $(DOCKER_ARG_NET) $(CONTAINER_UTILS) \ ++ $(DOCKER_CMD_USER) $(DOCKER_ARG_CURDIR) $(DOCKER_ARG_NET) $(CONTAINER_UTILS) \ + gdb-multiarch -q kernel_for_jtag + endef + diff -uNr 12_cpu_exceptions_part1/patches/Cargo.toml 13_integrated_testing/patches/Cargo.toml --- 12_cpu_exceptions_part1/patches/Cargo.toml