Commit 979cf5f5 authored by Laine Stump's avatar Laine Stump

parameterize filterref in generic_domain

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: default avatarLaine Stump <laine@laine.org>
Reviewed-by: default avatarStefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
parent d6ab2540
......@@ -766,6 +766,7 @@ sub generic_machine_domain {
my $caps = exists $params{caps} ? $params{caps} : die "caps parameter is required";
my $ostype = exists $params{ostype} ? $params{ostype} : "hvm";
my $fullos = exists $params{fullos} ? $params{fullos} : 0;
my $filterref = exists $params{filterref} ? $params{filterref} : "clean-traffic";
if ($fullos) {
my %config = $self->get_image($caps, $ostype);
......@@ -792,7 +793,7 @@ sub generic_machine_domain {
source => "default",
model => "virtio",
mac => "52:54:00:11:11:11",
filterref => "clean-traffic");
filterref => $filterref);
my $xml = $b->as_xml();
# Cleanup the temporary interface
$b->rminterface();
......@@ -896,6 +897,7 @@ sub generic_domain {
my $ostype = exists $params{ostype} ? $params{ostype} : "hvm";
my $fullos = exists $params{fullos} ? $params{fullos} : 0;
my $netmode = exists $params{netmode} ? $params{netmode} : undef;
my $filterref = exists $params{filterref} ? $params{filterref} : "clean-traffic";
my $caps = Sys::Virt::TCK::Capabilities->new(xml => $self->conn->get_capabilities);
......@@ -915,7 +917,8 @@ sub generic_domain {
$b = $self->generic_machine_domain(name => $name,
caps => $caps,
ostype => $ostype,
fullos => $fullos);
fullos => $fullos,
filterref => $filterref);
}
if ($netmode) {
if ($netmode eq "vepa") {
......@@ -931,7 +934,7 @@ sub generic_domain {
source => "default",
model => "virtio",
mac => "52:54:00:11:11:11",
filterref => "clean-traffic");
filterref => $filterref);
}
}
return $b;
......
......@@ -43,7 +43,8 @@ END {
# create first domain and start it
my $xml = $tck->generic_domain(name => "tck", fullos => 1,
netmode => "network")->as_xml();
netmode => "network",
filterref => "no-mac-broadcast")->as_xml();
my $dom;
ok_domain(sub { $dom = $conn->define_domain($xml) }, "created persistent domain object");
......
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