From nobody Thu May 15 03:34:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1518055527680798.6439602545272; Wed, 7 Feb 2018 18:05:27 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DBFF21752D8; Thu, 8 Feb 2018 02:05:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6AC160C89; Thu, 8 Feb 2018 02:05:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 83ECC4A472; Thu, 8 Feb 2018 02:05:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w18256ca023219 for ; Wed, 7 Feb 2018 21:05:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 969A12166BD6; Thu, 8 Feb 2018 02:05:06 +0000 (UTC) Received: from tlap.laine.org.com (ovpn-120-186.rdu2.redhat.com [10.10.120.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6EE412166BB3; Thu, 8 Feb 2018 02:05:06 +0000 (UTC) From: Laine Stump To: libvir-list@redhat.com Date: Wed, 7 Feb 2018 21:04:56 -0500 Message-Id: <20180208020459.16928-7-laine@laine.org> In-Reply-To: <20180208020459.16928-1-laine@laine.org> References: <20180208020459.16928-1-laine@laine.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [tck PATCH 6/9] parameterize filterref in generic_domain X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 08 Feb 2018 02:05:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ...and set it properly in all the nwfilter tests (it's irrelevant for the others). This corrects a problem with the no-mac-broadcast test, which was checking to see that packets with a destination MAC address of ff:ff:ff:ff:ff:ff weren't allowed, but was neglecting to add the "no-mac-broadcast" nwfilter to the domain (the test was erroneously succeeding because it was checking for a different type of packet than it was generating, which is fixed in a separate patch). --- lib/Sys/Virt/TCK.pm | 9 ++++++--- scripts/nwfilter/100-ping-still-working.t | 3 ++- scripts/nwfilter/210-no-mac-spoofing.t | 3 ++- scripts/nwfilter/220-no-ip-spoofing.t | 3 ++- scripts/nwfilter/230-no-mac-broadcast.t | 3 ++- scripts/nwfilter/240-no-arp-spoofing.t | 3 ++- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm index ce8e81b..2259042 100644 --- a/lib/Sys/Virt/TCK.pm +++ b/lib/Sys/Virt/TCK.pm @@ -766,6 +766,7 @@ sub generic_machine_domain { my $caps =3D exists $params{caps} ? $params{caps} : die "caps paramete= r is required"; my $ostype =3D exists $params{ostype} ? $params{ostype} : "hvm"; my $fullos =3D exists $params{fullos} ? $params{fullos} : 0; + my $filterref =3D exists $params{filterref} ? $params{filterref} : und= ef; =20 if ($fullos) { my %config =3D $self->get_image($caps, $ostype); @@ -792,7 +793,7 @@ sub generic_machine_domain { source =3D> "default", model =3D> "virtio", mac =3D> "52:54:00:11:11:11", - filterref =3D> "clean-traffic"); + filterref =3D> $filterref); my $xml =3D $b->as_xml(); # Cleanup the temporary interface $b->rminterface(); @@ -896,6 +897,7 @@ sub generic_domain { my $ostype =3D exists $params{ostype} ? $params{ostype} : "hvm"; my $fullos =3D exists $params{fullos} ? $params{fullos} : 0; my $netmode =3D exists $params{netmode} ? $params{netmode} : undef; + my $filterref =3D exists $params{filterref} ? $params{filterref} : und= ef; =20 my $caps =3D Sys::Virt::TCK::Capabilities->new(xml =3D> $self->conn->g= et_capabilities); =20 @@ -915,7 +917,8 @@ sub generic_domain { $b =3D $self->generic_machine_domain(name =3D> $name, caps =3D> $caps, ostype =3D> $ostype, - fullos =3D> $fullos); + fullos =3D> $fullos, + filterref =3D> $filterref); } if ($netmode) { if ($netmode eq "vepa") { @@ -931,7 +934,7 @@ sub generic_domain { source =3D> "default", model =3D> "virtio", mac =3D> "52:54:00:11:11:11", - filterref =3D> "clean-traffic"); + filterref =3D> $filterref); } } return $b; diff --git a/scripts/nwfilter/100-ping-still-working.t b/scripts/nwfilter/1= 00-ping-still-working.t index 5afc6a6..1bbd7c5 100644 --- a/scripts/nwfilter/100-ping-still-working.t +++ b/scripts/nwfilter/100-ping-still-working.t @@ -44,7 +44,8 @@ END { =20 # create first domain and start it my $xml =3D $tck->generic_domain(name =3D> "tck", fullos =3D> 1, - netmode =3D> "network")->as_xml(); + netmode =3D> "network", + filterref =3D> "clean-traffic")->as_xml(); =20 my $dom; ok_domain(sub { $dom =3D $conn->define_domain($xml) }, "created persistent= domain object"); diff --git a/scripts/nwfilter/210-no-mac-spoofing.t b/scripts/nwfilter/210-= no-mac-spoofing.t index eb01d13..b4a4990 100644 --- a/scripts/nwfilter/210-no-mac-spoofing.t +++ b/scripts/nwfilter/210-no-mac-spoofing.t @@ -44,7 +44,8 @@ END { =20 # create first domain and start it my $xml =3D $tck->generic_domain(name =3D> "tck", fullos =3D> 1, - netmode =3D> "network")->as_xml(); + netmode =3D> "network", + filterref =3D> "clean-traffic")->as_xml(); =20 my $dom; ok_domain(sub { $dom =3D $conn->define_domain($xml) }, "created persistent= domain object"); diff --git a/scripts/nwfilter/220-no-ip-spoofing.t b/scripts/nwfilter/220-n= o-ip-spoofing.t index 5903961..f3e4a38 100644 --- a/scripts/nwfilter/220-no-ip-spoofing.t +++ b/scripts/nwfilter/220-no-ip-spoofing.t @@ -44,7 +44,8 @@ END { =20 # create first domain and start it my $xml =3D $tck->generic_domain(name =3D> "tck", fullos =3D> 1, - netmode =3D> "network")->as_xml(); + netmode =3D> "network", + filterref =3D> "clean-traffic")->as_xml(); =20 my $dom; ok_domain(sub { $dom =3D $conn->define_domain($xml) }, "created persistent= domain object"); diff --git a/scripts/nwfilter/230-no-mac-broadcast.t b/scripts/nwfilter/230= -no-mac-broadcast.t index 70c1ab4..292c056 100644 --- a/scripts/nwfilter/230-no-mac-broadcast.t +++ b/scripts/nwfilter/230-no-mac-broadcast.t @@ -43,7 +43,8 @@ END { =20 # create first domain and start it my $xml =3D $tck->generic_domain(name =3D> "tck", fullos =3D> 1, - netmode =3D> "network")->as_xml(); + netmode =3D> "network", + filterref =3D> "no-mac-broadcast")->as_xml(= ); =20 my $dom; ok_domain(sub { $dom =3D $conn->define_domain($xml) }, "created persistent= domain object"); diff --git a/scripts/nwfilter/240-no-arp-spoofing.t b/scripts/nwfilter/240-= no-arp-spoofing.t index 45f790a..33febe9 100644 --- a/scripts/nwfilter/240-no-arp-spoofing.t +++ b/scripts/nwfilter/240-no-arp-spoofing.t @@ -45,7 +45,8 @@ END { =20 # create first domain and start it my $xml =3D $tck->generic_domain(name =3D> "tck", fullos =3D> 1, - netmode =3D> "network")->as_xml(); + netmode =3D> "network", + filterref =3D> "clean-traffic")->as_xml(); =20 my $dom; ok_domain(sub { $dom =3D $conn->define_domain($xml) }, "created persistent= domain object"); --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list