test-driver/Machine: Add new allowReboot flag.
This is to actually allow for the target machine to reboot, which could come in handy for some VM tests in NixOps. Well, actually to be more specific: We need it for the Hetzner NixOps backend test. :-) Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
37136e4adf
commit
b32ef4dbef
1 changed files with 6 additions and 1 deletions
|
@ -48,9 +48,13 @@ sub new {
|
|||
make_path($sharedDir, { mode => 0700, owner => $< });
|
||||
}
|
||||
|
||||
my $allowReboot = 0;
|
||||
$allowReboot = $args->{allowReboot} if defined $args->{allowReboot};
|
||||
|
||||
my $self = {
|
||||
startCommand => $startCommand,
|
||||
name => $name,
|
||||
allowReboot => $allowReboot,
|
||||
booted => 0,
|
||||
pid => 0,
|
||||
connected => 0,
|
||||
|
@ -136,7 +140,8 @@ sub start {
|
|||
$ENV{SHARED_DIR} = $sharedDir;
|
||||
$ENV{USE_TMPDIR} = 1;
|
||||
$ENV{QEMU_OPTS} =
|
||||
"-no-reboot -monitor unix:./monitor -chardev socket,id=shell,path=./shell " .
|
||||
($self->{allowReboot} ? "" : "-no-reboot ") .
|
||||
"-monitor unix:./monitor -chardev socket,id=shell,path=./shell " .
|
||||
"-device virtio-serial -device virtconsole,chardev=shell " .
|
||||
($showGraphics ? "-serial stdio" : "-nographic") . " " . ($ENV{QEMU_OPTS} || "");
|
||||
chdir $self->{stateDir} or die;
|
||||
|
|
Loading…
Reference in a new issue