5
0
mirror of git://git.proxmox.com/git/pve-firewall.git synced 2025-03-06 00:58:15 +03:00

fwtester.pl: add warnings to trace

This commit is contained in:
Dietmar Maurer 2014-05-27 06:58:13 +02:00
parent b5831a0de8
commit 4912485180
2 changed files with 10 additions and 0 deletions

View File

@ -37,6 +37,14 @@ sub add_trace {
}
}
$SIG{'__WARN__'} = sub {
my $err = $@;
my $t = $_[0];
chomp $t;
add_trace("$t\n");
$@ = $err;
};
sub nf_dev_match {
my ($devre, $dev) = @_;

View File

@ -39,6 +39,8 @@ sub run_tests {
my ($ruleset, $ipset_ruleset) =
PVE::Firewall::compile(undef, undef, $vmdata, 1);
print PVE::FirewallSimulator::get_trace() . "\n" if !$debug;
my $filename = "$testdir/$testfile";
my $fh = IO::File->new($filename) ||
die "unable to open '$filename' - $!\n";