]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: Start abstraction of module_present for other platforms 3488/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 15 Dec 2018 15:54:11 +0000 (10:54 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 15 Dec 2018 15:54:11 +0000 (10:54 -0500)
Start abstraction of the module_present into module_present_linux and freebsd
To allow for multiple platforms that the topotests can be run on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
tests/topotests/lib/topotest.py

index e9b8d34ec3732011b0995c9d4dcb18e681374bf9..6d3e512a4dd3ea381463624ac8dbbcecf489b2b2 100644 (file)
@@ -336,7 +336,7 @@ def normalize_text(text):
 
     return text
 
-def module_present(module, load=True):
+def module_present_linux(module, load):
     """
     Returns whether `module` is present.
 
@@ -352,6 +352,15 @@ def module_present(module, load=True):
     else:
         return True
 
+def module_present_freebsd(module, load):
+    return True
+
+def module_present(module, load=True):
+    if sys.platform.startswith("linux"):
+        module_present_linux(module, load)
+    elif sys.platform.startswith("freebsd"):
+        module_present_freebsd(module, load)
+
 def version_cmp(v1, v2):
     """
     Compare two version strings and returns: