Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions tests/bgp/test_bgp_suppress_fib.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def get_port_connected_with_vm(duthost, nbrhosts, vm_type='T0'):
return port_list


def setup_vrf_cfg(duthost, cfg_facts, nbrhosts, tbinfo):
def setup_vrf_cfg(duthost, cfg_facts, nbrhosts, tbinfo, loganalyzer):
"""
Config vrf based configuration
"""
Expand Down Expand Up @@ -354,19 +354,19 @@ def setup_vrf_cfg(duthost, cfg_facts, nbrhosts, tbinfo):
duthost.template(src="bgp/vrf_config_db.j2", dest="/tmp/config_db_vrf.json")
duthost.shell("cp -f /tmp/config_db_vrf.json /etc/sonic/config_db.json")

config_reload(duthost, safe_reload=True)
config_reload(duthost, safe_reload=True, ignore_loganalyzer=loganalyzer)
wait_until(120, 10, 0, check_interface_status, duthost)


def setup_vrf(duthost, nbrhosts, tbinfo):
def setup_vrf(duthost, nbrhosts, tbinfo, loganalyzer):
"""
Prepare vrf based environment
"""
logger.info("Back up original config_db.json")
duthost.shell("mv /etc/sonic/config_db.json /etc/sonic/config_db.json.bak")

cfg_t1 = get_cfg_facts(duthost)
setup_vrf_cfg(duthost, cfg_t1, nbrhosts, tbinfo)
setup_vrf_cfg(duthost, cfg_t1, nbrhosts, tbinfo, loganalyzer)


def install_route_from_exabgp(operation, ptfip, route_list, port):
Expand Down Expand Up @@ -715,7 +715,7 @@ def do_and_wait_reboot(duthost, localhost, reboot_type):
)


def param_reboot(request, duthost, localhost):
def param_reboot(request, duthost, localhost, loganalyzer):
"""
Read reboot_type from option bgp_suppress_fib_reboot_type
If reboot_type is reload, do config reload
Expand All @@ -729,7 +729,7 @@ def param_reboot(request, duthost, localhost):
logger.info("Randomly choose {} from reload, cold, warm, fast".format(reboot_type))

if reboot_type == "reload":
config_reload(duthost, safe_reload=True)
config_reload(duthost, safe_reload=True, ignore_loganalyzer=loganalyzer)
wait_until(120, 10, 0, check_interface_status, duthost)
else:
do_and_wait_reboot(duthost, localhost, reboot_type)
Expand Down Expand Up @@ -822,15 +822,15 @@ def perf_sniffer_prepare(tcpdump_sniffer, duthost, nbrhosts, mg_facts, recv_port
@pytest.mark.parametrize("vrf_type", VRF_TYPES)
def test_bgp_route_with_suppress(duthost, tbinfo, nbrhosts, ptfadapter, localhost, restore_bgp_suppress_fib,
prepare_param, vrf_type, continuous_boot_times, generate_route_and_traffic_data,
request):
request, loganalyzer):
asic_name = duthost.get_asic_name()
if vrf_type == USER_DEFINED_VRF and asic_name == 'th5':
pytest.xfail("vrf testing not supported on TH5")

try:
if vrf_type == USER_DEFINED_VRF:
with allure.step("Configure user defined vrf"):
setup_vrf(duthost, nbrhosts, tbinfo)
setup_vrf(duthost, nbrhosts, tbinfo, loganalyzer)

with allure.step("Prepare needed parameters"):
router_mac, mg_facts, ptf_ip, exabgp_port_list, exabgp_port_list_v6, recv_port_list = prepare_param
Expand All @@ -852,7 +852,7 @@ def test_bgp_route_with_suppress(duthost, tbinfo, nbrhosts, ptfadapter, localhos
format(continous_boot_index+1))

with allure.step("Do reload"):
param_reboot(request, duthost, localhost)
param_reboot(request, duthost, localhost, loganalyzer)

for exabgp_port, exabgp_port_v6, recv_port in zip(exabgp_port_list, exabgp_port_list_v6, recv_port_list):
try:
Expand Down Expand Up @@ -906,7 +906,7 @@ def test_bgp_route_with_suppress(duthost, tbinfo, nbrhosts, ptfadapter, localhos
if vrf_type == USER_DEFINED_VRF:
with allure.step("Clean user defined vrf"):
duthost.shell("cp -f /etc/sonic/config_db.json.bak /etc/sonic/config_db.json")
config_reload(duthost, safe_reload=True)
config_reload(duthost, safe_reload=True, ignore_loganalyzer=loganalyzer)
wait_until(120, 10, 0, check_interface_status, duthost)


Expand Down
9 changes: 5 additions & 4 deletions tests/common/helpers/ptf_tests_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def filter(interface, neighbor, mg_facts, tbinfo):
return links


def apply_dscp_cfg_setup(duthost, dscp_mode):
def apply_dscp_cfg_setup(duthost, dscp_mode, loganalyzer):
"""
Applies the DSCP decap configuration to the DUT.

