Example #1
0
def validate_scenario_setting(board_info, scenario_info):
    """
    This is validate the data setting from scenario xml
    :param board_info: it is a file what contains board information for script to read from
    :param scenario_info: it is a file what user have already setting to
    :return: return a dictionary contain errors
    """
    scenario_cfg_lib.ERR_LIST = {}
    common.BOARD_INFO_FILE = board_info
    common.SCENARIO_INFO_FILE = scenario_info

    scenario_info_items = {}
    vm_info = VmInfo(board_info, scenario_info)
    vm_info.get_info()
    vm_info.check_item()

    hv_info = HvInfo(scenario_info)
    hv_info.get_info()
    hv_info.check_item()

    scenario_info_items['vm'] = vm_info
    scenario_info_items['hv'] = hv_info

    scenario_cfg_lib.ERR_LIST.update(hv_cfg_lib.ERR_LIST)
    return (scenario_cfg_lib.ERR_LIST, scenario_info_items)
Example #2
0
def validate_scenario_setting(board_info, scenario_info):
    """
    Validate settings in scenario xml
    :param board_info: board file
    :param scenario_info: scenario file
    :return: return a dictionary that contains errors
    """
    hv_cfg_lib.ERR_LIST = {}
    scenario_cfg_lib.ERR_LIST = {}
    common.BOARD_INFO_FILE = board_info
    common.SCENARIO_INFO_FILE = scenario_info

    hv_info = HvInfo(scenario_info)
    hv_info.get_info()
    hv_info.check_item()

    scenario_info_items = {}
    vm_info = VmInfo(board_info, scenario_info)
    vm_info.get_info()
    vm_info.set_ivshmem(hv_info.mem.ivshmem_region)
    vm_info.check_item()

    scenario_info_items['vm'] = vm_info
    scenario_info_items['hv'] = hv_info

    scenario_cfg_lib.ERR_LIST.update(hv_cfg_lib.ERR_LIST)
    return (scenario_cfg_lib.ERR_LIST, scenario_info_items)