write real files
[pve-firewall.git] / fwtest.pl
CommitLineData
b6360c3f
DM
1#!/usr/bin/perl -w
2
3use strict;
4use lib qw(.);
5use PVE::Firewall;
f789653a 6use File::Path;
b6360c3f
DM
7
8my $vmdata = {
9 qemu => {
10 100 => {
11 net0 => 'rtl8139=9A:42:2D:0C:01:FF,bridge=vmbr0',
12 },
13 101 => {
14 net0 => 'rtl8139=0E:9D:ED:CC:9B:ED,bridge=vmbr0',
15 },
886aba9c
DM
16 102 => {
17 zone => 'z1',
18 net0 => 'rtl8139=0E:9D:ED:CC:AA:ED,bridge=vmbr0',
f789653a 19 net1 => 'rtl8139=0E:9D:ED:CC:CC:ED,bridge=vmbr1',
886aba9c
DM
20 },
21 103 => {
22 zone => 'z1',
23 net0 => 'rtl8139=0E:9D:ED:CC:BC:ED,bridge=vmbr0',
24 net1 => 'rtl8139=0E:9D:ED:CC:BC:AA,tag=5,bridge=vmbr0',
25 },
b6360c3f
DM
26 },
27};
28
f789653a
DM
29my $testdir = "./testdir";
30rmtree($testdir);
31mkdir $testdir;
32
33PVE::Firewall::compile($testdir, $vmdata);
34
35PVE::Tools::run_command(['shorewall', 'check', $testdir]);
b6360c3f
DM
36
37exit(0);