Skip to content
Draft
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
70 changes: 67 additions & 3 deletions tests/common/plugins/conditional_mark/tests_mark_conditions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3969,12 +3969,12 @@ override_config_table/test_override_config_table.py::test_load_minigraph_with_go
########################################
packet_trimming:
skip:
reason: "Packet trimming is not supported on 202505. Packet trimming cases require PR https://github.com/sonic-net/sonic-buildimage/pull/22869, but KVM does not support it, so skip trimming case on KVM. Packet-trimming tests are only supported on certain Mellanox SN5640 and Arista 7060X6 SKUs."
reason: "Packet trimming is not supported on 202505. Packet trimming cases require PR https://github.com/sonic-net/sonic-buildimage/pull/22869, but KVM does not support it, so skip trimming case on KVM. Packet-trimming tests are only supported on certain Mellanox SN5640 and Arista 7060X6 SKUs. On sonic-vpp (asic_type 'vpp') the symmetric core trimming cases are enabled; deferred cases are skipped per-test (tracking sonic-net/sonic-buildimage#25789)."
conditions_logical_operator: or
conditions:
- "release in ['202505']"
- "asic_type in ['vs']"
- "hwsku not in ['Arista-7060X6-64PE-B-C448O16', 'Arista-7060X6-64PE-B-C512S2', 'Mellanox-SN5640-C448O16', 'Mellanox-SN5640-C512S2']"
- "hwsku not in ['Arista-7060X6-64PE-B-C448O16', 'Arista-7060X6-64PE-B-C512S2', 'Mellanox-SN5640-C448O16', 'Mellanox-SN5640-C512S2'] and asic_type != 'vpp'"
xfail:
reason: "Test case has issue on the t0-isolated-d256u256s2 topo."
conditions:
Expand All @@ -3994,16 +3994,80 @@ packet_trimming/test_packet_trimming_asymmetric.py::TestPacketTrimmingAsymmetric

packet_trimming/test_packet_trimming_symmetric.py::TestPacketTrimmingSymmetric::test_trimming_counters_with_feature_toggle:
skip:
reason: "TH5 clears trim counters when packet trimming is turned off, skipping until trim counter persistance is supported."
reason: "TH5 clears trim counters when packet trimming is turned off, skipping until trim counter persistance is supported. Trim counters are also deferred on sonic-vpp (tracking sonic-net/sonic-buildimage#25789)."
conditions_logical_operator: or
conditions:
- "asic_gen in ['th5']"
- "asic_type in ['vpp']"

packet_trimming/test_packet_trimming_symmetric.py::TestPacketTrimmingSymmetric::test_trimming_with_srv6:
skip:
reason: "SRv6 with packet trimming is deferred on sonic-vpp; the SRv6 trim path is not yet implemented in the VPP dataplane (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"
xfail:
reason: "vlan decap is disabled in 202412 image"
conditions:
- "'isolated' in topo_name and release in ['202412']"

#################################################
## sonic-vpp: deferred packet_trimming cases ##
## (symmetric core cases run; see HLD §13/§14) ##
#################################################
packet_trimming/test_packet_trimming_asymmetric.py:
skip:
reason: "Asymmetric (per-port DSCP) packet trimming is deferred on sonic-vpp; only symmetric core trimming is enabled (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"

packet_trimming/test_packet_trimming_config_asymmetric.py:
skip:
reason: "Asymmetric (FROM_TC) packet-trimming GCU config validation is deferred on sonic-vpp; only symmetric core trimming is enabled (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"

packet_trimming/test_packet_trimming_config_symmetric.py:
skip:
reason: "Symmetric packet-trimming GCU config validation is deferred on sonic-vpp; out of scope for the initial dataplane enablement (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"

packet_trimming/test_packet_trimming_symmetric.py::TestPacketTrimmingSymmetric::test_acl_action_with_trimming:
skip:
reason: "ACL DISABLE_TRIM action with packet trimming is deferred on sonic-vpp; not yet implemented in the VPP dataplane (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"

packet_trimming/test_packet_trimming_symmetric.py::TestPacketTrimmingSymmetric::test_stability_during_feature_toggles:
skip:
reason: "Feature-toggle stability with packet trimming is deferred on sonic-vpp; not yet validated (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"

packet_trimming/test_packet_trimming_symmetric.py::TestPacketTrimmingSymmetric::test_trimming_during_port_admin_toggle:
skip:
reason: "Port admin-toggle with packet trimming is deferred on sonic-vpp; not yet validated (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"

packet_trimming/test_packet_trimming_symmetric.py::TestPacketTrimmingSymmetric::test_trimming_with_reload_and_reboot:
skip:
reason: "Reload/reboot persistence of packet trimming is deferred on sonic-vpp; config persistence not yet validated (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"

packet_trimming/test_packet_trimming_symmetric.py::TestPacketTrimmingSymmetric::test_trimming_counters:
skip:
reason: "Trim counters are deferred on sonic-vpp; trim drop/sent counters are not yet implemented (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"

packet_trimming/test_packet_trimming_symmetric.py::TestPacketTrimmingSymmetric::test_port_mirror_with_trimming:
skip:
reason: "Port mirroring with packet trimming is deferred on sonic-vpp; the mirror trim path is not yet implemented (tracking sonic-net/sonic-buildimage#25789)."
conditions:
- "asic_type in ['vpp']"

