public void testClusterResizeSuccess() throws Exception {
stopVcVm(vcRP + "/" + ConfigInfo.getSerengetiUUID() + "-"
+ TEST_DHCP_CLUSTER_NAME + "/" + "worker",
TEST_DHCP_CLUSTER_NAME + "-worker-0");
long jobExecutionId = clusterMgr.resizeCluster(TEST_DHCP_CLUSTER_NAME, "worker", 2);
ClusterRead cluster =
clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
Assert.assertTrue(cluster.getStatus() == ClusterStatus.UPDATING,
"Cluster status should be UPDATING, but got " + cluster.getStatus());
waitTaskFinished(jobExecutionId);
assertTaskSuccess(jobExecutionId);
assertDefinedInstanceNum(TEST_DHCP_CLUSTER_NAME, "worker", 2);
NodeEntity node =
clusterEntityMgr.findByName(TEST_DHCP_CLUSTER_NAME, "worker",
TEST_DHCP_CLUSTER_NAME + "-worker-0");
Assert.assertTrue(
node.getStatus() == NodeStatus.POWERED_OFF,
"Stopped vm " + TEST_DHCP_CLUSTER_NAME + "-worker-0"
+ " status should be Powered Off, but got "
+ node.getStatus());
cluster = clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
Assert.assertTrue(cluster.getStatus() == ClusterStatus.RUNNING,
"Cluster status should be RUNNING, but got " + cluster.getStatus());
}