def get_scenario_item_values(board_info, scenario_info): """ Get items which capable multi select for user :param board_info: it is a file what contains board information for script to read from """ scenario_item_values = {} hw_info = HwInfo(board_info) # get vm count scenario_cfg_lib.SCENARIO_INFO_FILE = scenario_info scenario_cfg_lib.BOARD_INFO_FILE = board_info scenario_cfg_lib.VM_COUNT = scenario_cfg_lib.get_vm_num(scenario_info) # pre scenario guest_flags = copy.deepcopy(scenario_cfg_lib.GUEST_FLAG) guest_flags.remove('0UL') scenario_item_values["vm,vcpu_affinity"] = hw_info.get_processor_val() scenario_item_values["vm,guest_flags"] = guest_flags scenario_item_values["vm,clos"] = hw_info.get_clos_val() scenario_item_values["vm,os_config,kern_type"] = scenario_cfg_lib.KERN_TYPE_LIST scenario_item_values.update(scenario_cfg_lib.avl_vuart_ui_select(scenario_info)) # pre board_private scenario_item_values["vm,board_private,rootfs"] = scenario_cfg_lib.get_rootdev_info(board_info) scenario_item_values["vm,board_private,console"] = scenario_cfg_lib.get_ttys_info(board_info) # os config scenario_item_values["vm,os_config,rootfs"] = scenario_cfg_lib.get_rootdev_info(board_info) return scenario_item_values
def __init__(self, board_file, scenario_file): self.board_info = board_file self.scenario_info = scenario_file scenario_cfg_lib.VM_COUNT = scenario_cfg_lib.get_vm_num(self.scenario_info) self.epc_section = EpcSection(self.scenario_info) self.mem_info = MemInfo(self.scenario_info) self.os_cfg = CfgOsKern(self.scenario_info) self.vuart = VuartInfo(self.scenario_info) self.cfg_pci = CfgPci(self.scenario_info)