#######################################
##### pc #####
#######################################
Expand Down
49 changes: 41 additions & 8 deletions tests/packet_trimming/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
configure_tc_to_dscp_map, set_buffer_profile_for_block_queue, set_buffer_profile_for_trim_queue,
create_blocking_scheduler, configure_trimming_action, cleanup_trimming_acl, get_queue_id_by_dscp,
get_test_ports, create_trim_queue_test_buffer_profile, delete_trim_queue_test_buffer_profile,
delete_buffer_queue_for_trim_queue,
delete_buffer_queue_for_block_queue, delete_created_block_queue_buffer_profiles,
is_queue_level_trim_sent_drop_supported)


Expand Down Expand Up @@ -184,6 +186,12 @@ def setup_trimming(duthost, test_params, trim_counter_params, request):
logger.info("Prepare packet trimming related configurations")
platform = duthost.facts['platform']

# Track the blocking-queue buffer config this fixture adds so teardown can
# remove exactly what it created. On platforms whose base config already
# defines these profiles nothing is created and nothing is torn down.
created_block_profiles = set()
block_queue_bindings = []

with allure.step("Backup configuration"):
logger.info("Backup configuration before trimming test")
duthost.shell("sudo config save -y /etc/sonic/config_db_before_trimming_test.json")
Expand All @@ -209,10 +217,14 @@ def setup_trimming(duthost, test_params, trim_counter_params, request):
counter_uplink_port = trim_counter_params['egress_ports'][0]
counter_block_interface = counter_uplink_port['dut_members']
logger.info(f"Apply uplink buffer profile to interfaces: {block_interface}")
set_buffer_profile_for_block_queue(duthost, block_interface, test_params['block_queue'],
test_params['trim_buffer_profiles']['uplink'])
set_buffer_profile_for_block_queue(duthost, counter_block_interface, trim_counter_params['block_queue'],
trim_counter_params['trim_buffer_profiles']['uplink'])
created_block_profiles.add(
set_buffer_profile_for_block_queue(duthost, block_interface, test_params['block_queue'],
test_params['trim_buffer_profiles']['uplink']))
block_queue_bindings.append((block_interface, test_params['block_queue']))
created_block_profiles.add(
set_buffer_profile_for_block_queue(duthost, counter_block_interface, trim_counter_params['block_queue'],
trim_counter_params['trim_buffer_profiles']['uplink']))
block_queue_bindings.append((counter_block_interface, trim_counter_params['block_queue']))
create_trim_queue_test_buffer_profile(duthost)
set_buffer_profile_for_trim_queue(duthost, block_interface)

Expand All @@ -221,8 +233,10 @@ def setup_trimming(duthost, test_params, trim_counter_params, request):
downlink_port = test_params['egress_ports'][1]
block_interface = downlink_port['dut_members']
logger.info(f"Apply downlink buffer profile to {block_interface}:{test_params['block_queue']}")
set_buffer_profile_for_block_queue(duthost, block_interface, test_params['block_queue'],
test_params['trim_buffer_profiles']['downlink'])
created_block_profiles.add(
set_buffer_profile_for_block_queue(duthost, block_interface, test_params['block_queue'],
test_params['trim_buffer_profiles']['downlink']))
block_queue_bindings.append((block_interface, test_params['block_queue']))
set_buffer_profile_for_trim_queue(duthost, block_interface)

# Also set the downlink buffer profile for the block queue used in counter tests, if applicable.
Expand All @@ -231,8 +245,10 @@ def setup_trimming(duthost, test_params, trim_counter_params, request):
counter_block_interface = counter_downlink_port['dut_members']
logger.info(f"Apply downlink buffer profile to "
f"{counter_block_interface}:{trim_counter_params['block_queue']}")
set_buffer_profile_for_block_queue(duthost, counter_block_interface, trim_counter_params['block_queue'],
trim_counter_params['trim_buffer_profiles']['downlink'])
created_block_profiles.add(
set_buffer_profile_for_block_queue(duthost, counter_block_interface, trim_counter_params['block_queue'],
trim_counter_params['trim_buffer_profiles']['downlink']))
block_queue_bindings.append((counter_block_interface, trim_counter_params['block_queue']))

with allure.step("Create scheduler used for blocking egress queues"):
create_blocking_scheduler(duthost)
Expand All @@ -256,6 +272,23 @@ def setup_trimming(duthost, test_params, trim_counter_params, request):
for buffer_profile in trim_counter_params['trim_buffer_profiles']:
configure_trimming_action(duthost, trim_counter_params['trim_buffer_profiles'][buffer_profile], "off")

with allure.step("Remove trim queue buffer profile references"):
# config load merges the backup and does not delete BUFFER_QUEUE keys added on
# platforms whose base config lacks them (e.g. VPP). Clear them before deleting
# the profile so teardown does not leave a dangling BUFFER_QUEUE -> BUFFER_PROFILE
# leafref that fails post-test YANG validation.
delete_buffer_queue_for_trim_queue(duthost, test_params['egress_ports'][0]['dut_members'])
if len(test_params['egress_ports']) > 1:
delete_buffer_queue_for_trim_queue(duthost, test_params['egress_ports'][1]['dut_members'])

with allure.step("Remove blocking-queue buffer config added during setup"):
# Same rationale as the trim queue: clear the BUFFER_QUEUE bindings this fixture
# added and delete the buffer profiles it created on demand, so teardown leaves a
# clean, YANG-valid CONFIG_DB on platforms (e.g. VPP) whose base config lacks them.
for interfaces, block_queue_id in block_queue_bindings:
delete_buffer_queue_for_block_queue(duthost, interfaces, block_queue_id)
delete_created_block_queue_buffer_profiles(duthost, created_block_profiles)

with allure.step("Delete trim queue test buffer profile"):
delete_trim_queue_test_buffer_profile(duthost)

Expand Down
Loading
Loading