additional unit test for run_time_address_tables configlet

This commit is contained in:
Vadim Kurland
2010-07-24 05:05:48 +00:00
parent 46be5ec6c1
commit e7983c0eeb
2 changed files with 24 additions and 3 deletions
@@ -367,7 +367,26 @@ void GeneratedScriptTest::virtualAddressesForNat2Test()
delete objdb;
}
void GeneratedScriptTest::runTimeAddressTablesWithIpSetTest()
/*
* negative test first. test6 does not use ipset module and the configlet should
* only insert blank function check_run_time_address_table_files()
*/
void GeneratedScriptTest::runTimeAddressTablesWithIpSet1Test()
{
objdb = new FWObjectDatabase();
runCompiler("test1.fwb", "test6", "test6.fw");
QString res = Configlet::findConfigletInFile("run_time_address_tables", "test6.fw");
CPPUNIT_ASSERT(!res.isEmpty());
int n1 = res.indexOf("load_run_time_address_table_files() {");
CPPUNIT_ASSERT(n1 == -1);
n1 = res.indexOf("check_run_time_address_table_files() {");
CPPUNIT_ASSERT(n1 != -1);
delete objdb;
}
void GeneratedScriptTest::runTimeAddressTablesWithIpSet2Test()
{
QStringList sample_1;
@@ -57,7 +57,8 @@ public:
void configureInterfacesClusterTest();
void virtualAddressesForNat1Test();
void virtualAddressesForNat2Test();
void runTimeAddressTablesWithIpSetTest();
void runTimeAddressTablesWithIpSet1Test();
void runTimeAddressTablesWithIpSet2Test();
CPPUNIT_TEST_SUITE(GeneratedScriptTest);
CPPUNIT_TEST(ManifestTest);
@@ -68,7 +69,8 @@ public:
CPPUNIT_TEST(configureInterfacesClusterTest);
CPPUNIT_TEST(virtualAddressesForNat1Test);
CPPUNIT_TEST(virtualAddressesForNat2Test);
CPPUNIT_TEST(runTimeAddressTablesWithIpSetTest);
CPPUNIT_TEST(runTimeAddressTablesWithIpSet1Test);
CPPUNIT_TEST(runTimeAddressTablesWithIpSet2Test);
CPPUNIT_TEST_SUITE_END();
};