On Mon, 2015-10-05 at 18:14 -0600, Mike Latimer wrote:
All image types (allocated raw, sparse raw and qcow2) should be
tested. Add
qcow2 to the test matrix, and reorder for clarify.
Signed-off-by: Mike Latimer <mlatimer(a)suse.com>
---
scripts/domain/121-block-info.t | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/scripts/domain/121-block-info.t b/scripts/domain/121-block-info.t
index b9f8e0c..e7e3491 100644
--- a/scripts/domain/121-block-info.t
+++ b/scripts/domain/121-block-info.t
@@ -30,7 +30,7 @@ dom->block_peek
use strict;
use warnings;
-use Test::More tests => 29;
+use Test::More tests => 32;
use Sys::Virt::TCK;
use Test::Exception;
@@ -97,14 +97,20 @@ my $dom;
ok_domain(sub { $dom = $conn->create_domain($xml) }, "Create domain");
$xml = $dom->get_xml_description();
+diag "Check fully allocated raw volume";
+is($dom->get_block_info($dst1,0)->{capacity}, 1024*1024*50, "Get disk
capacity info");
+ok($dom->get_block_info($dst1,0)->{allocation} >= 1024*1024*50, "Get disk
allocation info");
+ok($dom->get_block_info($dst1,0)->{physical} >= 1024*1024*50, "Get disk
physical info");
+
+diag "Check sparse raw volume";
is($dom->get_block_info($dst2,0)->{capacity}, 1024*1024*50, "Get disk
capacity info");
is($dom->get_block_info($dst2,0)->{allocation}, 1024*1024, "Get disk
allocation info");
is($dom->get_block_info($dst2,0)->{physical}, 1024*1024, "Get disk physical
info");
-
-is($dom->get_block_info($dst1,0)->{capacity}, 1024*1024*50, "Get disk
capacity info");
-ok($dom->get_block_info($dst1,0)->{allocation} >= 1024*1024*50, "Get disk
allocation info");
-ok($dom->get_block_info($dst1,0)->{physical} >= 1024*1024*50, "Get disk
physical info");
+diag "Check qcow2 volume";
+is($dom->get_block_info($dst3,0)->{capacity}, 1024*1024*50, "Get disk
capacity info");
+ok($dom->get_block_info($dst3,0)->{allocation} < 1024*1024, "Get disk
allocation info");
+ok($dom->get_block_info($dst3,0)->{physical} < 1024*1024, "Get disk
physical info");
diag "Test block_resize";
lives_ok(sub {$dom->block_resize($dst1, 512*50)}, "resize to 512*50 KB");
ACK
--
Cedric