summary refs log tree commit diff
path: root/lib/test-driver/test-driver.pl
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2010-01-06 14:37:23 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2010-01-06 14:37:23 +0000
commit1b21115f61c668c8ca3cd47cda3840f2be3b0032 (patch)
treefe2f1ff741bc95692dad7cbc0dc99d0753017fca /lib/test-driver/test-driver.pl
parent816f12da885b1ac8c961ac628c932297a9f5cd2f (diff)
downloadnixpkgs-1b21115f61c668c8ca3cd47cda3840f2be3b0032.tar
nixpkgs-1b21115f61c668c8ca3cd47cda3840f2be3b0032.tar.gz
nixpkgs-1b21115f61c668c8ca3cd47cda3840f2be3b0032.tar.bz2
nixpkgs-1b21115f61c668c8ca3cd47cda3840f2be3b0032.tar.lz
nixpkgs-1b21115f61c668c8ca3cd47cda3840f2be3b0032.tar.xz
nixpkgs-1b21115f61c668c8ca3cd47cda3840f2be3b0032.tar.zst
nixpkgs-1b21115f61c668c8ca3cd47cda3840f2be3b0032.zip
* Support creating a virtual disk in the test driver.
svn path=/nixos/trunk/; revision=19263
Diffstat (limited to 'lib/test-driver/test-driver.pl')
-rw-r--r--lib/test-driver/test-driver.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/test-driver/test-driver.pl b/lib/test-driver/test-driver.pl
index 6bac1f1dd39..2ccc6bd4b9a 100644
--- a/lib/test-driver/test-driver.pl
+++ b/lib/test-driver/test-driver.pl
@@ -52,6 +52,15 @@ sub runTests {
 }
 
 
+# Create an empty qcow2 virtual disk with the given name and size (in
+# MiB).
+sub createDisk {
+    my ($name, $size) = @_;
+    system("qemu-img create -f qcow2 $name ${size}M") == 0
+        or die "cannot create image of size $size";
+}
+
+
 END {
     foreach my $vm (values %vms) {
         if ($vm->{pid}) {