mirror of
https://git.proxmox.com/git/pve-firewall
synced 2025-10-04 15:00:01 +00:00
add regression tests for ipfilter
This commit is contained in:
parent
66f33d78ed
commit
a306a176c4
13
test/test-vm-ipfilter1/100.fw
Normal file
13
test/test-vm-ipfilter1/100.fw
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[options]
|
||||||
|
|
||||||
|
enable: 1
|
||||||
|
|
||||||
|
[ipset ipfilter-net0]
|
||||||
|
1.2.3.4
|
||||||
|
1.2.3.5
|
||||||
|
|
||||||
|
[ipset ipfilter-net2] # empty, allow nothing
|
||||||
|
|
||||||
|
[rules]
|
||||||
|
|
||||||
|
IN ACCEPT -p tcp -dport 80
|
7
test/test-vm-ipfilter1/cluster.fw
Normal file
7
test/test-vm-ipfilter1/cluster.fw
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[options]
|
||||||
|
|
||||||
|
enable: 1
|
||||||
|
|
||||||
|
[rules]
|
||||||
|
|
||||||
|
IN ACCEPT -p tcp -dport 80 -source 1.2.3.0/24
|
15
test/test-vm-ipfilter1/tests
Normal file
15
test/test-vm-ipfilter1/tests
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{ from => 'vm100i1', source => '1.2.3.3', dport => 80, action => 'ACCEPT' }
|
||||||
|
{ from => 'vm100i1', source => '1.2.3.4', dport => 80, action => 'ACCEPT' }
|
||||||
|
{ from => 'vm100i1', source => '1.2.3.5', dport => 80, action => 'ACCEPT' }
|
||||||
|
{ from => 'vm100i1', source => '1.2.3.6', dport => 80, action => 'ACCEPT' }
|
||||||
|
|
||||||
|
|
||||||
|
{ from => 'vm100', source => '1.2.3.3', dport => 80, action => 'DROP' }
|
||||||
|
{ from => 'vm100', source => '1.2.3.4', dport => 80, action => 'ACCEPT' }
|
||||||
|
{ from => 'vm100', source => '1.2.3.5', dport => 80, action => 'ACCEPT' }
|
||||||
|
{ from => 'vm100', source => '1.2.3.6', dport => 80, action => 'DROP' }
|
||||||
|
|
||||||
|
{ from => 'vm100i2', source => '1.2.3.3', dport => 80, action => 'DROP' }
|
||||||
|
{ from => 'vm100i2', source => '1.2.3.4', dport => 80, action => 'DROP' }
|
||||||
|
{ from => 'vm100i2', source => '1.2.3.5', dport => 80, action => 'DROP' }
|
||||||
|
{ from => 'vm100i2', source => '1.2.3.6', dport => 80, action => 'DROP' }
|
Loading…
Reference in New Issue
Block a user