Merge pull request #7909 from pjdruddy/snmp-skip-test

test: add snmp skip test
This commit is contained in:
Donald Sharp 2021-01-22 08:23:56 -05:00 committed by GitHub
commit ddbda04e87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,6 +76,11 @@ class TemplateTopo(Topo):
def setup_module(mod): def setup_module(mod):
"Sets up the pytest environment" "Sets up the pytest environment"
# skip tests is SNMP not installed
if not os.path.isfile("/usr/sbin/snmpd"):
error_msg = "SNMP not installed - skipping"
pytest.skip(error_msg)
# This function initiates the topology build with Topogen... # This function initiates the topology build with Topogen...
tgen = Topogen(TemplateTopo, mod.__name__) tgen = Topogen(TemplateTopo, mod.__name__)
# ... and here it calls Mininet initialization functions. # ... and here it calls Mininet initialization functions.