From 483c322a6235e358563ce3db9057bb840cf85fd7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 9 Jun 2010 13:46:52 +0000 Subject: [PATCH] * mustFail -> fail. * Added a function to crash a VM. svn path=/nixos/branches/boot-order/; revision=22200 --- lib/test-driver/Machine.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/test-driver/Machine.pm b/lib/test-driver/Machine.pm index 5ff7bf6cea19..e0792ac928d1 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.