diff --git a/src/authm/test/SConstruct b/src/authm/test/SConstruct index 991d6585a5..0e5538fcc1 100644 --- a/src/authm/test/SConstruct +++ b/src/authm/test/SConstruct @@ -33,6 +33,7 @@ env.Prepend(LIBS=[ 'nebula_template', 'nebula_image', 'nebula_pool', + 'nebula_cluster', 'nebula_host', 'nebula_vnm', 'nebula_vm', diff --git a/src/group/test/SConstruct b/src/group/test/SConstruct index 0c87811f1b..2439c9babc 100644 --- a/src/group/test/SConstruct +++ b/src/group/test/SConstruct @@ -34,6 +34,7 @@ env.Prepend(LIBS=[ 'nebula_template', 'nebula_image', 'nebula_pool', + 'nebula_cluster', 'nebula_host', 'nebula_vnm', 'nebula_vm', diff --git a/src/host/test/HostHookTest.cc b/src/host/test/HostHookTest.cc index 46ffbd7b6c..a9e2222663 100644 --- a/src/host/test/HostHookTest.cc +++ b/src/host/test/HostHookTest.cc @@ -96,7 +96,15 @@ public: { string err; - hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "vnm_mad", err); + hpool->allocate(&oid, + "host_test", + "im_mad", + "vmm_mad", + "vnm_mad", + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); + CPPUNIT_ASSERT( oid >= 0 ); sleep(1); @@ -114,7 +122,15 @@ public: { string err; - hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "vnm_mad", err); + + hpool->allocate(&oid, + "host_test", + "im_mad", + "vmm_mad", + "vnm_mad", + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); CPPUNIT_ASSERT( oid >= 0 ); host = hpool->get(oid, true); @@ -140,7 +156,14 @@ public: { string err; - hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "vnm_mad", err); + hpool->allocate(&oid, + "host_test", + "im_mad", + "vmm_mad", + "vnm_mad", + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); CPPUNIT_ASSERT( oid >= 0 ); host = hpool->get(oid, true); @@ -166,7 +189,15 @@ public: { string err; - hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "vnm_mad", err); + hpool->allocate(&oid, + "host_test", + "im_mad", + "vmm_mad", + "vnm_mad", + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); + CPPUNIT_ASSERT( oid >= 0 ); host = hpool->get(oid, true); diff --git a/src/host/test/HostPoolTest.cc b/src/host/test/HostPoolTest.cc index a46de04219..35f60838d8 100644 --- a/src/host/test/HostPoolTest.cc +++ b/src/host/test/HostPoolTest.cc @@ -163,7 +163,9 @@ protected: int oid; string err; return ((HostPool*)pool)->allocate(&oid, names[index], im_mad, - vmm_mad, vnm_mad, err); + vmm_mad, vnm_mad, + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME,err); }; void check(int index, PoolObjectSQL* obj) @@ -243,16 +245,37 @@ public: // If we try to allocate two hosts with the same name and drivers, // should fail - rc = hp->allocate(&oid_0, names[0], im_mad, vmm_mad, vnm_mad, err); + rc = hp->allocate(&oid_0, + names[0], + im_mad, + vmm_mad, + vnm_mad, + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); CPPUNIT_ASSERT( oid_0 == 0 ); CPPUNIT_ASSERT( rc == oid_0 ); - rc = hp->allocate(&oid_1, names[0], im_mad, vmm_mad, vnm_mad, err); + rc = hp->allocate(&oid_1, + names[0], + im_mad, + vmm_mad, + vnm_mad, + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); CPPUNIT_ASSERT( oid_1 == -1 ); CPPUNIT_ASSERT( rc == oid_1 ); // the hostname can not be repeated if the drivers change - rc = hp->allocate(&oid_1, names[0], im_mad_2, vmm_mad, vnm_mad, err); + rc = hp->allocate(&oid_1, + names[0], + im_mad_2, + vmm_mad, + vnm_mad, + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); CPPUNIT_ASSERT( oid_1 == -1 ); CPPUNIT_ASSERT( rc == oid_1 ); @@ -272,8 +295,14 @@ public: for(int i=0; i<5; i++) { - ((HostPool*)pool)->allocate(&oid, names[i], - im_mad, vmm_mad, vnm_mad, err); + ((HostPool*)pool)->allocate(&oid, + names[i], + im_mad, + vmm_mad, + vnm_mad, + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); } ostringstream oss; @@ -305,8 +334,14 @@ public: for(int i=0; i<5; i++) { - ((HostPool*)pool)->allocate(&oid, names[i], - im_mad, vmm_mad, vnm_mad, err); + ((HostPool*)pool)->allocate(&oid, + names[i], + im_mad, + vmm_mad, + vnm_mad, + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); } ostringstream oss; @@ -345,7 +380,14 @@ public: { oss << "host" << i; - hp->allocate(&oid, oss.str().c_str(),im_mad, vmm_mad, vnm_mad, err); + hp->allocate(&oid, + oss.str(), + im_mad, + vmm_mad, + vnm_mad, + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); CPPUNIT_ASSERT(oid == i); if (i >=8 ) @@ -403,7 +445,14 @@ public: { oss << "host" << j; - hp->allocate(&oid,oss.str().c_str(),im_mad,vmm_mad,vnm_mad,err); + hp->allocate(&oid, + oss.str(), + im_mad, + vmm_mad, + vnm_mad, + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); } the_time2 = time(0) - the_time; @@ -432,7 +481,14 @@ public: for (i=10000,oss.str(""); i<30000 ; i++,oss.str("")) { oss << "host" << i; - hp->allocate(&oid,oss.str().c_str(),im_mad,vmm_mad,vnm_mad,err); + hp->allocate(&oid, + oss.str(), + im_mad, + vmm_mad, + vnm_mad, + ClusterPool::DEFAULT_CLUSTER_ID, + ClusterPool::DEFAULT_CLUSTER_NAME, + err); host = hp->get(oid, false); diff --git a/src/host/test/SConstruct b/src/host/test/SConstruct index 1774ad750b..c1359e3518 100644 --- a/src/host/test/SConstruct +++ b/src/host/test/SConstruct @@ -19,6 +19,7 @@ Import('env') env.Prepend(LIBS=[ + 'nebula_cluster', 'nebula_host', 'nebula_core_test', 'nebula_vmm', diff --git a/src/image/test/ImagePoolTest.cc b/src/image/test/ImagePoolTest.cc index f4d96a010b..11f1d82003 100644 --- a/src/image/test/ImagePoolTest.cc +++ b/src/image/test/ImagePoolTest.cc @@ -597,7 +597,7 @@ public: VectorAttribute * disk; int oid_0, oid_1, index, img_id; - string value; + string value, error; Image::ImageType img_type; // --------------------------------------------------------------------- @@ -632,7 +632,7 @@ public: disk = new VectorAttribute("DISK"); disk->replace("IMAGE_ID", "0"); - ((ImagePool*)imp)->disk_attribute(disk, 0, &index, &img_type,0, img_id); + ((ImagePool*)imp)->disk_attribute(disk, 0, &index, &img_type,0, img_id,error); value = ""; value = disk->vector_value("TARGET"); @@ -646,7 +646,7 @@ public: disk = new VectorAttribute("DISK"); disk->replace("IMAGE_ID", "1"); - ((ImagePool*)imp)->disk_attribute(disk, 0, &index, &img_type,0, img_id); + ((ImagePool*)imp)->disk_attribute(disk, 0, &index, &img_type,0, img_id,error); value = ""; value = disk->vector_value("TARGET"); diff --git a/src/image/test/SConstruct b/src/image/test/SConstruct index f52fdc7afa..b1f7b9ac8a 100644 --- a/src/image/test/SConstruct +++ b/src/image/test/SConstruct @@ -34,6 +34,7 @@ env.Prepend(LIBS=[ 'nebula_template', 'nebula_image', 'nebula_pool', + 'nebula_cluster', 'nebula_host', 'nebula_vnm', 'nebula_vm', diff --git a/src/lcm/test/SConstruct b/src/lcm/test/SConstruct index 85491401e3..bd5dc5bfd2 100644 --- a/src/lcm/test/SConstruct +++ b/src/lcm/test/SConstruct @@ -36,6 +36,7 @@ env.Prepend(LIBS=[ 'nebula_template', 'nebula_image', 'nebula_pool', + 'nebula_cluster', 'nebula_host', 'nebula_vnm', 'nebula_vm', diff --git a/src/um/test/SConstruct b/src/um/test/SConstruct index 371e074bc7..5d0ff663e0 100644 --- a/src/um/test/SConstruct +++ b/src/um/test/SConstruct @@ -34,6 +34,7 @@ env.Prepend(LIBS=[ 'nebula_template', 'nebula_image', 'nebula_pool', + 'nebula_cluster', 'nebula_host', 'nebula_vnm', 'nebula_vm', diff --git a/src/vnm/test/SConstruct b/src/vnm/test/SConstruct index 505a1e559a..1bb4837eb8 100644 --- a/src/vnm/test/SConstruct +++ b/src/vnm/test/SConstruct @@ -24,6 +24,7 @@ env.Prepend(LIBS=[ 'nebula_hm', 'nebula_rm', 'nebula_datastore', + 'nebula_cluster', 'nebula_dm', 'nebula_tm', 'nebula_um', diff --git a/src/vnm/test/VirtualNetworkPoolTest.cc b/src/vnm/test/VirtualNetworkPoolTest.cc index 5e57f71373..0f0f3f1da1 100644 --- a/src/vnm/test/VirtualNetworkPoolTest.cc +++ b/src/vnm/test/VirtualNetworkPoolTest.cc @@ -1067,7 +1067,7 @@ public: VectorAttribute * disk; int oid_0, oid_1; - string value; + string value, error; // --------------------------------------------------------------------- // Allocate 2 vnets @@ -1092,9 +1092,9 @@ public: disk = new VectorAttribute("DISK"); disk->replace("NETWORK", "Net 0"); - ((VirtualNetworkPool*)vnp)->nic_attribute(disk, 0, 0); + ((VirtualNetworkPool*)vnp)->nic_attribute(disk, 0, 0, error); - ((VirtualNetworkPool*)vnp)->nic_attribute(disk, 0, 0); + ((VirtualNetworkPool*)vnp)->nic_attribute(disk, 0, 0, error); value = ""; value = disk->vector_value("NETWORK"); @@ -1123,7 +1123,7 @@ public: disk = new VectorAttribute("DISK"); disk->replace("NETWORK_ID", "1"); - ((VirtualNetworkPool*)vnp)->nic_attribute(disk,0, 0); + ((VirtualNetworkPool*)vnp)->nic_attribute(disk,0, 0, error); value = ""; value = disk->vector_value("NETWORK");