示例#1
0
 def test_terminal(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     page.select_host_click_sub_menu(HOST_NAME)
     page.click_terminal_menu()
     try:
         self.driver.get_element("xpath",
                                 '//div[@id="terminal-container"]',
                                 timeout=30)
     except Exception as e:
         page.final_assert(e)
     else:
         page.final_assert(True)
示例#2
0
 def test_get_warn_log_list(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     page.select_host_click_sub_menu(HOST_NAME)
     page.click_warn_log_menu()
     try:
         self.driver.get_contains_text_element("th", "报警日志")
     except Exception as e:
         page.final_assert(e)
     else:
         page.final_assert(True)
示例#3
0
 def test_add_virtul_adapter(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     page.select_host_click_sub_menu(HOST_NAME)
     page.click_virtul_adapter_menu()
     page.click_sub_menu()
     page.click_add_menu()
     page.select_nic(VIRTUL_NIC_NAME_LIST)
     page.input_ipv4_addr(IPV4_ADDR)
     page.input_ipv4_subnet_mask(IPV4_SUBNET_MASK)
     page.select_nic_type(VIRTUL_NIC_TYPE)
     page.click_save()
     try:
         self.driver.get_text_element("div", "创建虚拟网卡成功")
     except Exception as e:
         page.final_assert(e)
     else:
         page.final_assert(True)
示例#4
0
 def test_del_virtul_adapter(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     page.select_host_click_sub_menu(HOST_NAME)
     page.click_virtul_adapter_menu()
     page.check_first_nic()
     page.click_sub_menu()
     page.click_del_menu()
     page.click_confirm_alert()
     try:
         self.driver.get_text_element("div", "删除虚拟网卡成功")
     except Exception as e:
         page.final_assert(e)
     else:
         page.final_assert(True)
示例#5
0
 def test_detail_host_resource(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     page.select_host_click_sub_menu(HOST_NAME)
     page.click_detail_menu()
     try:
         self.driver.get_text_element("div", "概要")
     except Exception as e:
         page.final_assert(e)
     else:
         page.final_assert(True)
示例#6
0
    def test_nic_discern(self):

        page = HostResourcePage(self.driver)
        page.into_host_resource()
        page.select_host_click_sub_menu(HOST_NAME)
        page.click_physical_adapter_menu()
        page.check_first_nic()
        page.click_nic_discern()

        try:
            self.driver.get_text_element("div", "网卡识别成功。")
        except Exception as e:
            page.final_assert(e)
        else:
            page.final_assert(True)
示例#7
0
 def test_batch_del_host_resource(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     for hostname in HOST_NAME_LIST:
         page.select_host(hostname)
     page.click_sub_menu()
     page.click_del_menu()
     page.click_confirm_alert()
     page.assert_result(action='del')
示例#8
0
 def test_del_single_host_resource(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     page.select_host_click_sub_menu(HOST_NAME)
     page.click_del_menu()
     page.click_confirm_alert()
     page.assert_result(action='del')
示例#9
0
 def test_update_single_host_resource(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     page.select_host_click_sub_menu(HOST_NAME)
     page.click_update_menu()
     page.input_hostname(hostname=NEW_HOST_NAME, clear=True)
     page.select_vpool(pool_name=NEW_POOL_NAME)
     page.select_host_type(host_type_name=NEW_HOST_TYPE_NAME)
     page.click_save()
     page.assert_result(action='update')
示例#10
0
 def test_batch_add_host_resource(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     page.click_sub_menu()
     page.click_add_menu(batch=True)
     page.select_vpool(POOL_NAME)
     page.select_host_type(HOST_TYPE_NAME)
     page.input_start_and_end_ip(start_ip=START_IP_ADDR, end_ip=END_IP_ADDR)
     page.click_scan()
     page.click_save()
     page.assert_result(action='batch_add')
示例#11
0
 def test_add_single_host_resource(self):
     page = HostResourcePage(self.driver)
     page.into_host_resource()
     page.click_sub_menu()
     page.click_add_menu()
     page.input_ip_addr(IP_ADDR)
     page.input_hostname(HOST_NAME)
     page.select_vpool(POOL_NAME)
     page.select_host_type(HOST_TYPE_NAME)
     page.click_save()
     page.assert_result(action='add')