Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d234b70
Adding v1 of Test Plan for Chassis GCU new tests
okaravasi Oct 8, 2024
688acf4
Tests for cable length modification, more QoS tables verification
okaravasi Aug 25, 2025
28771d7
test suite file
okaravasi Oct 22, 2024
ff1a1d8
Removing common code added via https://github.com/sonic-net/sonic-mgm…
okaravasi Oct 31, 2024
aad6a20
Update ASIC namespace fixture following changes in dependent PR #15182
okaravasi Nov 29, 2024
4663082
Addressing review comments, re-structure files for add-cluster
okaravasi Aug 25, 2025
fb9377c
Documentation changes
okaravasi Apr 30, 2025
5d88185
Removing unecessary acl rule for bgp
okaravasi Apr 30, 2025
38fb7ec
Adding suite files for laod qos and update cable length
okaravasi Apr 30, 2025
947eab2
Handling pre-comiit errors, removed unused import, handled cros--feat…
okaravasi Aug 29, 2025
605e883
Handling review comment: Removing updates in paths /QUEUE and /BUFFER…
okaravasi Aug 29, 2025
db80891
As per commnet request removing extar test cases to be moved to separ…
okaravasi Sep 15, 2025
32b7164
Modifying test design so that it simulates adding cluster in plain LC.
okaravasi Oct 3, 2025
4e8d8e9
Replacing config reload instead of reboot and enabling loganalyzer
okaravasi Oct 14, 2025
7fd5095
Increasing data traffic counters from 10 to 1000 and adding retries i…
okaravasi Oct 16, 2025
4585582
Remove cluster via sonic-db-cli in max-topo, W/A for PORTCHANNEL fail…
okaravasi Oct 24, 2025
b3ae82a
Fixes for add cluster case and W/As for open issues #24338, #24295
okaravasi Nov 7, 2025
6258bbf
Replace static route IP, add BGP state check before data traffic, han…
okaravasi Dec 16, 2025
87d61a0
Skipp if not voq chassis
okaravasi Dec 17, 2025
ad4bd99
Moving skip test case in case no voq in setup stage, displaying bgp info
okaravasi Dec 17, 2025
1b71665
Displaying ip route table for all duthosts
okaravasi Dec 19, 2025
38c6250
Skipping bgp check for supervisor node
okaravasi Dec 22, 2025
c6ac379
Verifying static route existence in upstream card
okaravasi Dec 23, 2025
eb2f9a0
Disabling data traffic due to kvm-t2 issue#21775
okaravasi Dec 23, 2025
fc9dfda
Skipping for vs testbed
okaravasi Jan 2, 2026
b2dbc8e
Merge branch 'master' into master-new_tests_for_multi_asic_gcu
okaravasi Jan 2, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -2466,6 +2466,12 @@ generic_config_updater:
conditions:
- "('t2' == topo_type) and (release in ['201811', '201911', '202012', '202205', '202211', '202305', '202311'])"

generic_config_updater/add_cluster/test_add_cluster.py:
skip:
reason: This test case either cannot pass or should be skipped on virtual chassis
conditions:
- asic_type in ['vs']

generic_config_updater/test_bgp_prefix.py::test_bgp_prefix_tc1_suite:
skip:
reason: "Cisco 8122 backend compute ai platform is not supported. Skip on VS platform due to low success rate."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ everflow/test_everflow_testbed.py:
- asic_type in ['vs'] and 't2' in topo_name
- https://github.com/sonic-net/sonic-mgmt/issues/20257
reason: This test case takes too much time on virtual chassis
generic_config_updater/add_cluster/test_add_cluster.py:
skip:
conditions:
- asic_type in ['vs'] and 't2' in topo_name
reason: This test case either cannot pass or should be skipped on virtual chassis
generic_config_updater/test_bgp_prefix.py:
skip:
conditions:
Expand Down
16 changes: 12 additions & 4 deletions tests/common/snappi_tests/common_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from ipaddress import IPv6Network, IPv6Address
import ipaddress
from random import getrandbits
from tests.common.helpers.assertions import pytest_assert
from tests.common.portstat_utilities import parse_portstat
from collections import defaultdict
from tests.conftest import parse_override
from tests.common.helpers.assertions import pytest_assert
from tests.common.utilities import wait_until

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -1322,12 +1322,13 @@ def start_pfcwd_fwd(duthost, asic_value=None):
format(asic_value))


