예제 #1
0
 def test_UpdateCluster_host(self):
     '''
     @summary: 测试步骤
     @note: (1)
     @note: (2)
     '''
     clusterapi = ClusterAPIs()
     LogPrint().info(
         "Test: Edit cluster's name while there are hosts in cluster.")
     r = clusterapi.updateCluster(self.dm.cluster_name,
                                  self.dm.cluster_info_new)
     if r['status_code'] == self.dm.status_code:
         dict_actual = r['result']
         dict_expected = xmltodict.parse(self.dm.cluster_info_new)
         dictCompare = DictCompare()
         if dictCompare.isSubsetDict(dict_expected, dict_actual):
             LogPrint().info(
                 "PASS: ITC0201040203_test_UpdateCluster_host_name SUCCESS."
             )
             self.flag = True
         else:
             LogPrint().error(
                 "FAIL: ITC0201040203_test_UpdateCluster_host_name. Error-info INCORRECT."
             )
             self.flag = False
     else:
         LogPrint().error(
             "FAIL: ITC0201040203_test_UpdateCluster_host_name.Status_code is wrong. "
         )
         self.flag = False
     self.assertTrue(self.flag)
예제 #2
0
 def test_UpdateCluster_host(self):
     '''
     @summary: 测试步骤
     @note: (1)
     @note: (2)
     '''
     clusterapi = ClusterAPIs()
     LogPrint().info(
         "Test: Improve cluster's CPU level while there are hosts in cluster."
     )
     r = clusterapi.updateCluster(self.dm.cluster_name,
                                  self.dm.cluster_info_new)
     if r['status_code'] == self.dm.status_code:
         dict_actual = r['result']
         dict_expected = xmltodict.parse(self.dm.expected_info)
         dictCompare = DictCompare()
         if dictCompare.isSubsetDict(dict_expected, dict_actual):
             LogPrint().info(
                 "PASS: ITC0201040202_test_UpdateCluster_host_upcpu SUCCESS."
             )
             self.flag = True
         else:
             LogPrint().error(
                 "FAIL: ITC0201040202_test_UpdateCluster_host_upcpu. Error-info INCORRECT."
             )
             self.flag = False
     else:
         LogPrint().error("FAIL: Returned tatus_code '%s' is WRONG." %
                          r['status_code'])
         self.flag = False
     self.assertTrue(self.flag)
예제 #3
0
 def test_UpdateCluster_host(self):
     '''
     @summary: 测试步骤
     @note: (1)更改含有主机的集群CPU类型;
     @note: (2)操作成功,验证接口返回的状态码、相关信息是否正确。
     '''
     clusterapi = ClusterAPIs()
     LogPrint().info(
         "Test: Edit cluster's cpu type if there are hosts in this cluster."
     )
     r = clusterapi.updateCluster(self.dm.cluster_name,
                                  self.dm.cluster_info_new)
     if r['status_code'] == self.dm.status_code:
         dict_actual = r['result']
         dict_expected = xmltodict.parse(self.dm.expected_info)
         dictCompare = DictCompare()
         if dictCompare.isSubsetDict(dict_expected, dict_actual):
             LogPrint().info(
                 "PASS: ITC0201040201_test_UpdateCluster_host_cputype SUCCESS."
             )
             self.flag = True
         else:
             LogPrint().error(
                 "FAIL: ITC0201040201_test_UpdateCluster_host_cputype .Error-info INCORRECT."
             )
             self.flag = False
     else:
         LogPrint().error("FAIL: Returned status code '%s' is WRONG." %
                          r['status_code'])
         self.flag = False
     self.assertTrue(self.flag)
예제 #4
0
 def test_UpdateCluster_host(self):
     """
     @summary: 测试步骤
     @note: (1)
     @note: (2)
     """
     clusterapi = ClusterAPIs()
     LogPrint().info("Test: Edit cluster's name while there are hosts in cluster.")
     r = clusterapi.updateCluster(self.dm.cluster_name, self.dm.cluster_info_new)
     if r["status_code"] == self.dm.status_code:
         dict_actual = r["result"]
         dict_expected = xmltodict.parse(self.dm.cluster_info_new)
         dictCompare = DictCompare()
         if dictCompare.isSubsetDict(dict_expected, dict_actual):
             LogPrint().info("PASS: ITC0201040203_test_UpdateCluster_host_name SUCCESS.")
             self.flag = True
         else:
             LogPrint().error("FAIL: ITC0201040203_test_UpdateCluster_host_name. Error-info INCORRECT.")
             self.flag = False
     else:
         LogPrint().error("FAIL: ITC0201040203_test_UpdateCluster_host_name.Status_code is wrong. ")
         self.flag = False
     self.assertTrue(self.flag)
예제 #5
0
 def test_UpdateCluster_host(self):
     """
     @summary: 测试步骤
     @note: (1)
     @note: (2)
     """
     clusterapi = ClusterAPIs()
     LogPrint().info("Test: Improve cluster's CPU level while there are hosts in cluster.")
     r = clusterapi.updateCluster(self.dm.cluster_name, self.dm.cluster_info_new)
     if r["status_code"] == self.dm.status_code:
         dict_actual = r["result"]
         dict_expected = xmltodict.parse(self.dm.expected_info)
         dictCompare = DictCompare()
         if dictCompare.isSubsetDict(dict_expected, dict_actual):
             LogPrint().info("PASS: ITC0201040202_test_UpdateCluster_host_upcpu SUCCESS.")
             self.flag = True
         else:
             LogPrint().error("FAIL: ITC0201040202_test_UpdateCluster_host_upcpu. Error-info INCORRECT.")
             self.flag = False
     else:
         LogPrint().error("FAIL: Returned tatus_code '%s' is WRONG." % r["status_code"])
         self.flag = False
     self.assertTrue(self.flag)
예제 #6
0
 def test_UpdateCluster_host(self):
     """
     @summary: 测试步骤
     @note: (1)更改含有主机的集群CPU类型;
     @note: (2)操作成功,验证接口返回的状态码、相关信息是否正确。
     """
     clusterapi = ClusterAPIs()
     LogPrint().info("Test: Edit cluster's cpu type if there are hosts in this cluster.")
     r = clusterapi.updateCluster(self.dm.cluster_name, self.dm.cluster_info_new)
     if r["status_code"] == self.dm.status_code:
         dict_actual = r["result"]
         dict_expected = xmltodict.parse(self.dm.expected_info)
         dictCompare = DictCompare()
         if dictCompare.isSubsetDict(dict_expected, dict_actual):
             LogPrint().info("PASS: ITC0201040201_test_UpdateCluster_host_cputype SUCCESS.")
             self.flag = True
         else:
             LogPrint().error("FAIL: ITC0201040201_test_UpdateCluster_host_cputype .Error-info INCORRECT.")
             self.flag = False
     else:
         LogPrint().error("FAIL: Returned status code '%s' is WRONG." % r["status_code"])
         self.flag = False
     self.assertTrue(self.flag)