Commit 466a7f42 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé

scripts: fix block info test conditions

The semantics of the "physical" field were fixed to not duplicate the
info of the "allocation" field.

The use of block_peek on non-raw volumes now raises an error since we
cannot peek inside volumes.
Reviewed-by: 's avatarJán Tomko <>
Signed-off-by: 's avatarDaniel P. Berrangé <>
parent 1818e68f
......@@ -99,7 +99,7 @@ $xml = $dom->get_xml_description();
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($dst2,0)->{physical}, 1024*1024*50, "Get disk physical info");
is($dom->get_block_info($dst,0)->{capacity}, 1024*1024*50, "Get disk capacity info");
......@@ -124,8 +124,7 @@ my $date = "test";
system("echo $date > $path");
is($dom->block_peek($path,0,4,0), $date, "Get date from raw image");
#qcow2 file start with hexadecimal:0x51 0x46 0x49 (ASCII: "QFI")
is($dom->block_peek($path3,0,3,0), "QFI", "Get date from qcow2 image");
dies_ok(sub { $dom->block_peek($path3,0,3,0) }, "Get date from qcow2 image");
lives_ok(sub { $vol->delete(0) }, "deleted volume");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment