From 99f60e5ecb4f42123bde6d15f2e4ada598f64587 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 19 Dec 2022 23:26:28 +0200 Subject: [PATCH] tests: Add an option for SNMP config to specify a custom options Signed-off-by: Donatas Abraitis --- tests/topotests/lib/snmptest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/topotests/lib/snmptest.py b/tests/topotests/lib/snmptest.py index fe5ff28979..d695443906 100644 --- a/tests/topotests/lib/snmptest.py +++ b/tests/topotests/lib/snmptest.py @@ -36,11 +36,12 @@ from lib.topolog import logger class SnmpTester(object): "A helper class for testing SNMP" - def __init__(self, router, iface, community, version): + def __init__(self, router, iface, community, version, options=""): self.community = community self.version = version self.router = router self.iface = iface + self.options = options logger.info( "created SNMP tester: SNMPv{0} community:{1}".format( self.version, self.community @@ -52,7 +53,9 @@ class SnmpTester(object): Helper function to build a string with SNMP configuration for commands. """ - return "-v {0} -c {1} {2}".format(self.version, self.community, self.iface) + return "-v {0} -c {1} {2} {3}".format( + self.version, self.community, self.options, self.iface + ) @staticmethod def _get_snmp_value(snmp_output): -- 2.39.5