|
#!/usr/bin/perl
BEGIN {
$| = 1; print "1.." ;
if ($< == 0) {
print "3\n" ;
} else {
print "0 # Skip Need to be root\n" ;
exit (0);
}
}
my $testiter = 1;
my $table = IPTables::libiptc::init( 'filter' );
unless ( $table ) {
print STDERR "$!\n" ;
print "not ok $testiter\n" ;
exit (1);
}
print "ok $testiter \n" ;
$testiter ++;
my $chainname = "testchain1" ;
if (! $table ->delete_chain( "$chainname" )) {
print STDERR "$!\n" ;
print "not " ;
}
print "ok $testiter\n" ;
$testiter ++;
if (! $table ->commit()) {
print "not " ;
}
print "ok $testiter\n" ;
$testiter ++;
|