Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
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)
Exemple #4
0
def get_testbed_vars():
    """
    returns the testbed variables in a dictionary
    :return: testbed variables dictionary
    :rtype: dict
    """
    return getwa().get_testbed_vars()
Exemple #5
0
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()
Exemple #6
0
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()
Exemple #7
0
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)
Exemple #8
0
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)
Exemple #9
0
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)
Exemple #10
0
def clear_config(dut):
    """
    todo: Update Documentation
    :param dut:
    :type dut:
    :return:
    :rtype:
    """
    return getwa().clear_config(dut)
Exemple #11
0
def disable_console_debug_msgs(dut):
    """
    todo: Update Documentation
    :param dut:
    :type dut:
    :return:
    :rtype:
    """
    return getwa().enable_disable_console_debug_msgs(dut, False)
Exemple #12
0
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)
Exemple #13
0
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)
Exemple #14
0
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)
Exemple #15
0
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)
Exemple #16
0
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)
Exemple #17
0
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)
Exemple #18
0
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)
Exemple #19
0
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)
Exemple #20
0
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)
Exemple #21
0
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)
Exemple #22
0
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)
Exemple #23
0
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)
Exemple #24
0
def apply_json2(dut, json):
    return getwa().apply_json2(dut, json)
Exemple #25
0
def apply_script(dut, cmdlist):
    return getwa().apply_script(dut, cmdlist)
Exemple #26
0
def report_config_fail(msgid, *args):
    getwa().report_config_fail(msgid, *args)
Exemple #27
0
def report_unsupported(msgid, *args):
    getwa().report_unsupported(msgid, *args)
Exemple #28
0
def report_tgen_fail(msgid, *args):
    getwa().report_tgen_fail(msgid, *args)
Exemple #29
0
def debug(msg):
    getwa().debug(msg)
Exemple #30
0
def dump_all_commands(dut, type='click'):
    return getwa().dump_all_commands(dut, type)