Expand Down Expand Up @@ -174,10 +174,11 @@ def apply_dscp_cfg_setup(duthost, dscp_mode):
logger.info("DSCP decap mode changed from {} to {} on asic {}".format(default_decap_mode, dscp_mode, asic_id))

logger.info("SETUP: Reload required for dscp decap mode changes to take effect.")
config_reload(duthost, safe_reload=True, check_intf_up_ports=True, wait_for_bgp=True)
config_reload(duthost, safe_reload=True, check_intf_up_ports=True, wait_for_bgp=True,
ignore_loganalyzer=loganalyzer)


def apply_dscp_cfg_teardown(duthost):
def apply_dscp_cfg_teardown(duthost, loganalyzer):
"""
Removes the previously applied DSCP decap configuration from the DUT.

Expand All @@ -200,7 +201,7 @@ def apply_dscp_cfg_teardown(duthost):

if reload_required:
logger.info("TEARDOWN: Reload required for dscp decap mode changes to take effect.")
config_reload(duthost, safe_reload=True)
config_reload(duthost, safe_reload=True, ignore_loganalyzer=loganalyzer)


def find_links(duthost, tbinfo, filter):
Expand Down
5 changes: 3 additions & 2 deletions tests/pc/test_lag_member_forwarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def build_pkt(dest_mac, ip_addr, ttl):
return pkt, exp_packet


def test_lag_member_forwarding_packets(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo, ptfadapter):
def test_lag_member_forwarding_packets(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo, ptfadapter,
loganalyzer):
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
mg_facts = duthost.get_extended_minigraph_facts(tbinfo)
lag_facts = duthost.lag_facts(host=duthost.hostname)['ansible_facts']['lag_facts']
Expand Down Expand Up @@ -205,4 +206,4 @@ def built_and_send_tcp_ip_packet(expected):
pytest.fail("BGP is still enable on lag disable member for neighbor {}", ip)
finally:
duthost.shell('rm -f {}'.format(lag_member_file_dir))
config_reload(duthost, config_source='config_db')
config_reload(duthost, config_source='config_db', ignore_loganalyzer=loganalyzer)
31 changes: 19 additions & 12 deletions tests/qos/test_qos_dscp_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ class TestQoSSaiDSCPQueueMapping_IPIP_Base():
def _setup_test_params(self,
duthost,
tbinfo,
downstream_links, # noqa F811
upstream_links, # noqa F811
decap_mode):
downstream_links, # noqa: F811
upstream_links, # noqa: F811
decap_mode,
loganalyzer):
"""
Set up test parameters for the DSCP to Queue mapping test for IP-IP packets.