def clear_counters(duthost, port):
def clear_counters(duthost, port=None, namespace=None):
"""
Clear PFC, Queuecounters, Drop and generic counters from SONiC CLI.
Args:
duthost (Ansible host instance): Device under test
port (str): port name
namespace (str): namespace name in case of multi asic duthost
Returns:
None
"""
Expand All @@ -1343,8 +1344,15 @@ def clear_counters(duthost, port):
duthost.command("sonic-clear queue watermark all \n")

if (duthost.is_multi_asic):
asic = duthost.get_port_asic_instance(port).get_asic_namespace()
duthost.command("sudo ip netns exec {} sonic-clear dropcounters \n".format(asic))
pytest_assert(
port or namespace,
'Cannot clear counters in case of multi asic, either port or namespace needs to be provided.'
)
if not namespace:
namespace = duthost.get_port_asic_instance(port).get_asic_namespace()
duthost.command("sudo ip netns exec {} sonic-clear dropcounters \n".format(namespace))
else:
duthost.command("sonic-clear dropcounters \n")


def get_interface_stats(duthost, port):
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"acl": {
"acl-sets": {
"acl-set": {
"L3_TRANSPORT_TEST": {
"acl-entries": {
"acl-entry": {
"100": {
"actions": {
"config": {
"forwarding-action": "ACCEPT"
}
},
"config": {
"sequence-id": 100
},
"transport": {
"config": {
"source-port": "5000"
}
}
},
"200": {
"actions": {
"config": {
"forwarding-action": "DROP"
}
},
"config": {
"sequence-id": 200
},
"transport": {
"config": {
"destination-port": "8080"
}
}
}
}
}
}
}
}
}
}
74 changes: 74 additions & 0 deletions tests/generic_config_updater/add_cluster/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import logging
import pytest
from tests.common.gu_utils import create_checkpoint, delete_checkpoint, rollback_or_reload
from tests.common.gu_utils import restore_backup_test_config, save_backup_test_config

logger = logging.getLogger(__name__)


# -----------------------------
# Fixtures that return random values for selected asic namespace, neighbors and cfg data for these selections
# -----------------------------

@pytest.fixture(scope="module")
def enum_rand_one_asic_namespace(enum_rand_one_frontend_asic_index):
return None if enum_rand_one_frontend_asic_index is None else 'asic{}'.format(enum_rand_one_frontend_asic_index)


@pytest.fixture(scope="module")
def config_facts(duthosts, enum_downstream_dut_hostname, enum_rand_one_asic_namespace):
duthost = duthosts[enum_downstream_dut_hostname]
return duthost.config_facts(
host=duthost.hostname, source="running", namespace=enum_rand_one_asic_namespace
)['ansible_facts']


@pytest.fixture(scope="module")
def config_facts_localhost(duthosts, enum_downstream_dut_hostname):
duthost = duthosts[enum_downstream_dut_hostname]
return duthost.config_facts(host=duthost.hostname, source="running", namespace=None)['ansible_facts']


@pytest.fixture(scope="module")
def mg_facts(duthosts, enum_downstream_dut_hostname, enum_rand_one_asic_namespace, tbinfo):
duthost = duthosts[enum_downstream_dut_hostname]
return duthost.get_extended_minigraph_facts(tbinfo, namespace=enum_rand_one_asic_namespace)


@pytest.fixture(scope="module")
def rand_bgp_neigh_ip_name(config_facts):
'''Returns a random bgp neighbor ip, name from the namespace'''
bgp_neighbors = config_facts["BGP_NEIGHBOR"]
random_bgp_neigh_ip = list(bgp_neighbors.keys())[0]
random_bgp_neigh_name = config_facts['BGP_NEIGHBOR'][random_bgp_neigh_ip]['name']
logger.info("rand_bgp_neigh_ip_name : {}, {} "
.format(random_bgp_neigh_ip, random_bgp_neigh_name))
return random_bgp_neigh_ip, random_bgp_neigh_name


# -----------------------------
# Setup Fixtures
# -----------------------------

@pytest.fixture(scope="module", autouse=True)
def setup_env(duthosts, rand_one_dut_front_end_hostname):
"""
Setup/teardown fixture for add cluster test cases.
Args:
duthosts: list of DUTs.
rand_one_dut_front_end_hostname: A random linecard.
"""

duthost = duthosts[rand_one_dut_front_end_hostname]
create_checkpoint(duthost)
save_backup_test_config(duthost, file_postfix="{}_before_add_cluster_test".format(duthost.hostname))

yield

restore_backup_test_config(duthost, file_postfix="{}_before_add_cluster_test".format(duthost.hostname),
config_reload=False)
try:
logger.info("{}:Rolling back to original checkpoint".format(duthost.hostname))
rollback_or_reload(duthost)
finally:
delete_checkpoint(duthost)
Loading
Loading