Exemple #1
0
def _teardown_testbed(dut, creds, ptf, test_params, tbinfo):
    """
        Tears down the testbed, returning it to its initial state.
    """
    logging.info("Restore PTF post COPP test")
    copp_utils.restore_ptf(ptf)

    logging.info("Restore COPP policer to default settings")
    copp_utils.restore_policer(dut, test_params.nn_target_namespace)

    if test_params.swap_syncd and not dut.is_multi_asic:
        logging.info("Restore default syncd docker...")
        docker.restore_default_syncd(dut, creds)
    else:
        copp_utils.restore_syncd(dut, test_params.nn_target_namespace)
        logging.info("Reloading config and restarting swss...")
        config_reload(dut)
Exemple #2
0
    def swapSyncd(self, request, duthost):
        """
            Swap syncd on DUT host

            Args:
                request (Fixture): pytest request object
                duthost (AnsibleHost): Device Under Test (DUT)

            Returns:
                None
        """
        swapSyncd = request.config.getoption("--qos_swap_syncd")
        if swapSyncd:
            docker.swap_syncd(duthost)

        yield

        if swapSyncd:
            docker.restore_default_syncd(duthost)
Exemple #3
0
def swapSyncd(request, duthosts, rand_one_dut_hostname, creds):
    """
        Swap syncd on DUT host

        Args:
            request (Fixture): pytest request object
            duthost (AnsibleHost): Device Under Test (DUT)

        Returns:
            None
    """
    duthost = duthosts[rand_one_dut_hostname]
    swapSyncd = request.config.getoption("--qos_swap_syncd")
    try:
        if swapSyncd:
            docker.swap_syncd(duthost, creds)

        yield
    finally:
        if swapSyncd:
            docker.restore_default_syncd(duthost, creds)
Exemple #4
0
def _teardown_testbed(dut, ptf, test_params):
    """
        Tears down the testbed, returning it to its initial state.
    """

    logging.info("Restore PTF post COPP test")
    copp_utils.restore_ptf(ptf)

    logging.info("Restore COPP policer to default settings")
    copp_utils.restore_policer(dut)

    if test_params.swap_syncd:
        logging.info("Restore default syncd docker...")
        docker.restore_default_syncd(dut)
    else:
        logging.info("Reloading config and restarting swss...")
        config_reload(dut)

    logging.info("Restore LLDP")
    dut.command("docker exec lldp supervisorctl start lldpd")
    dut.command("docker exec lldp supervisorctl start lldp-syncd")