def startup(): info_print_report("FC-IOR mix nicfc: startup") # get the pfs from configuration file fc_pf_1 = ctiutils.cti_getvar("PF_A") fc_pf_2 = ctiutils.cti_getvar("PF_B") # get the root domain and io domain from configuration file nprd1_name = ctiutils.cti_getvar("NPRD_A") nprd1_password = ctiutils.cti_getvar("NPRD_A_PASSWORD") nprd2_name = ctiutils.cti_getvar("NPRD_B") nprd2_password = ctiutils.cti_getvar("NPRD_B_PASSWORD") iod_name = ctiutils.cti_getvar("IOD") iod_password = ctiutils.cti_getvar("IOD_PASSWORD") # get the nic pfs related variables in configuration file nic_pf_1 = ctiutils.cti_getvar("NIC_PF_A") nic_pf_2 = ctiutils.cti_getvar("NIC_PF_B") subnet = ctiutils.cti_getvar("VF_SUBNET") # get remote host variables in configuration file remote_nic_link = ctiutils.cti_getvar("REMOTE_NIC_LINK") remote_host = ctiutils.cti_getvar("NIC_REMOTE_HOST") remote_password = ctiutils.cti_getvar("NIC_REMOTE_HOST_PASSWORD") # check the mix_test flag has been set mix_test_flag = ctiutils.cti_getvar("MIX_TEST") nic_switch_connection = ctiutils.cti_getvar("NIC_SWITCH_CONNECTION") if mix_test_flag != "yes": error_print_report("If want to test mix_nicfc case, be ensure to " "define MIX_TEST=yes in test_config file") ctiutils.cti_deleteall("Not supported") return 1 if nic_switch_connection != "yes": error_print_report("If want to test mix_nicfc case, be ensure " "to connect all NIC cards to the network " "switch and define NIC_SWITCH_CONNECTION=yes" "in test_config file") ctiutils.cti_deleteall("Not supported") return 1 # check whether remote pf has been connected to switch and # could be pingable from local test system info_print_report("Checking all NIC pfs have been connected to switch ") remote_host_dict = {remote_host: {"password": remote_password, "link": remote_nic_link}} root_dict = {nprd1_name: {"password": nprd1_password, "pf": nic_pf_1}, nprd2_name: {"password": nprd2_password, "pf": nic_pf_2}} try: check_nic_pf_be_connected(remote_host_dict, root_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Not all nic pfs have been connected to switch") return 1 else: info_print_report("All nic pfs have been connected to switch") # check the fc pf whether has created vf, if yes,destroyed fc_pf_list = [fc_pf_1, fc_pf_2] for pf_item in fc_pf_list: info_print_report("Checking PF [%s] whether has created vf" % pf_item) if check_whether_pf_has_created_vf(pf_item): info_print_report( "VF has been created on PF [%s], trying to destroy..." % pf_item) try: destroy_all_vfs_on_pf(pf_item) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to destroy all the vfs created on the PF [%s]" % pf_item) return 1 else: info_print_report( "Destroy all the vfs created on PF [%s]" % pf_item) else: info_print_report( "No vf has been created on the PF [%s]" % pf_item) time.sleep(3) # check the nic pf whether has created vf, if yes,destroyed nic_pf_list = [nic_pf_1, nic_pf_2] for pf_item in nic_pf_list: info_print_report("Checking PF [%s] whether has created vf" % pf_item) if check_whether_pf_has_created_vf(pf_item): info_print_report( "VF has been created on PF [%s], trying to destroy..." % pf_item) try: destroy_all_nic_vfs_on_pf(iod_name, iod_password, pf_item) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to destroy all the vfs created on the PF [%s]" % pf_item) return 1 else: info_print_report( "Destroy all the vfs created on PF [%s]" % pf_item) else: info_print_report( "No vf has been created on the PF [%s]" % pf_item) time.sleep(3) # create fc vfs by manually assign port-wwn and node-wwn a_port_wwn_0 = ctiutils.cti_getvar("PORT_WWN_PF_A_VF0") a_node_wwn_0 = ctiutils.cti_getvar("NODE_WWN_PF_A_VF0") try: info_print_report("Creating vf on PF [%s]" % fc_pf_1) a_vf = create_vf_in_manual_mode(fc_pf_1, a_port_wwn_0, a_node_wwn_0) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % fc_pf_1) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (a_vf, fc_pf_1)) time.sleep(30) b_port_wwn_0 = ctiutils.cti_getvar("PORT_WWN_PF_B_VF0") b_node_wwn_0 = ctiutils.cti_getvar("NODE_WWN_PF_B_VF0") try: info_print_report("Creating vf on PF [%s]" % fc_pf_2) b_vf = create_vf_in_manual_mode(fc_pf_2, b_port_wwn_0, b_node_wwn_0) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % fc_pf_2) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (b_vf, fc_pf_2)) time.sleep(30) # create nic vfs on two pfs try: info_print_report("Creating vf on PF [%s]" % nic_pf_1) nic_a_vf = create_nic_vf(nprd1_name, nprd1_password, nic_pf_1) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % nic_pf_1) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (nic_a_vf, nic_pf_1)) time.sleep(30) try: info_print_report("Creating vf on PF [%s]" % nic_pf_2) nic_b_vf = create_nic_vf(nprd2_name, nprd2_password, nic_pf_2) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % nic_pf_2) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (nic_b_vf, nic_pf_2)) time.sleep(30) # allocate vfs to the io domain vfs_list = [a_vf, b_vf, nic_a_vf, nic_b_vf] for vf in vfs_list: try: info_print_report( "Allocating vf [%s] to io domain [%s]" % (vf, iod_name)) assign_vf_to_domain(vf, iod_name) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to assign the vf [%s] to domain [%s] " % (vf, iod_name)) return 1 else: info_print_report( "VF [%s] has been allocated to io domain [%s]" % (vf, iod_name)) time.sleep(5) # reboot io domain try: info_print_report( "Rebooting io domain [%s] after allocated vfs ..." % iod_name) reboot_domain(iod_name, iod_password) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to reboot io domain [%s]" % iod_name) return 1 # configure nic vfs ipmp in io domain info_print_report( "Configuring NIC vf interfaces to be IPMP in io domain [%s]" % iod_name) ipmp = 'ior_ipmp0' ip_addr = subnet + '.11.1' try: configure_nic_vfs_ipmp_in_domain( iod_name, iod_password, ipmp, nic_a_vf, nic_b_vf, ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to configure nic vfs interface" " to be IPMP io domain [%s]" % iod_name) return 1 else: info_print_report("Configured done") # configure remote interface to be pingable from ipmp in io domain info_print_report("Configuring interface in remote host") rmt_ip_addr = subnet + '.11.2' try: configure_nic_ip_in_remote( remote_host, remote_password, remote_nic_link, rmt_ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to configure pf ip address " "on remote host [%s]" % remote_host) return 1 else: info_print_report("Configured done") # check whether remote interface can be pingable from io domain info_print_report("Checking remote interface is pingable from [%s]" % iod_name) try: check_remote_pingable_from_io_domain( iod_name, iod_password, rmt_ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to get remote host be pingable " "from io domain [%s]" % iod_name) return 1 else: info_print_report("Done") # fc io workload operate info_print_report( "Checking the FC io workload file whether exists in io domain [%s]" % iod_name) if check_io_workload_exists(iod_name, iod_password): info_print_report( "FC io workload file alerady exists in io domain [%s]" % iod_name) else: info_print_report( "FC io workload file doesn't exist in io domain [%s]" % iod_name) try: info_print_report( "Distributing the FC io workload file to io domain [%s]" % iod_name) distribute_io_workload_files_to_domain(iod_name, iod_password) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to distribute FC io workload to io domain [%s]" % iod_name) return 1 try: info_print_report( "Run FC io workload on VF [%s] in io domain [%s]" % (a_vf, iod_name)) run_io_workload_on_vf_in_domain(iod_name, iod_password, a_vf) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to run FC io workload on [%s] in io domain [%s]" % (a_vf, iod_name)) return 1 # run io traffic on ipmp interface, io traffic is just ping. try: info_print_report( "Run traffic between remote interface and " "ipmp group in io domain [%s]" % iod_name) run_ping_traffic_in_domain(iod_name, iod_password, ip_addr, rmt_ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to run traffic between remote interface" " and ipmp in io domain [%s]" % iod_name) return 1 # Get the test vfs info dict iod_info_dict = {"name": iod_name, "password": iod_password} fc_pf_1_vfs_dict = {} fc_pf_2_vfs_dict = {} nic_pf_1_vfs_dict = {} nic_pf_2_vfs_dict = {} fc_pf_1_vfs_dict.update({a_vf: iod_name}) fc_pf_2_vfs_dict.update({b_vf: iod_name}) nic_pf_1_vfs_dict.update({nic_a_vf: iod_name}) nic_pf_2_vfs_dict.update({nic_b_vf: iod_name}) all_vfs_dict = { nprd1_name: { fc_pf_1: fc_pf_1_vfs_dict, nic_pf_1: nic_pf_1_vfs_dict }, nprd2_name: { fc_pf_2: fc_pf_2_vfs_dict, nic_pf_2: nic_pf_2_vfs_dict } } try: info_print_report( "Getting all vfs information...") get_all_vfs_info(iod_info_dict, all_vfs_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to get all vfs information") return 1 else: info_print_report("Done") return 0
def startup(): info_print_report("FC-IOR functional test05: startup") pf_1 = ctiutils.cti_getvar("PF_A") pf_2 = ctiutils.cti_getvar("PF_B") # get the root domain and io domain from configuration file nprd1_name = ctiutils.cti_getvar("NPRD_A") nprd2_name = ctiutils.cti_getvar("NPRD_B") iod_name = ctiutils.cti_getvar("IOD") iod_password = ctiutils.cti_getvar("IOD_PASSWORD") # check the pf whether has created vf, if yes,destroyed pf_list = [pf_1, pf_2] for pf_item in pf_list: info_print_report("Checking PF [%s] whether has created vf" % pf_item) if check_whether_pf_has_created_vf(pf_item): info_print_report( "VF has been created on PF [%s], trying to destroy..." % pf_item) try: destroy_all_vfs_on_pf(pf_item) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to destroy all the vfs created on the PF [%s]" % pf_item) return 1 else: info_print_report("Destroy all the vfs created on PF [%s]" % pf_item) else: info_print_report("No vf has been created on the PF [%s]" % pf_item) time.sleep(3) # create vf by manually assign port-wwn and node-wwn a_port_wwn_0 = ctiutils.cti_getvar("PORT_WWN_PF_A_VF0") a_node_wwn_0 = ctiutils.cti_getvar("NODE_WWN_PF_A_VF0") try: info_print_report("Creating vf on PF [%s]" % pf_1) a_vf = create_vf_in_manual_mode(pf_1, a_port_wwn_0, a_node_wwn_0) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_1) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (a_vf, pf_1)) time.sleep(30) b_port_wwn_0 = ctiutils.cti_getvar("PORT_WWN_PF_B_VF0") b_node_wwn_0 = ctiutils.cti_getvar("NODE_WWN_PF_B_VF0") try: info_print_report("Creating vf on PF [%s]" % pf_2) b_vf = create_vf_in_manual_mode(pf_2, b_port_wwn_0, b_node_wwn_0) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_2) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (b_vf, pf_2)) time.sleep(30) # allocate vfs to the io domain vfs_list = [a_vf, b_vf] for vf in vfs_list: try: info_print_report("Allocating vf [%s] to io domain [%s]" % (vf, iod_name)) assign_vf_to_domain(vf, iod_name) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to assign the vf [%s] to domain [%s] " % (vf, iod_name)) return 1 else: info_print_report("VF [%s] has been allocated to io domain [%s]" % (vf, iod_name)) time.sleep(5) # reboot io domain try: info_print_report("Rebooting io domain [%s] after allocated vfs ..." % iod_name) reboot_domain(iod_name, iod_password) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to reboot io domain [%s]" % iod_name) return 1 # io workload operate info_print_report( "Checking the io workload file whether exists in io domain [%s]" % iod_name) if check_io_workload_exists(iod_name, iod_password): info_print_report("IO workload file alerady exists in io domain [%s]" % iod_name) else: info_print_report("IO workload file doesn't exist in io domain [%s]" % iod_name) try: info_print_report( "Trying to distribute the io workload file to io domain [%s]" % iod_name) distribute_io_workload_files_to_domain(iod_name, iod_password) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to distribute io workload to io domain [%s]" % iod_name) return 1 try: info_print_report("Run I/O workload on VF [%s] in io domain [%s]" % (a_vf, iod_name)) run_io_workload_on_vf_in_domain(iod_name, iod_password, a_vf) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to run io workload on [%s] in io domain [%s]" % (a_vf, iod_name)) return 1 # Get the test vfs info dict a_vfs_list = [a_vf] b_vfs_list = [b_vf] iod_info_dict = {"name": iod_name, "password": iod_password} pf_1_vfs_dict = {} pf_2_vfs_dict = {} for vf in a_vfs_list: pf_1_vfs_dict.update({vf: iod_name}) for vf in b_vfs_list: pf_2_vfs_dict.update({vf: iod_name}) all_vfs_dict = { nprd1_name: { pf_1: pf_1_vfs_dict }, nprd2_name: { pf_2: pf_2_vfs_dict } } try: info_print_report("Getting all vfs information...") get_all_vfs_info(iod_info_dict, all_vfs_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to add test vfs information") return 1 else: info_print_report("Done") return 0
def startup(): info_print_report("FC-IOR functional test03: startup") pf = ctiutils.cti_getvar("PF_A") nprd_name = ctiutils.cti_getvar("NPRD_A") nprd_password = ctiutils.cti_getvar("NPRD_A_PASSWORD") iod_name = ctiutils.cti_getvar("IOD") iod_password = ctiutils.cti_getvar("IOD_PASSWORD") # check the pf whether has created vf, if yes,destroyed info_print_report("Checking PF [%s] whether has created vf" % pf) if check_whether_pf_has_created_vf(pf): info_print_report( "VF has been created on PF [%s], trying to destroy..." % pf) try: destroy_all_vfs_on_pf(pf) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to destroy all the vfs created on the PF [%s]" % pf) return 1 else: info_print_report("Destroyed all the vfs created on PF [%s]" % pf) else: info_print_report("No vf has been created on the PF [%s]" % pf) time.sleep(5) # create vfs on pf vfs_list = [] info_print_report("Creating vf on PF [%s]" % pf) for i in range(0, 2): port_wwn = os.getenv("PORT_WWN_PF_A_VF{0}".format(i)) node_wwn = os.getenv("NODE_WWN_PF_A_VF{0}".format(i)) try: vf = create_vf_in_manual_mode(pf, port_wwn, node_wwn) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf) return 1 else: info_print("Created vf [%s] on pf [%s]" % (vf, pf)) vfs_list.append(vf) time.sleep(30) # allocate vfs to the io domain for vf in vfs_list: try: info_print_report("Allocating vf [%s] to io domain [%s]" % (vf, iod_name)) assign_vf_to_domain(vf, iod_name) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to assign the vf [%s] to domain [%s] " % (vf, iod_name)) return 1 else: info_print_report("VF [%s] has been allocated to io domain [%s]" % (vf, iod_name)) time.sleep(30) # reboot io domain try: info_print_report("Rebooting io domain [%s] after allocated vfs ..." % iod_name) reboot_domain(iod_name, iod_password) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to reboot io domain [%s]" % iod_name) return 1 # vf opreate try: info_print_report("Do offline vf [%s] in io domain [%s]" % (vfs_list[1], iod_name)) offline_vf_in_domain(iod_name, iod_password, vfs_list[1]) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to offline vf [%s] in io domain [%s]" % (vfs_list[1], iod_name)) return 1 else: info_print_report("Offline vf [%s] in io domain [%s] success" % (vfs_list[1], iod_name)) time.sleep(5) # Get the test vfs info dict iod_info_dict = {"name": iod_name, "password": iod_password} pf_vfs_dict = {} for vf in vfs_list: pf_vfs_dict.update({vf: iod_name}) all_vfs_dict = { nprd_name: { pf: pf_vfs_dict, } } try: info_print_report("Getting all vfs information...") get_all_vfs_info(iod_info_dict, all_vfs_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to add test vfs information") return 1 else: info_print_report("Done") return 0
def startup(): info_print_report("FC-IOR stress multidom: startup") pf_1 = ctiutils.cti_getvar("PF_A") pf_2 = ctiutils.cti_getvar("PF_B") # get the root domain and io domain from configuration file nprd1_name = ctiutils.cti_getvar("NPRD_A") nprd2_name = ctiutils.cti_getvar("NPRD_B") iod_name = ctiutils.cti_getvar("IOD") iod_password = ctiutils.cti_getvar("IOD_PASSWORD") # check the pf whether has created vf, if yes,destroyed pf_list = [pf_1, pf_2] for pf_item in pf_list: info_print_report("Checking PF [%s] whether has created vf" % pf_item) if check_whether_pf_has_created_vf(pf_item): info_print_report( "VF has been created on PF [%s], trying to destroy..." % pf_item) try: destroy_all_vfs_on_pf(pf_item) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to destroy all the vfs created on the PF [%s]" % pf_item) return 1 else: info_print_report( "Destroy all the vfs created on PF [%s] done" % pf_item) else: info_print_report("No vf has been created on the PF [%s]" % pf_item) time.sleep(5) # before create the other test io domains, check the vdbench files whether # exists try: info_print_report( "Checking vdbench file whether exists in io domain [%s]" % iod_name) check_vdbench_exists(iod_name, iod_password) except Exception as e: error_print_report("Vdbench file doesn't exist in io domain [%s], " "please refer to 'Distribute vdbench' in README " % iod_name) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Vdbench file doesn't exist in io domain [%s]" % iod_name) return 1 else: info_print_report("Vdbench file already exists in io domain [%s]" % iod_name) # create the other created io domains by cloning the io domain above maxvf_num_1 = int(get_pf_maxvf_number(pf_1)) maxvf_num_2 = int(get_pf_maxvf_number(pf_2)) if maxvf_num_2 > maxvf_num_1: support_maxvf_num = maxvf_num_1 else: support_maxvf_num = maxvf_num_2 iods_list = [] for i in range(1, support_maxvf_num): iod_name_new = ctiutils.cti_getvar("IOD_{0}".format(i)) iods_list.append(iod_name_new) iod_volume_list = [] try: info_print_report("Trying to snapshot io domain [%s]" % iod_name) iod_volume_list = get_volume_of_domain(iod_name) if len(iod_volume_list) > 1: error_print_report( "IO domain [%s] has more than one volume, cancel snapshot" % iod_name) ctiutils.cti_deleteall("IO domain [%s] has more than one volume" % iod_name) return 1 else: iod_volume = iod_volume_list[0] iod_volume_snapshot = snapshot_volume(iod_volume) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to snapshot io domain [%s]" % iod_name) return 1 else: info_print_report("Snapshot Done") for creating_iod in iods_list: try: info_print_report("Trying to create io domain [%s]" % creating_iod) create_domain_by_clone_snapshot(iod_volume_snapshot, creating_iod) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to create io domain [%s]" % creating_iod) return 1 else: info_print_report("Create Done") # wait the created io domains to boot up info_print_report("Waitting all the new created io domains to boot up...") time.sleep(360) for creating_iod in iods_list: try: check_domain_boot_up(creating_iod, iod_password) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "IO domain [%s] is not up and not able to login" % creating_iod) return 1 info_print_report("All the created io domains are up and be able to test") # create vf by manually assign port-wwn and node-wwn a_vfs_list = [] info_print_report("Creating vf on PF [%s]" % pf_1) for i in range(0, 3): port_wwn = ctiutils.cti_getvar("PORT_WWN_PF_A_VF{0}".format(i)) node_wwn = ctiutils.cti_getvar("NODE_WWN_PF_A_VF{0}".format(i)) try: vf = create_vf_in_manual_mode(pf_1, port_wwn, node_wwn) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_1) return 1 else: info_print("Created [%s] done" % vf) a_vfs_list.append(vf) time.sleep(10) for i in range(3, support_maxvf_num): try: vf = create_vf_in_dynamic_mode(pf_1) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_1) return 1 else: info_print("Created [%s] done" % vf) a_vfs_list.append(vf) time.sleep(10) b_vfs_list = [] info_print_report("Creating vf on PF [%s]" % pf_2) for i in range(0, 3): port_wwn = ctiutils.cti_getvar("PORT_WWN_PF_B_VF{0}".format(i)) node_wwn = ctiutils.cti_getvar("NODE_WWN_PF_B_VF{0}".format(i)) try: vf = create_vf_in_manual_mode(pf_2, port_wwn, node_wwn) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_2) return 1 else: info_print_report("Created [%s] done" % vf) b_vfs_list.append(vf) time.sleep(10) for i in range(3, support_maxvf_num): try: vf = create_vf_in_dynamic_mode(pf_2) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_2) return 1 else: info_print_report("Created [%s] done" % vf) b_vfs_list.append(vf) time.sleep(10) # allocate vfs to the io domain iods_list = [iod_name] for i in range(1, support_maxvf_num): iods_list.append(ctiutils.cti_getvar("IOD_{0}".format(i))) a_vfs_iod_dict = {} b_vfs_iod_dict = {} for i in range(0, support_maxvf_num): a_vf = a_vfs_list[i] assigned_iod_name = iods_list[i] try: info_print_report("Allocating vf [%s] to io domain [%s]" % (a_vf, assigned_iod_name)) assign_vf_to_domain(a_vf, assigned_iod_name) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to assign the vf [%s] to domain [%s] " % (a_vf, assigned_iod_name)) return 1 else: info_print_report("VF [%s] has been allocated to io domain [%s]" % (a_vf, assigned_iod_name)) a_vfs_iod_dict.update({a_vf: assigned_iod_name}) time.sleep(3) b_vf = b_vfs_list[i] try: info_print_report("Allocating vf [%s] to io domain [%s]" % (b_vf, assigned_iod_name)) assign_vf_to_domain(b_vf, assigned_iod_name) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to assign the vf [%s] to domain [%s] " % (b_vf, assigned_iod_name)) return 1 else: info_print_report("VF [%s] has been allocated to io domain [%s]" % (b_vf, assigned_iod_name)) b_vfs_iod_dict.update({b_vf: assigned_iod_name}) time.sleep(3) # reboot all io domains threads_list = [] for rebooting_iod in iods_list: thread_rebooting_iod = threading.Thread(target=reboot_domain, args=(rebooting_iod, iod_password)) threads_list.append(thread_rebooting_iod) info_print_report("Rebooting all io domains after allocated vfs ...") for thread_rebooting_iod in threads_list: thread_rebooting_iod.start() for thread_rebooting_iod in threads_list: thread_rebooting_iod.join() for rebooting_iod in iods_list: try: check_domain_boot_up(rebooting_iod, iod_password) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "IO domain [%s] is not up and not able to login" % rebooting_iod) return 1 # io workload operate for i in range(0, 3): info_print_report("Run vdbench in io domain [%s]..." % iods_list[i]) try: run_vdbench_on_vf_in_domain(iods_list[i], iod_password, a_vfs_list[i]) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) else: info_print_report("Done") time.sleep(5) # Get the test vfs info dict iod_info_dict = {"name": iod_name, "password": iod_password} pf_1_vfs_dict = {} for vf, affiliated_iod in a_vfs_iod_dict.items(): pf_1_vfs_dict.update({vf: affiliated_iod}) pf_2_vfs_dict = {} for vf, affiliated_iod in b_vfs_iod_dict.items(): pf_2_vfs_dict.update({vf: affiliated_iod}) test_vfs_dict = { nprd1_name: { pf_1: pf_1_vfs_dict }, nprd2_name: { pf_2: pf_2_vfs_dict } } try: info_print_report("Getting all vfs information...") get_all_vfs_info(iod_info_dict, test_vfs_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed") return 1 else: info_print_report("Done") return 0
def startup(): info_print_report("FC-IOR functional test01: startup") pf_1 = ctiutils.cti_getvar("PF_A") pf_3 = get_pf_another_port(pf_1) # get the root domain and io domain from configuration file nprd_name = ctiutils.cti_getvar("NPRD_A") iod_name = ctiutils.cti_getvar("IOD") iod_password = ctiutils.cti_getvar("IOD_PASSWORD") all_vfs_info_xml = ctiutils.cti_getvar("VFS_INFO") # check the pf whether has created vf, if yes,destroyed for pf in [pf_1, pf_3]: info_print_report("Checking PF [%s] whether has created vf" % pf) if check_whether_pf_has_created_vf(pf): info_print_report( "VF has been created on PF [%s], trying to destroy..." % pf) try: destroy_all_vfs_on_pf(pf) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to destroy all the vfs created on the PF [%s]" % pf) return 1 else: info_print_report( "Destroyed all the vfs created on PF [%s]" % pf) else: info_print_report("No vf has been created on PF [%s]" % pf) time.sleep(5) # create vf on pf_1 and pf_3 vfs_list = [] pf_1_vfs_list = [] info_print_report("Creating vf on PF [%s]" % pf_1) for i in range(0, 2): port_wwn = os.getenv("PORT_WWN_PF_A_VF{0}".format(i)) node_wwn = os.getenv("NODE_WWN_PF_A_VF{0}".format(i)) try: vf = create_vf_in_manual_mode(pf_1, port_wwn, node_wwn) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to create vf on the PF [%s]" % pf_1) return 1 else: info_print("Created vf [%s] on pf [%s]" % (vf, pf_1)) vfs_list.append(vf) pf_1_vfs_list.append(vf) time.sleep(30) pf_3_vfs_list = [] info_print_report("Creating vf on PF [%s]" % pf_3) for i in range(0, 2): try: vf = create_vf_in_dynamic_mode(pf_3) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to create vf on the PF [%s]" % pf_3) return 1 else: info_print("Created vf [%s] on pf [%s]" % (vf, pf_3)) pf_3_vfs_list.append(vf) vfs_list.append(vf) time.sleep(30) # allocate vfs to io domain for vf in vfs_list: try: info_print_report( "Allocating vf [%s] to io domain [%s]" % (vf, iod_name)) assign_vf_to_domain(vf, iod_name) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to assign the vf [%s] to domain [%s] " % (vf, iod_name)) return 1 else: info_print_report( "VF [%s] has been allocated to io domain [%s]" % (vf, iod_name)) time.sleep(5) # reboot io domain try: info_print_report( "Rebooting io domain [%s] after allocated vfs ..." % iod_name) reboot_domain(iod_name, iod_password) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to reboot io domain [%s]" % iod_name) return 1 # Get the test vfs info dict iod_info_dict = {"name": iod_name, "password": iod_password} pf_1_vfs_dict = {} for vf in pf_1_vfs_list: pf_1_vfs_dict.update({vf: iod_name}) pf_3_vfs_dict = {} for vf in pf_3_vfs_list: pf_3_vfs_dict.update({vf: iod_name}) all_vfs_dict = { nprd_name: { pf_1: pf_1_vfs_dict, pf_3: pf_3_vfs_dict } } try: info_print_report( "Getting all vfs information...") get_all_vfs_info(iod_info_dict, all_vfs_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to add test vfs information") return 1 else: info_print_report("Done") return 0
def startup(): info_print_report("FC-IOR stress maxvf: startup") pf_1 = ctiutils.cti_getvar("PF_A") pf_2 = ctiutils.cti_getvar("PF_B") # get the root domain and io domain from configuration file nprd1_name = ctiutils.cti_getvar("NPRD_A") nprd2_name = ctiutils.cti_getvar("NPRD_B") iod_name = ctiutils.cti_getvar("IOD") iod_password = ctiutils.cti_getvar("IOD_PASSWORD") # check vdbench whether exists in io domain try: info_print_report( "Checking vdbench file whether exists in io domain [%s]" % iod_name) check_vdbench_exists(iod_name, iod_password) except Exception as e: error_print_report("Vdbench file doesn't exist in io domain [%s], " "please refer to 'Distribute vdbench' in README " % iod_name) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Vdbench file doesn't exist in io domain [%s]" % iod_name) return 1 else: info_print_report("Vdbench file already exists in io domain [%s]" % iod_name) # check the pf whether has created vf, if yes,destroyed pf_list = [pf_1, pf_2] for pf_item in pf_list: info_print_report("Checking PF [%s] whether has created vf" % pf_item) if check_whether_pf_has_created_vf(pf_item): info_print_report( "VF has been created on PF [%s], trying to destroy..." % pf_item) try: destroy_all_vfs_on_pf(pf_item) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to destroy all the vfs created on the PF [%s]" % pf_item) return 1 else: info_print_report( "Destroy all the vfs created on PF [%s] done" % pf_item) else: info_print_report("No vf has been created on the PF [%s]" % pf_item) time.sleep(3) # create vf by manually assign port-wwn and node-wwn maxvf_num_1 = int(get_pf_maxvf_number(pf_1)) vfs_list = [] a_vfs_list = [] info_print_report("Creating vf on PF [%s]" % pf_1) for i in range(0, 3): port_wwn = ctiutils.cti_getvar("PORT_WWN_PF_A_VF{0}".format(i)) node_wwn = ctiutils.cti_getvar("NODE_WWN_PF_A_VF{0}".format(i)) try: vf = create_vf_in_manual_mode(pf_1, port_wwn, node_wwn) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_1) return 1 else: info_print("Created vf [%s] on pf [%s]" % (vf, pf_1)) vfs_list.append(vf) a_vfs_list.append(vf) time.sleep(10) for i in range(3, maxvf_num_1): try: vf = create_vf_in_dynamic_mode(pf_1) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_1) return 1 else: info_print("Created vf [%s] on pf [%s]" % (vf, pf_1)) vfs_list.append(vf) a_vfs_list.append(vf) time.sleep(10) maxvf_num_2 = int(get_pf_maxvf_number(pf_2)) b_vfs_list = [] info_print_report("Creating vf on PF [%s]" % pf_2) for i in range(0, 3): port_wwn = ctiutils.cti_getvar("PORT_WWN_PF_B_VF{0}".format(i)) node_wwn = ctiutils.cti_getvar("NODE_WWN_PF_B_VF{0}".format(i)) try: vf = create_vf_in_manual_mode(pf_2, port_wwn, node_wwn) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_2) return 1 else: info_print("Created vf [%s] on pf [%s]" % (vf, pf_2)) vfs_list.append(vf) b_vfs_list.append(vf) time.sleep(10) for i in range(3, maxvf_num_2): try: vf = create_vf_in_dynamic_mode(pf_2) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % pf_2) return 1 else: info_print("Created vf [%s] on pf [%s]" % (vf, pf_2)) vfs_list.append(vf) b_vfs_list.append(vf) time.sleep(10) # allocate vfs to the io domain for vf in vfs_list: try: info_print_report("Allocating vf [%s] to io domain [%s]" % (vf, iod_name)) assign_vf_to_domain(vf, iod_name) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to assign the vf [%s] to domain [%s] " % (vf, iod_name)) return 1 else: info_print_report("VF [%s] has been allocated to io domain [%s]" % (vf, iod_name)) time.sleep(3) # reboot io domain try: info_print_report("Rebooting io domain [%s] after allocated vfs ..." % iod_name) reboot_domain(iod_name, iod_password) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall("Failed to reboot io domain [%s]" % iod_name) return 1 # io workload operate for i in range(0, 3): try: info_print_report("Run vdbench on VF [%s] in io domain [%s]" % (vfs_list[i], iod_name)) run_vdbench_on_vf_in_domain(iod_name, iod_password, vfs_list[i]) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to run vdbench on [%s] in io domain [%s]" % (vfs_list[i], iod_name)) return 1 else: info_print_report("Run vdbench on [%s] in io domain [%s] success" % (vfs_list[i], iod_name)) # Get the test vfs info dict iod_info_dict = {"name": iod_name, "password": iod_password} pf_1_vfs_dict = {} pf_2_vfs_dict = {} for vf in a_vfs_list: pf_1_vfs_dict.update({vf: iod_name}) for vf in b_vfs_list: pf_2_vfs_dict.update({vf: iod_name}) all_vfs_dict = { nprd1_name: { pf_1: pf_1_vfs_dict }, nprd2_name: { pf_2: pf_2_vfs_dict } } try: info_print_report("Getting all vfs information...") get_all_vfs_info(iod_info_dict, all_vfs_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to add all vfs information") return 1 else: info_print_report("Done") return 0
def startup(): info_print_report("FC-IOR mix nicib: startup") # get the root domain and io domain from configuration file nprd1_name = ctiutils.cti_getvar("NPRD_A") nprd1_password = ctiutils.cti_getvar("NPRD_A_PASSWORD") nprd2_name = ctiutils.cti_getvar("NPRD_B") nprd2_password = ctiutils.cti_getvar("NPRD_B_PASSWORD") iod_name = ctiutils.cti_getvar("IOD") iod_password = ctiutils.cti_getvar("IOD_PASSWORD") # get the nic and ib pfs related variables in configuration file nic_pf_1 = ctiutils.cti_getvar("NIC_PF_A") nic_pf_2 = ctiutils.cti_getvar("NIC_PF_B") ib_pf_1 = ctiutils.cti_getvar("IB_PF_A") ib_pf_2 = ctiutils.cti_getvar("IB_PF_B") subnet = ctiutils.cti_getvar("VF_SUBNET") # get remote host variables in configuration file remote_nic_link = ctiutils.cti_getvar("REMOTE_NIC_LINK") nic_remote_host = ctiutils.cti_getvar("NIC_REMOTE_HOST") nic_remote_password = ctiutils.cti_getvar("NIC_REMOTE_HOST_PASSWORD") remote_ib_link = ctiutils.cti_getvar("REMOTE_IB_LINK") ib_remote_host = ctiutils.cti_getvar("IB_REMOTE_HOST") ib_remote_password = ctiutils.cti_getvar("IB_REMOTE_HOST_PASSWORD") # check the mix_test flag has been set mix_test_flag = ctiutils.cti_getvar("MIX_TEST") nic_switch_connection = ctiutils.cti_getvar("NIC_SWITCH_CONNECTION") ib_switch_connection = ctiutils.cti_getvar("IB_SWITCH_CONNECTION") if mix_test_flag != "yes": error_print_report("If want to test mix_nicfc case, be ensure to " "define MIX_TEST=yes in test_config file") ctiutils.cti_deleteall("Not supported") return 1 if nic_switch_connection != "yes" or ib_switch_connection != "yes": error_print_report("If want to test mix_nicib case, be ensure to " "connect all NIC and IB cards to the related " "switches. Meanwhile, define " "NIC_SWITCH_CONNECTION=yes, " "IB_SWITCH_CONNECTION=yes in test_config file") ctiutils.cti_deleteall("Not supported") return 1 # check whether remote nic pf has been connected to switch and # could be pingable from local test system info_print_report("Checking all nic pfs have been " "connected to switch") remote_host_dict = {nic_remote_host: {"password": nic_remote_password, "link": remote_nic_link}} root_dict = {nprd1_name: {"password": nprd1_password, "pf": nic_pf_1}, nprd2_name: {"password": nprd2_password, "pf": nic_pf_2}} try: check_nic_pf_be_connected(remote_host_dict, root_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Not all nic pfs are connected to switch") return 1 else: info_print_report("All nic pfs are connected to switch") # check whether remote ib pf has been connected to switch and # could be pingable from local test system info_print_report("Checking all ib pfs have been " "connected to switch") ib_remote_host_dict = {ib_remote_host: {"password": ib_remote_password, "link": remote_ib_link}} root_dict = {nprd1_name: {"password": nprd1_password, "pf": ib_pf_1}, nprd2_name: {"password": nprd2_password, "pf": ib_pf_2}} try: check_ib_pf_be_connected(ib_remote_host_dict, root_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Not all IB pfs are connected to switch") return 1 else: info_print_report("All IB pfs are connected to switch") # check ib ior has been enabled in io domain info_print_report("Checking ib ior has been enabled in [%s]" % iod_name) try: check_ib_ior_enabled_in_iod(iod_name, iod_password) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("IB ior has not been enabled in " "[%s]" % iod_name) return 1 else: info_print_report("IB ior has been enabled in [%s]" % iod_name) # check the nic pf whether has created vf, if yes,destroyed nic_pf_list = [nic_pf_1, nic_pf_2] for pf_item in nic_pf_list: info_print_report("Checking PF [%s] whether has created vf" % pf_item) if check_whether_pf_has_created_vf(pf_item): info_print_report( "VF has been created on PF [%s], trying to destroy..." % pf_item) try: destroy_all_nic_vfs_on_pf(iod_name, iod_password, pf_item) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to destroy all the vfs created on the PF [%s]" % pf_item) return 1 else: info_print_report( "Destroy all the vfs created on PF [%s]" % pf_item) else: info_print_report( "No vf has been created on the PF [%s]" % pf_item) time.sleep(3) # check the ib pf whether has created vf, if yes,destroyed ib_pf_list = [ib_pf_1, ib_pf_2] for pf_item in ib_pf_list: info_print_report("Checking PF [%s] whether has created vf" % pf_item) if check_whether_pf_has_created_vf(pf_item): info_print_report( "VF has been created on PF [%s], trying to destroy..." % pf_item) try: destroy_all_ib_vfs_on_pf(iod_name, iod_password, pf_item) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to destroy all the vfs created on the PF [%s]" % pf_item) return 1 else: info_print_report( "Destroy all the vfs created on PF [%s]" % pf_item) else: info_print_report( "No vf has been created on the PF [%s]" % pf_item) time.sleep(3) # create nic vfs on two pfs try: info_print_report("Creating vf on PF [%s]" % nic_pf_1) nic_a_vf = create_nic_vf(nprd1_name, nprd1_password, nic_pf_1) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % nic_pf_1) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (nic_a_vf, nic_pf_1)) time.sleep(30) try: info_print_report("Creating vf on PF [%s]" % nic_pf_2) nic_b_vf = create_nic_vf(nprd2_name, nprd2_password, nic_pf_2) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % nic_pf_2) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (nic_b_vf, nic_pf_2)) time.sleep(30) # create ib vfs on two pfs try: info_print_report("Creating vf on PF [%s]" % ib_pf_1) ib_a_vf = create_ib_vf(ib_pf_1) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % ib_pf_1) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (ib_a_vf, ib_pf_1)) time.sleep(30) try: info_print_report("Creating vf on PF [%s]" % ib_pf_2) ib_b_vf = create_ib_vf(ib_pf_2) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to create vf on the PF [%s]" % ib_pf_2) return 1 else: info_print_report("Created vf [%s] on pf [%s]" % (ib_b_vf, ib_pf_2)) time.sleep(30) # allocate vfs to the io domain vfs_list = [nic_a_vf, nic_b_vf, ib_a_vf, ib_b_vf] for vf in vfs_list: try: info_print_report( "Allocating vf [%s] to io domain [%s]" % (vf, iod_name)) assign_vf_to_domain(vf, iod_name) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall( "Failed to assign the vf [%s] to domain [%s] " % (vf, iod_name)) return 1 else: info_print_report( "VF [%s] has been allocated to io domain [%s]" % (vf, iod_name)) time.sleep(5) # reboot io domain try: info_print_report( "Rebooting io domain [%s] after allocated vfs ..." % iod_name) reboot_domain(iod_name, iod_password) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to reboot io domain [%s]" % iod_name) return 1 # configure nic vfs ipmp in io domain info_print_report( "Configuring the corresponding nic interfaces to be " "IPMP in io domain [%s]" % iod_name) ipmp = 'ior_ipmp0' ip_addr = subnet + '.11.1' try: configure_nic_vfs_ipmp_in_domain( iod_name, iod_password, ipmp, nic_a_vf, nic_b_vf, ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to configure nic vfs interface" " to be IPMP io domain [%s]" % iod_name) return 1 else: info_print_report("Configured done") # configure remote nic interface to be pingable from nic ipmp in io domain info_print_report("Configuring NIC interface in remote host") rmt_ip_addr = subnet + '.11.2' try: configure_nic_ip_in_remote( nic_remote_host, nic_remote_password, remote_nic_link, rmt_ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to configure nic interface " "on remote host [%s]" % nic_remote_host) return 1 else: info_print_report("Configured done") # check whether remote interface can be pingable from io domain info_print_report("Checking remote interface is pingable from [%s]" % iod_name) try: check_remote_pingable_from_io_domain( iod_name, iod_password, rmt_ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to get remote nic interface be " "pingable from io domain [%s]" % iod_name) return 1 else: info_print_report("Done") # configure IB vfs ipmp in io domain info_print_report( "Configuring the corresponding IB links to be " "IPMP in io domain [%s]" % iod_name) ipmp = 'ior_ipmp1' ib_ip_addr = subnet + '.12.1' try: configure_ib_vfs_ipmp_in_domain( iod_name, iod_password, ipmp, ib_a_vf, ib_b_vf, ib_ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to configure IB vfs links" " to be IPMP io domain [%s]" % iod_name) return 1 else: info_print_report("Configured done") # configure remote IB link to be pingable from ib ipmp in io domain info_print_report("Configuring IB link in remote host") rmt_ib_ip_addr = subnet + '.12.2' try: configure_ib_ip_in_remote( ib_remote_host, ib_remote_password, remote_ib_link, rmt_ib_ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to configure IB link " "on remote host [%s]" % ib_remote_host) return 1 else: info_print_report("Configured done") # check whether remote ib link can be pingable from io domain info_print_report("Checking remote ib link is pingable from [%s]" % iod_name) try: check_remote_pingable_from_io_domain( iod_name, iod_password, rmt_ip_addr) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to get remote ib link be pingable " "from io domain [%s]" % iod_name) return 1 else: info_print_report("Done") # run io traffic on ib ipmp interface, io traffic is just ping. try: info_print_report( "Run traffic between remote interface and " "ipmp group in io domain [%s]" % iod_name) run_ping_traffic_in_domain( iod_name, iod_password, ib_ip_addr, rmt_ib_ip_addr) except Exception as e: error_print_report(e) error_report(traceback.print_exc()) ctiutils.cti_deleteall( "Failed to run traffic between remote ib link" " and ib ipmp in io domain [%s]" % iod_name) return 1 # Get the test vfs info dict iod_info_dict = {"name": iod_name, "password": iod_password} nic_pf_1_vfs_dict = {} nic_pf_2_vfs_dict = {} nic_pf_1_vfs_dict.update({nic_a_vf: iod_name}) nic_pf_2_vfs_dict.update({nic_b_vf: iod_name}) ib_pf_1_vfs_dict = {} ib_pf_2_vfs_dict = {} ib_pf_1_vfs_dict.update({ib_a_vf: iod_name}) ib_pf_2_vfs_dict.update({ib_b_vf: iod_name}) all_vfs_dict = { nprd1_name: { nic_pf_1: nic_pf_1_vfs_dict, ib_pf_2: ib_pf_1_vfs_dict }, nprd2_name: { nic_pf_2: nic_pf_2_vfs_dict, ib_pf_2: ib_pf_2_vfs_dict } } try: info_print_report( "Getting all vfs information...") get_all_vfs_info(iod_info_dict, all_vfs_dict) except Exception as e: error_print_report(e) error_report(ctiutils.cti_traceback()) ctiutils.cti_deleteall("Failed to get all vfs information") return 1 else: info_print_report("Done") return 0