[libvirt] [tck PATCH 0/3] Some misc fixes

Just random things i found while testing the TCK against current git Daniel P. Berrangé (3): scripts: avoid using multicast MAC addresses scripts: strip quotes from URI before checking it scripts: fix block info test conditions scripts/domain/121-block-info.t | 5 ++--- scripts/domain/215-nic-hotplug-many.t | 6 +++--- scripts/nwfilter/nwfilter2vmtest.sh | 2 +- scripts/nwfilter/nwfilter_concurrent.sh | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) -- 2.17.0

The leading digit from the MAC address should be an even number Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- scripts/domain/215-nic-hotplug-many.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/domain/215-nic-hotplug-many.t b/scripts/domain/215-nic-hotplug-many.t index 0270054..eaa282a 100644 --- a/scripts/domain/215-nic-hotplug-many.t +++ b/scripts/domain/215-nic-hotplug-many.t @@ -47,9 +47,9 @@ diag "Creating a new transient domain"; my $dom; ok_domain(sub { $dom = $conn->create_domain($xml) }, "created transient domain object"); -my $mac1 = "01:11:22:33:44:55"; -my $mac2 = "02:11:22:33:44:55"; -my $mac3 = "03:11:22:33:44:55"; +my $mac1 = "02:11:22:33:44:55"; +my $mac2 = "02:12:22:33:44:55"; +my $mac3 = "02:13:22:33:44:55"; my $model = "virtio"; my $netxml1 = <<EOF; -- 2.17.0

The config file may have the URI listed with or without quotes, and the nwfilter tests didn't strip quotes before checking against the whitelisted URI. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- scripts/nwfilter/nwfilter2vmtest.sh | 2 +- scripts/nwfilter/nwfilter_concurrent.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/nwfilter/nwfilter2vmtest.sh b/scripts/nwfilter/nwfilter2vmtest.sh index 90a5255..ae28b73 100644 --- a/scripts/nwfilter/nwfilter2vmtest.sh +++ b/scripts/nwfilter/nwfilter2vmtest.sh @@ -16,7 +16,7 @@ VIRSH=virsh $ { x p -}' < "$LIBVIRT_TCK_CONFIG") +}' < "$LIBVIRT_TCK_CONFIG" | sed -e 's/"//g') : "${uri:=qemu:///system}" LIBVIRT_URI=${uri} diff --git a/scripts/nwfilter/nwfilter_concurrent.sh b/scripts/nwfilter/nwfilter_concurrent.sh index 4c9b878..c42dd78 100644 --- a/scripts/nwfilter/nwfilter_concurrent.sh +++ b/scripts/nwfilter/nwfilter_concurrent.sh @@ -12,7 +12,7 @@ uri=$(sed -n '/^uri[ ]*=[ ]*/ { $ { x p -}' < "$LIBVIRT_TCK_CONFIG") +}' < "$LIBVIRT_TCK_CONFIG" | sed -e 's/"//g') : "${uri:=qemu:///system}" LIBVIRT_URI=${uri} -- 2.17.0

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. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- scripts/domain/121-block-info.t | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/domain/121-block-info.t b/scripts/domain/121-block-info.t index 6fa7780..bfff48c 100644 --- a/scripts/domain/121-block-info.t +++ b/scripts/domain/121-block-info.t @@ -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"); -- 2.17.0

On Mon, May 21, 2018 at 02:01:39PM +0100, Daniel P. Berrangé wrote:
Just random things i found while testing the TCK against current git
Daniel P. Berrangé (3): scripts: avoid using multicast MAC addresses scripts: strip quotes from URI before checking it scripts: fix block info test conditions
scripts/domain/121-block-info.t | 5 ++--- scripts/domain/215-nic-hotplug-many.t | 6 +++--- scripts/nwfilter/nwfilter2vmtest.sh | 2 +- scripts/nwfilter/nwfilter_concurrent.sh | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Daniel P. Berrangé
-
Ján Tomko