Expand Down Expand Up @@ -188,7 +189,7 @@ def _setup_test_params(self,
dst_mac = duthost.facts["router_mac"]

# Setup DSCP decap config on DUT
apply_dscp_cfg_setup(duthost, decap_mode)
apply_dscp_cfg_setup(duthost, decap_mode, loganalyzer)

pytest_assert(downlink is not None, "No downlink found")
pytest_assert(uplink_ptf_ports is not None, "No uplink found")
Expand Down Expand Up @@ -346,35 +347,41 @@ def _run_test(self,

pytest_assert(not failed_once, "FAIL: Test failed. Please check table for details.")

def _teardown_test(self, duthost):
def _teardown_test(self, duthost, loganalyzer):
"""
Test teardown

Args:
duthost (AnsibleHost): The DUT host
"""
apply_dscp_cfg_teardown(duthost)
apply_dscp_cfg_teardown(duthost, loganalyzer)

def test_dscp_to_queue_mapping_pipe_mode(self, ptfadapter, rand_selected_dut,
toggle_all_simulator_ports_to_rand_selected_tor, # noqa F811
setup_standby_ports_on_rand_unselected_tor,
tbinfo, downstream_links, upstream_links, dut_qos_maps_module): # noqa F811
tbinfo,
downstream_links, upstream_links, dut_qos_maps_module, # noqa: F811
loganalyzer):
"""
Test QoS SAI DSCP to queue mapping for IP-IP packets in DSCP "pipe" mode
"""
duthost = rand_selected_dut
test_params = self._setup_test_params(duthost, tbinfo, downstream_links, upstream_links, "pipe")
test_params = self._setup_test_params(duthost, tbinfo, downstream_links, upstream_links, "pipe",
loganalyzer)
self._run_test(ptfadapter, duthost, tbinfo, test_params, dut_qos_maps_module, "pipe")
self._teardown_test(duthost)
self._teardown_test(duthost, loganalyzer)

def test_dscp_to_queue_mapping_uniform_mode(self, ptfadapter, rand_selected_dut,
toggle_all_simulator_ports_to_rand_selected_tor, # noqa F811
setup_standby_ports_on_rand_unselected_tor,
tbinfo, downstream_links, upstream_links, dut_qos_maps_module): # noqa F811
tbinfo,
downstream_links, upstream_links, dut_qos_maps_module, # noqa: F811
loganalyzer):
"""
Test QoS SAI DSCP to queue mapping for IP-IP packets in DSCP "uniform" mode
"""
duthost = rand_selected_dut
test_params = self._setup_test_params(duthost, tbinfo, downstream_links, upstream_links, "uniform")
test_params = self._setup_test_params(duthost, tbinfo, downstream_links, upstream_links, "uniform",
loganalyzer)
self._run_test(ptfadapter, duthost, tbinfo, test_params, dut_qos_maps_module, "uniform")
self._teardown_test(duthost)
self._teardown_test(duthost, loganalyzer)
7 changes: 4 additions & 3 deletions tests/qos/test_qos_sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,8 @@ def testQosSaiDscpToPgMapping(

@pytest.mark.parametrize("decap_mode", ["uniform", "pipe"])
def testIPIPQosSaiDscpToPgMapping(
self, duthost, ptfhost, dutTestParams, downstream_links, upstream_links, dut_qos_maps, decap_mode # noqa F811
self, duthost, ptfhost, dutTestParams, downstream_links, upstream_links, dut_qos_maps, decap_mode, # noqa: F811
loganalyzer
):
"""
Test QoS SAI DSCP to PG mapping ptf test
Expand All @@ -2086,7 +2087,7 @@ def testIPIPQosSaiDscpToPgMapping(
pytest.skip("Skip this test since separated DSCP_TO_TC_MAP is applied")

# Setup DSCP decap config on DUT
apply_dscp_cfg_setup(duthost, decap_mode)
apply_dscp_cfg_setup(duthost, decap_mode, loganalyzer)

loopback_ip = get_ipv4_loopback_ip(duthost)
downlink = select_random_link(downstream_links)
Expand Down Expand Up @@ -2128,7 +2129,7 @@ def testIPIPQosSaiDscpToPgMapping(
logger.info(tabulate(data, headers=headers))

# Teardown DSCP decap config on DUT
apply_dscp_cfg_teardown(duthost)
apply_dscp_cfg_teardown(duthost, loganalyzer)

if local_fail_logs:
pytest.fail("Test Failed: {}".format(local_fail_logs))
Expand Down
Loading