bug #246: Fix the bug for ranged networks without address. Added new tests to reproduce this bug

This commit is contained in:
Ruben S. Montero committed 2010-06-03 17:03:14 +02:00
1 parent 54f37dbd8a
commit 276fad87a6
2 files changed
+19 -3

No files matched your search

+4 -1
View File
@@ -437,7 +437,10 @@ int VirtualNetwork::vn_drop(SqlDB * db)
vn_template.drop(db);
leases->drop(db);
if ( leases != 0 )
{
leases->drop(db);
}
oss << "DELETE FROM " << table << " WHERE OID=" << oid;
+15 -2
View File
@@ -57,6 +57,13 @@ const string templates[] =
"TYPE = not_a_type\n"
"BRIDGE = br1\n"
"LEASES = [IP=130.10.0.1, MAC=50:20:20:20:20:20]",
"NAME = \"Only a name in this network\"\n",
"NAME = \"Only a name in this network\"\n"
"TYPE = RANGED\n"
"BRIDGE = br0\n"
"NETWORK_SIZE = C\n"
};
const string xmls[] =
@@ -217,6 +224,12 @@ public:
//TODO: Check memory leak for allocating strings in template parser
rc = allocate(4);
CPPUNIT_ASSERT( rc == -2 );
rc = allocate(5);
CPPUNIT_ASSERT( rc == -3 );
rc = allocate(6);
CPPUNIT_ASSERT( rc == -1 );
}
void get_using_name()
@@ -236,7 +249,7 @@ public:
vn = vnpool->get(names[1], true);
CPPUNIT_ASSERT(vn != 0);
vn->unlock();
check(1, vn);
vn->unlock();
@@ -789,7 +802,7 @@ public:
CPPUNIT_ASSERT(rc == 0);
CPPUNIT_ASSERT(results.size() == 1);
}
void drop_leases()
{
int rc, oid;