Skip to content

Commit b717945

Browse files
committed
Add version check
1 parent f5f30ea commit b717945

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

tests/common/devices.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,16 @@ def check_bgp_session_nsf(self, neighbor_ip):
544544
return True
545545
return False
546546

547+
def get_version(self):
548+
"""
549+
Gets the SONiC version this device is running.
550+
551+
Returns:
552+
str: the firmware version number (e.g. 20181130.31)
553+
"""
554+
output = dut.command("sonic-cfggen -y /etc/sonic/sonic_version.yml -v build_version")
555+
return output["stdout_lines"][0].strip()
556+
547557
class EosHost(AnsibleHostBase):
548558
"""
549559
@summary: Class for Eos switch

tests/copp/test_copp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ def test_policer(self, protocol, duthost, ptfhost, _copp_testbed):
6060
that have a set rate limit.
6161
"""
6262

63-
if protocol == "ARP" and is_broadcom_device(duthost):
63+
if protocol == "ARP" \
64+
and is_broadcom_device(duthost) \
65+
and "201811" not in duthost.get_version():
6466
pytest.xfail("ARP policy disabled on BRCM devices due to SAI bug")
6567

6668
if protocol in ["IP2ME", "SNMP", "SSH"] and _copp_testbed.topo == "t1-lag":

0 commit comments

Comments
 (0)