1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

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 2010-06-03 17:03:14 +02:00
parent 54f37dbd8a
commit 276fad87a6
2 changed files with 19 additions and 3 deletions

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;

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;