diff --git a/lib/test-driver/Machine.pm b/lib/test-driver/Machine.pm index 5ff7bf6cea1..e0792ac928d 100644 --- a/lib/test-driver/Machine.pm +++ b/lib/test-driver/Machine.pm @@ -294,7 +294,7 @@ sub waitUntilFails { } -sub mustFail { +sub fail { my ($self, $command) = @_; my ($status, $out) = $self->execute($command); die "command `$command' unexpectedly succeeded" @@ -302,6 +302,11 @@ sub mustFail { } +sub mustFail { + fail @_; +} + + # Wait for an Upstart job to reach the "running" state. sub waitForJob { my ($self, $jobName) = @_; @@ -360,6 +365,16 @@ sub shutdown { } +sub crash { + my ($self) = @_; + return unless $self->{booted}; + + $self->sendMonitorCommand("quit"); + + $self->waitForShutdown; +} + + # Make the machine unreachable by shutting down eth1 (the multicast # interface used to talk to the other VMs). We keep eth0 up so that # the test driver can continue to talk to the machine.