]> git.proxmox.com Git - pve-firewall.git/blobdiff - test/fwtester.pl
add tests for corosync multicast addrtype rules
[pve-firewall.git] / test / fwtester.pl
index 17b883d51a4fec531139abfe3e04e1820deb4914..a99a7906ded4d1865bfd9b579dc4e016baae7332 100755 (executable)
@@ -81,8 +81,16 @@ sub rule_match {
            die "please implement cstate test '$cstate'";
        }
 
-       if ($rule =~ s/^-m addrtype\s*//) {
-           return undef; # simply ignore
+       if ($rule =~ s/^-m addrtype --src-type (\S+)\s*//) {
+           my $atype = $1;
+           die "missing srctype" if !$pkg->{srctype};
+           return undef if $atype ne $pkg->{srctype};
+       }
+
+       if ($rule =~ s/^-m addrtype --dst-type (\S+)\s*//) {
+           my $atype = $1;
+           die "missing dsttype" if !$pkg->{dsttype};
+           return undef if $atype ne $pkg->{dsttype};
        }
 
        if ($rule =~ s/^-i (\S+)\s*//) {
@@ -485,6 +493,8 @@ sub simulate_firewall {
        dport => undef,
        source => undef,
        dest => undef,
+       srctype => 'UNICAST',
+       dsttype => 'UNICAST',
     };
 
     while (my ($k,$v) = each %$test) {