5
0
mirror of git://git.proxmox.com/git/pve-firewall.git synced 2025-01-07 21:17:59 +03:00
pve-firewall/test
2016-03-03 09:42:46 +01:00
..
test-basic1 return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-default-rules1 return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-errors1 return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-errors2 return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-errors3 return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-errors4 return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-group1 adopt regresion tests for lxc containers 2015-08-12 11:59:18 +02:00
test-ipset1 return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-ipset2 return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-unconfigured return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-vm-aliases1 return empty ruleset if firewall disabled in cluster.fw 2014-06-04 07:24:34 +02:00
test-vm-ipfilter1 add regression tests for ipfilter 2014-06-12 08:32:11 +02:00
test-vm-ipfilter2 test: add test for implicitly allowed container IP 2016-03-03 09:42:46 +01:00
fwtester.pl adopt regresion tests for lxc containers 2015-08-12 11:59:18 +02:00
Makefile add Makefile targets for regression tests 2014-05-13 14:18:08 +02:00
README fwtester: simplify code with ne bport zone 2014-05-15 06:37:37 +02:00

=A simple simulator to test our iptables rules=

==Invovation==

 # ./fwtester.pl

This scans for subdirectory named test-* an invokes fwtester.pl 
for each subdirectory with:

 # ./fwtester.pl test-<name>/tests 

==Test directory contents==

Each test directory can contain the following files:

*cluster.fw  Cluster wide firewall config
  
*host.fw     Host firewall config

*<VMID>.fw   Firewall config for VMs     

*tests	     Test descriptions

==Test description==

The test description file can contain one or more tests using
the following syntax:

 { from => '<zone>' , to => '<zone>', action => '<DROP|RECECT|ACCEPT>', [ source => '<ip>',] [ dest => '<ip>',] [ proto => '<tcp|udp>',] [ dport => <port>,], [ sport => <port>,] }

The following <zone> definition exist currently:

* host:              The host itself

* outside:  	     The outside world (alias for 'vmbr0/eth0')

* vm<ID>:   	     A qemu virtual machine

* ct<ID>:   	     An openvz container

* nfvm:              Non firewalled VM (alias for 'vmbr0/tapXYZ')

* vmbr<\d+>/<bport>: Unmanaged bridge port

 
==Test examples==

 { from => 'outside', to => 'ct200', dport => 22, action => 'ACCEPT' }
 { from => 'vm101', to => 'vm100', dport => 443, action => 'ACCEPT', id => 'vm2vm'}

You can assign an 'id' to each test, so that you can run them separately:

 ./fwtester.pl -d test-basic1/tests vm2vm