Exemple #1
0
 def get_rootdev_val(self):
     """
     Get root devices from board info
     :return: root devices list
     """
     self.root_dev_val = scenario_cfg_lib.get_rootdev_info(self.board_info)
     return self.root_dev_val
Exemple #2
0
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,severity"] = scenario_cfg_lib.VM_SEVERITY
    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