From dfb9983a7ca8b9518f9873f5b604d6326281ff29 Mon Sep 17 00:00:00 2001 From: Vadim Kurland Date: Fri, 25 Feb 2011 17:52:32 -0800 Subject: [PATCH] see #87 fixed unit tests --- src/libgui/IOSImporter.cpp | 1 + src/libgui/IPTImporter.cpp | 1 + src/unit_tests/ImporterTest/test_data/ios.result | 10 +++++----- src/unit_tests/ImporterTest/test_data/ipt.result | 8 ++++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/libgui/IOSImporter.cpp b/src/libgui/IOSImporter.cpp index 276f66628..b816bc6ca 100644 --- a/src/libgui/IOSImporter.cpp +++ b/src/libgui/IOSImporter.cpp @@ -397,6 +397,7 @@ Firewall* IOSImporter::finalize() fw->setStr("host_OS", "ios"); Resources::setDefaultTargetOptions("ios" , fw); fw->setStr("version", ""); // default version "any" + fw->getManagementObject(); // creates management obj FWObject *policy = getFirewallObject()->getFirstByType(Policy::TYPENAME); assert( policy!=NULL ); diff --git a/src/libgui/IPTImporter.cpp b/src/libgui/IPTImporter.cpp index d6415b6f4..7ea97b1a2 100644 --- a/src/libgui/IPTImporter.cpp +++ b/src/libgui/IPTImporter.cpp @@ -1283,6 +1283,7 @@ Firewall* IPTImporter::finalize() fw->setStr("host_OS", "linux24"); Resources::setDefaultTargetOptions("linux24" , fw); fw->setStr("version", ""); // default version "any" + fw->getManagementObject(); // creates management obj FWOptions *fwopt = fw->getOptionsObject(); assert(fwopt!=NULL); diff --git a/src/unit_tests/ImporterTest/test_data/ios.result b/src/unit_tests/ImporterTest/test_data/ios.result index 257e69033..65b994786 100644 --- a/src/unit_tests/ImporterTest/test_data/ios.result +++ b/src/unit_tests/ImporterTest/test_data/ios.result @@ -1,20 +1,20 @@ Host name: "c3620" -Interface: FastEthernet0/0 +New interface: FastEthernet0/0 Interface address: 192.168.100.100/255.255.255.0 Interface address: 10.3.14.201/255.255.255.0 Interface ruleset fe0_0_acl_in direction 'in' (set to 'in') Interface ruleset fe0_0_acl_out direction 'out' (set to 'out') -Interface: Ethernet1/0 +New interface: Ethernet1/0 Interface comment: Test [ test ] { test } ( and one more test) / weird:characters#$%^&*/ Interface address: 192.168.171.2/255.255.255.0 Interface ruleset e1_0_acl_in direction 'in' (set to 'in') Interface ruleset e1_0_acl_out direction 'out' (set to 'out') -Interface: Serial1/0 -Interface: Ethernet1/1 +New interface: Serial1/0 +New interface: Ethernet1/1 Interface address: 10.10.10.10/255.255.255.0 Interface ruleset acl_133 direction 'in' (set to 'in') Interface ruleset acl_133 direction 'out' (set to 'both') -Interface: Ethernet1/2 +New interface: Ethernet1/2 Interface address: 10.10.20.20/255.255.255.0 Interface ruleset acl_133 direction 'in' (set to 'in') Interface ruleset acl_133 direction 'out' (set to 'both') diff --git a/src/unit_tests/ImporterTest/test_data/ipt.result b/src/unit_tests/ImporterTest/test_data/ipt.result index f8bd959a2..f51fbae66 100644 --- a/src/unit_tests/ImporterTest/test_data/ipt.result +++ b/src/unit_tests/ImporterTest/test_data/ipt.result @@ -19,11 +19,11 @@ Created branch OUTPUT_established_1 Rule matches states 'RELATED,ESTABLISHED'. Consider using automatic rule controlled by the checkbox in the firewall settings dialog. Automatic rule matches in all standard chains which may be different from the original imported configuration. This requires manual checking. Using automatic rule controlled by option 'Drop packet that do not match any known connection' to match state INVALID Using automatic rule controlled by option 'Drop packet that do not match any known connection' to match state INVALID -Interface: lo +New interface: lo UDP Service object: udp 1604-1604 Created branch Policy_eth1 -Interface: eth1 -Interface: eth0 +New interface: eth1 +New interface: eth0 Creating branch ruleset 'Policy_eth1' to match inbound and outbound interfaces -i eth0 -o eth1 TCP Service object: tcp 0-8000 UDP Service object: udp 0-8000 @@ -134,7 +134,7 @@ Skip command with '-j CONNMARK --restore-mark' This rule is generated automatica TCP Service object: tcp 25-25: Turned option on in previous rule with action Mark for '-j CONNMARK --save-mark' Tag Service object: tag-1 -Interface: eth2 +New interface: eth2 Tag Service object: tag-2 Ruleset: nat / PREROUTING Default action: Accept