From nobody Sun Jul 13 16:13:15 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 1518117672617243.95374455913907; Thu, 8 Feb 2018 11:21:12 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4320E33BD4; Thu, 8 Feb 2018 19:21:11 +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 105AB608F4; Thu, 8 Feb 2018 19:21:11 +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 BDEF94A470; Thu, 8 Feb 2018 19:21:10 +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 w18JJkwl002763 for ; Thu, 8 Feb 2018 14:19:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 418842166BD6; Thu, 8 Feb 2018 19:19:46 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-170.phx2.redhat.com [10.3.117.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A52E2166BAE; Thu, 8 Feb 2018 19:19:45 +0000 (UTC) From: Laine Stump To: libvir-list@redhat.com Date: Thu, 8 Feb 2018 14:19:35 -0500 Message-Id: <20180208191939.30269-2-laine@laine.org> In-Reply-To: <20180208191939.30269-1-laine@laine.org> References: <20180208191939.30269-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 v2 1/5] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 08 Feb 2018 19:21:11 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The default filterref is still clean-traffic, but we can now set it to "no-broadcast-mac" for the test by that same name. 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). Signed-off-by: Laine Stump Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Berger --- Change from V1: keep default filter of "clean-traffic" rather than no filte= r. lib/Sys/Virt/TCK.pm | 9 ++++++--- scripts/nwfilter/230-no-mac-broadcast.t | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm index ce8e81b..01ce3ea 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} : "cl= ean-traffic"; =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} : "cl= ean-traffic"; =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/230-no-mac-broadcast.t b/scripts/nwfilter/230= -no-mac-broadcast.t index ed6932c..6ab20d8 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"); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list