Author: eelco
Date: 2010-06-09 13:46:52 +0000 (Wed, 09 Jun 2010)
New Revision: 22200

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22200&view=rev

Modified:
   nixos/branches/boot-order/lib/test-driver/Machine.pm

Log:
* mustFail -> fail.
* Added a function to crash a VM.


Changes:

Modified: nixos/branches/boot-order/lib/test-driver/Machine.pm
===================================================================
--- nixos/branches/boot-order/lib/test-driver/Machine.pm        2010-06-09 
13:46:18 UTC (rev 22199)
+++ nixos/branches/boot-order/lib/test-driver/Machine.pm        2010-06-09 
13:46:52 UTC (rev 22200)
@@ -294,7 +294,7 @@
 }
 
 
-sub mustFail {
+sub fail {
     my ($self, $command) = @_;
     my ($status, $out) = $self->execute($command);
     die "command `$command' unexpectedly succeeded"
@@ -302,6 +302,11 @@
 }
 
 
+sub mustFail {
+    fail @_;
+}
+
+
 # Wait for an Upstart job to reach the "running" state.
 sub waitForJob {
     my ($self, $jobName) = @_;
@@ -360,6 +365,16 @@
 }
 
 
+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.

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to