mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 12:15:34 +03:00
nixos-test-driver: include a timeout for the recv call, do not assume sh == bash
This commit is contained in:
parent
113045a443
commit
4147b878bc
2 changed files with 31 additions and 7 deletions
|
@ -36,8 +36,16 @@ in
|
|||
while ! exec 2> /dev/${qemu-common.qemuSerialDevice}; do sleep 0.1; done
|
||||
echo "connecting to host..." >&2
|
||||
stty -F /dev/hvc0 raw -echo # prevent nl -> cr/nl conversion
|
||||
echo
|
||||
PS1= exec /bin/sh
|
||||
# The following line is essential since it signals to
|
||||
# the test driver that the shell is ready.
|
||||
# See: the connect method in the Machine class.
|
||||
echo "Spawning backdoor root shell..."
|
||||
# Passing the terminal device makes bash run non-interactively.
|
||||
# Otherwise we get errors on the terminal because bash tries to
|
||||
# setup things like job control.
|
||||
# Note: calling bash explicitely here instead of sh makes sure that
|
||||
# we can also run non-NixOS guests during tests.
|
||||
PS1= exec /usr/bin/env bash --norc /dev/hvc0
|
||||
'';
|
||||
serviceConfig.KillSignal = "SIGHUP";
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue