Skip to content

Commit

Permalink
Add version check
Browse files Browse the repository at this point in the history
  • Loading branch information
daall committed May 4, 2020
1 parent f5f30ea commit b717945
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tests/common/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,16 @@ def check_bgp_session_nsf(self, neighbor_ip):
return True
return False

def get_version(self):
"""
Gets the SONiC version this device is running.
Returns:
str: the firmware version number (e.g. 20181130.31)
"""
output = dut.command("sonic-cfggen -y /etc/sonic/sonic_version.yml -v build_version")
return output["stdout_lines"][0].strip()

class EosHost(AnsibleHostBase):
"""
@summary: Class for Eos switch
Expand Down
4 changes: 3 additions & 1 deletion tests/copp/test_copp.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def test_policer(self, protocol, duthost, ptfhost, _copp_testbed):
that have a set rate limit.
"""

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

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

0 comments on commit b717945

Please sign in to comment.