- eval { simulate_firewall($ruleset, $ipset_ruleset, $vmdata, $test); };
+ eval {
+ my @test_zones = qw(host outside nfvm vm100 ct200);
+ if (!defined($test->{from}) && !defined($test->{to})) {
+ die "missing zone speification (from, to)\n";
+ } elsif (!defined($test->{to})) {
+ foreach my $zone (@test_zones) {
+ next if $zone eq $test->{from};
+ $test->{to} = $zone;
+ add_trace("Set Zone: to => '$zone'\n");
+ simulate_firewall($ruleset, $ipset_ruleset, $vmdata, $test);
+ }
+ } elsif (!defined($test->{from})) {
+ foreach my $zone (@test_zones) {
+ next if $zone eq $test->{to};
+ $test->{from} = $zone;
+ add_trace("Set Zone: from => '$zone'\n");
+ simulate_firewall($ruleset, $ipset_ruleset, $vmdata, $test);
+ }
+ } else {
+ simulate_firewall($ruleset, $ipset_ruleset, $vmdata, $test);
+ }
+ };