def banner(msg, width=80, delimiter="#", wrap=True, tnl=True, lnl=True, dut=None): getwa().banner(msg, width, delimiter, wrap, tnl=tnl, lnl=lnl, dut=dut)
def report_fail(msgid, *args): """ Infrastructure API used by test scripts to report fail :param msgid: message identifier from /messages/*.yaml files :param args: arguments required in message identifier specification :return: """ getwa().report_fail(msgid, *args)
def report_env_fail(msgid, *args): """ Infrastructure API generally used with in framework to report test failure because of environment issue :param msgid: message identifier from /messages/*.yaml files :param args: arguments required in message identifier specification :return: """ getwa().report_env_fail(msgid, *args)
def get_testbed_vars(): """ returns the testbed variables in a dictionary :return: testbed variables dictionary :rtype: dict """ return getwa().get_testbed_vars()
def get_tg_names(): """ This method is used to get all the TG names :return: names of all the tg :rtype: list """ return getwa().get_tg_names()
def get_dut_names(): """ This method is used to get all the DUT names :return: names of all the duts :rtype: list """ return getwa().get_dut_names()
def cli_config(dut, cmd, mode=None, skip_error_check=False, delay_factor=0, **kwargs): return getwa().cli_config(dut, cmd, mode, skip_error_check, delay_factor, **kwargs)
def cli_show(dut, cmd, mode=None, skip_tmpl=False, skip_error_check=False, **kwargs): return getwa().cli_show(dut, cmd, mode, skip_tmpl, skip_error_check, **kwargs)
def exec_ssh_remote_dut(dut, ipaddress, username, password, command=None, timeout=30): return getwa().exec_ssh_remote_dut(dut, ipaddress, username, password, command, timeout)
def clear_config(dut): """ todo: Update Documentation :param dut: :type dut: :return: :rtype: """ return getwa().clear_config(dut)
def disable_console_debug_msgs(dut): """ todo: Update Documentation :param dut: :type dut: :return: :rtype: """ return getwa().enable_disable_console_debug_msgs(dut, False)
def get_all_ports(dut): """ This method gets all the ports that are not reserved :param dut: device under test :type dut: :return: all the free ports :rtype: list """ return getwa().get_all_ports(dut)
def reboot(dut, method="normal", skip_port_wait=False, skip_exception=False, skip_fallback=False, ret_logs=False): if method == "warm" and not is_feature_supported("warm-reboot"): return "" if ret_logs else True return getwa().reboot(dut, method, skip_port_wait, skip_exception, skip_fallback, ret_logs)
def ensure_min_topology(*args): """ verifies if the current testbed topology satifies the minimum topology required by test script :param spec: needed topology specification :type spec: basestring :return: True if current topology is good enough else False :rtype: bool """ return getwa().ensure_min_topology(*args)
def lock_topology(*args): """ locks the topology to specified specification though current testbed topology has more than specified :param spec: needed topology specification :type spec: basestring :return: True if the operation is successful else False :rtype: bool """ return getwa().lock_topology(*args)
def get_free_ports(dut): """ This method gets all the ports that are not connected to either partner DUT or Traffic Generator :param dut: device under test :type dut: :return: all the free ports :rtype: list """ return getwa().get_free_ports(dut)
def config_db_reload(dut, save=False): """ todo: Update Documentation :param dut: :type dut: :param save: :type save: :return: :rtype: """ return getwa().config_db_reload(dut, save)
def get_service_info(dut, name): """ todo: Update Documentation :param name: :type name: :param dut: :type dut: :return: :rtype: """ return getwa().get_service_info(dut, name)
def do_rps(dut, op, on_delay=None, off_delay=None, recon=True): """ This method performs the RPS operations such as on/off/reset. RPS models supported are Raritan, ServerTech, Avocent and all are through telnet. The RPS information is obtained from the testbed file. :param op: operation i.e. on/off/reset :param dut: DUT identifier :type dut: basestring :return: True if the operation is successful else False """ return getwa().do_rps(dut, op, on_delay, off_delay, recon)
def run_script_with_timeout(dut, timeout, script_path, *args): """ todo: Update Documentation :param dut: :type dut: :param timeout: in secs :type timeout: :param script_path: :type script_path: :return: :rtype: """ return getwa().run_script(dut, timeout, script_path, *args)
def rest_send(dut, api='', method='get', params=None, data=None, retAs='json', **kwargs): return getwa().rest_send(dut, method=method, api=api, params=params, data=data, retAs=retAs, **kwargs)
def reboot(dut, method="normal", skip_port_wait=False, skip_exception=False, skip_fallback=False): """ todo: Update Documentation :param dut: :type dut: :return: :rtype: """ return getwa().reboot(dut, method, skip_port_wait, skip_exception, skip_fallback)
def upgrade_image(dut, url, skip_reboot=False, port_break=True, port_speed=True): """ Upgrade the software in the given DUT from given URL :param dut: :type dut: :param url: URL string used to upgrade :type url: String :param skip_reboot: Flag to avoid rebooting device after upgrade :type url: boolean (default False) :return: :rtype: """ return getwa().upgrade_image(dut, url, skip_reboot, port_break, port_speed)
def apply_json2(dut, json): return getwa().apply_json2(dut, json)
def apply_script(dut, cmdlist): return getwa().apply_script(dut, cmdlist)
def report_config_fail(msgid, *args): getwa().report_config_fail(msgid, *args)
def report_unsupported(msgid, *args): getwa().report_unsupported(msgid, *args)
def report_tgen_fail(msgid, *args): getwa().report_tgen_fail(msgid, *args)
def debug(msg): getwa().debug(msg)
def dump_all_commands(dut, type='click'): return getwa().dump_all_commands(dut, type)