diff --git a/test/tenv/chrootsetup.sh b/test/tenv/chrootsetup.sh index f465e897..a54facdb 100755 --- a/test/tenv/chrootsetup.sh +++ b/test/tenv/chrootsetup.sh @@ -44,6 +44,6 @@ fi mkdir -p "$FINIT_RCSD" tty=/dev/$(cat /sys/class/tty/console/active) -mkfifo "$tty" +ln -fs /shared/pts "$tty" exec "$@" diff --git a/test/tenv/lib.sh b/test/tenv/lib.sh index 444cac5a..9a0d382a 100755 --- a/test/tenv/lib.sh +++ b/test/tenv/lib.sh @@ -138,7 +138,3 @@ echo "$finit_ppid" > "$TENV_ROOT"/running_test.pid log "$color_reset" 'Setup of test environment done' '' finit_pid=$(retry "pgrep -P $finit_ppid") - -tty=/dev/$(texec cat /sys/class/tty/console/active) -texec cat "$tty" & -sleep 1 diff --git a/test/tenv/root.mk b/test/tenv/root.mk index 7469dcf9..235c3224 100644 --- a/test/tenv/root.mk +++ b/test/tenv/root.mk @@ -38,6 +38,7 @@ binaries = $(DEST)/bin/cat \ $(DEST)/bin/env \ $(DEST)/bin/find \ $(DEST)/bin/kill \ + $(DEST)/bin/ln \ $(DEST)/bin/ls \ $(DEST)/bin/mkdir \ $(DEST)/bin/mkfifo \ @@ -57,6 +58,7 @@ dirs = $(DEST)/bin \ $(DEST)/etc \ $(DEST)/proc \ $(DEST)/sbin \ + $(DEST)/shared \ $(DEST)/sys \ $(DEST)/test_assets \ $(DEST)/tmp diff --git a/test/tenv/start.sh b/test/tenv/start.sh index 63558444..6c3d7bb0 100755 --- a/test/tenv/start.sh +++ b/test/tenv/start.sh @@ -45,4 +45,7 @@ exec "$unshare" \ --mount \ --mount-proc \ --uts --ipc --net \ - "$chroot" "$TENV_ROOT" /bin/chrootsetup.sh "$@" + sh -c " + ln -fs /proc/1/fd/1 $TENV_ROOT/shared/pts; + exec $chroot $TENV_ROOT /bin/chrootsetup.sh $* + "