Revision 6329d8b3 src/cluster/test/ClusterPoolTest.cc

View differences:

src/cluster/test/ClusterPoolTest.cc
38 38
    "<CLUSTER_POOL><CLUSTER><ID>0</ID><NAME>default</NAME></CLUSTER><CLUSTER><ID>1</ID><NAME>cluster_a</NAME></CLUSTER><CLUSTER><ID>3</ID><NAME>cluster_c</NAME></CLUSTER><CLUSTER><ID>4</ID><NAME>cluster_d</NAME></CLUSTER></CLUSTER_POOL>";
39 39

  
40 40
const string host_0_cluster =
41
    "<HOST><ID>0</ID><NAME>Host one</NAME><STATE>0</STATE><IM_MAD>im_mad</IM_MAD><VM_MAD>vmm_mad</VM_MAD><TM_MAD>tm_mad</TM_MAD><LAST_MON_TIME>0</LAST_MON_TIME><CLUSTER>cluster_a</CLUSTER><HOST_SHARE><DISK_USAGE>0</DISK_USAGE><MEM_USAGE>0</MEM_USAGE><CPU_USAGE>0</CPU_USAGE><MAX_DISK>0</MAX_DISK><MAX_MEM>0</MAX_MEM><MAX_CPU>0</MAX_CPU><FREE_DISK>0</FREE_DISK><FREE_MEM>0</FREE_MEM><FREE_CPU>0</FREE_CPU><USED_DISK>0</USED_DISK><USED_MEM>0</USED_MEM><USED_CPU>0</USED_CPU><RUNNING_VMS>0</RUNNING_VMS></HOST_SHARE><TEMPLATE></TEMPLATE></HOST>";
41
    "<HOST><ID>0</ID><NAME>Host one</NAME><STATE>0</STATE><IM_MAD>im_mad</IM_MAD><VM_MAD>vmm_mad</VM_MAD><TM_MAD>tm_mad</TM_MAD><LAST_MON_TIME>0</LAST_MON_TIME><CID>1</CID><HOST_SHARE><DISK_USAGE>0</DISK_USAGE><MEM_USAGE>0</MEM_USAGE><CPU_USAGE>0</CPU_USAGE><MAX_DISK>0</MAX_DISK><MAX_MEM>0</MAX_MEM><MAX_CPU>0</MAX_CPU><FREE_DISK>0</FREE_DISK><FREE_MEM>0</FREE_MEM><FREE_CPU>0</FREE_CPU><USED_DISK>0</USED_DISK><USED_MEM>0</USED_MEM><USED_CPU>0</USED_CPU><RUNNING_VMS>0</RUNNING_VMS></HOST_SHARE><TEMPLATE></TEMPLATE></HOST>";
42 42

  
43 43
const string host_0_default =
44 44
    "<HOST><ID>0</ID><NAME>Host one</NAME><STATE>0</STATE>"
45 45
    "<IM_MAD>im_mad</IM_MAD><VM_MAD>vmm_mad</VM_MAD><TM_MAD>tm_mad</TM_MAD>"
46
    "<LAST_MON_TIME>0</LAST_MON_TIME><CLUSTER>default</CLUSTER><HOST_SHARE>"
46
    "<LAST_MON_TIME>0</LAST_MON_TIME><CID>0</CID><HOST_SHARE>"
47 47
    "<DISK_USAGE>0</DISK_USAGE><MEM_USAGE>0</MEM_USAGE><CPU_USAGE>0</CPU_USAGE>"
48 48
    "<MAX_DISK>0</MAX_DISK><MAX_MEM>0</MAX_MEM><MAX_CPU>0</MAX_CPU>"
49 49
    "<FREE_DISK>0</FREE_DISK><FREE_MEM>0</FREE_MEM><FREE_CPU>0</FREE_CPU>"
......
271 271
        host = hpool->get(0, false);
272 272
        CPPUNIT_ASSERT(host != 0);
273 273

  
274
        rc = host->set_cluster("cluster_a");
274
        rc = host->set_cluster(1);
275 275
        CPPUNIT_ASSERT( rc == 0 );
276 276

  
277 277
        hpool->update(host);
......
295 295
        CPPUNIT_ASSERT(host != 0);
296 296

  
297 297
        // Set cluster
298
        rc = host->set_cluster("cluster_a");
298
        rc = host->set_cluster(1);
299 299
        CPPUNIT_ASSERT( rc == 0 );
300 300

  
301 301
        hpool->update(host);
......
339 339
        cluster = cpool->get(1, false);
340 340

  
341 341
        // Set cluster
342
        rc = host->set_cluster(cluster->get_name());
342
        rc = host->set_cluster(cluster->get_oid());
343 343
        CPPUNIT_ASSERT( rc == 0 );
344 344

  
345 345
        hpool->update(host);

Also available in: Unified diff