Skip to content

Commit

Permalink
flake8 errors
Browse files Browse the repository at this point in the history
Signed-off-by: Suvarna Meenakshi <[email protected]>
  • Loading branch information
SuvarnaMeenakshi committed Jul 7, 2023
1 parent fa06473 commit 23fe59d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion tests/common/helpers/snmp_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def get_snmp_output(ip, duthost, nbr, creds_all_duts, oid='.1.3.6.1.2.1.1.1.0'):
iptables_cmd, ip)
duthost.shell(ip_tbl_rule_add)


if isinstance(nbr["host"], EosHost):
eos_snmpget = "bash snmpget -v2c -c {} {} {}".format(
creds_all_duts[duthost.hostname]['snmp_rocommunity'], ip, oid)
Expand Down
16 changes: 8 additions & 8 deletions tests/macsec/test_interop_protocol.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
import logging
import re
import ipaddress

from tests.common.utilities import wait_until
Expand Down Expand Up @@ -127,20 +126,21 @@ def test_snmp(self, duthost, ctrl_links, upstream_links, creds_all_duts, wait_mk
if duthost.is_multi_asic:
pytest.skip("The test is for Single ASIC devices")


loopback0_ips = duthost.config_facts(host=duthost.hostname,
source="running")[
"ansible_facts"].get(
"LOOPBACK_INTERFACE",
{}).get('Loopback0', {})
source="running")[
"ansible_facts"].get(
"LOOPBACK_INTERFACE",
{}).get('Loopback0', {})
for ip in loopback0_ips:
if isinstance(ipaddress.ip_network(ip),
ipaddress.IPv4Network):
dut_loip = ip.split('/')[0]
break
else:
pytest.fail("No Loopback0 IPv4 address for {}".format(duthost.hostname))
pytest.fail("No Loopback0 IPv4 address for {}".
format(duthost.hostname))
for ctrl_port, nbr in list(ctrl_links.items()):
sysDescr = ".1.3.6.1.2.1.1.1.0"
result = get_snmp_output(dut_loip, duthost, nbr, creds_all_duts, sysDescr)
result = get_snmp_output(dut_loip, duthost, nbr,
creds_all_duts, sysDescr)
assert not result["failed"]
5 changes: 1 addition & 4 deletions tests/snmp/test_snmp_loopback.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
import ipaddress
from tests.common.helpers.snmp_helpers import get_snmp_facts, get_snmp_output
from tests.common.devices.eos import EosHost
try: # python3
from shlex import quote
except ImportError: # python2
from pipes import quote

pytestmark = [
pytest.mark.topology('t0', 't1', 't2', 'm0', 'mx'),
pytest.mark.device_type('vs')
]


@pytest.mark.bsl
def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
nbrhosts, tbinfo, localhost, creds_all_duts):
Expand Down

0 comments on commit 23fe59d

Please sign in to comment.