def _setup_testbed(dut, creds, ptf, test_params, tbinfo): """ Sets up the testbed to run the COPP tests. """ logging.info("Set up the PTF for COPP tests") copp_utils.configure_ptf(ptf, test_params.nn_target_port) logging.info("Update the rate limit for the COPP policer") copp_utils.limit_policer(dut, _TEST_RATE_LIMIT, test_params.nn_target_namespace) # Multi-asic will not support this mode as of now. if test_params.swap_syncd and not dut.is_multi_asic: logging.info("Swap out syncd to use RPC image...") docker.swap_syncd(dut, creds) else: # Set sysctl RCVBUF parameter for tests dut.command("sysctl -w net.core.rmem_max=609430500") # Set sysctl SENDBUF parameter for tests dut.command("sysctl -w net.core.wmem_max=609430500") # NOTE: Even if the rpc syncd image is already installed, we need to restart # SWSS for the COPP changes to take effect. logging.info("Reloading config and restarting swss...") config_reload(dut) logging.info("Configure syncd RPC for testing") copp_utils.configure_syncd(dut, test_params.nn_target_port, test_params.nn_target_interface, test_params.nn_target_namespace, creds)
def _setup_testbed(dut, ptf, test_params): """ Sets up the testbed to run the COPP tests. """ logging.info("Disable LLDP for COPP tests") dut.command("docker exec lldp supervisorctl stop lldp-syncd") dut.command("docker exec lldp supervisorctl stop lldpd") logging.info("Set up the PTF for COPP tests") copp_utils.configure_ptf(ptf, test_params.nn_target_port) logging.info("Update the rate limit for the COPP policer") copp_utils.limit_policer(dut, _TEST_RATE_LIMIT) if test_params.swap_syncd: logging.info("Swap out syncd to use RPC image...") docker.swap_syncd(dut) else: # NOTE: Even if the rpc syncd image is already installed, we need to restart # SWSS for the COPP changes to take effect. logging.info("Reloading config and restarting swss...") config_reload(dut) logging.info("Configure syncd RPC for testing") copp_utils.configure_syncd(dut, test_params.nn_target_port)
def _setup_testbed(dut, creds, ptf, test_params, tbinfo): """ Sets up the testbed to run the COPP tests. """ mg_facts = dut.get_extended_minigraph_facts(tbinfo) is_backend_topology = mg_facts.get(constants.IS_BACKEND_TOPOLOGY_KEY, False) logging.info("Set up the PTF for COPP tests") copp_utils.configure_ptf(ptf, test_params, is_backend_topology) logging.info("Update the rate limit for the COPP policer") copp_utils.limit_policer(dut, _TEST_RATE_LIMIT, test_params.nn_target_namespace) # Multi-asic will not support this mode as of now. if test_params.swap_syncd and not dut.is_multi_asic: logging.info("Swap out syncd to use RPC image...") docker.swap_syncd(dut, creds) else: # Set sysctl RCVBUF parameter for tests dut.command("sysctl -w net.core.rmem_max=609430500") # Set sysctl SENDBUF parameter for tests dut.command("sysctl -w net.core.wmem_max=609430500") # NOTE: Even if the rpc syncd image is already installed, we need to restart # SWSS for the COPP changes to take effect. logging.info("Reloading config and restarting swss...") config_reload(dut, safe_reload=True, check_intf_up_ports=True) logging.info("Configure syncd RPC for testing") copp_utils.configure_syncd(dut, test_params.nn_target_port, test_params.nn_target_interface, test_params.nn_target_namespace, test_params.nn_target_vlanid, creds)