diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-12-15 10:49:59 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-12-15 10:49:59 -0500 |
| commit | af99f19eb2ad5158afe97093ced4aab83d66f3ce (patch) | |
| tree | 778e27758671a20fd3e3698d014c9edf94f1e89b | |
| parent | 8b26284ba15d655adb9e9288f917f32c49a99086 (diff) | |
topotests: Cleanup diagnose_env to allow thought about multi-platforms
Start the cleanup of diagnose_env to allow the running of topotests
on platforms besides linux.
So we split up diagnose_env into linux and freebsd variants.
At this point in time freebsd doesn't have any special code.
To be determined in the future.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| -rw-r--r-- | tests/topotests/lib/topogen.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py index 25edfe0324..8688a13aef 100644 --- a/tests/topotests/lib/topogen.py +++ b/tests/topotests/lib/topogen.py @@ -908,7 +908,7 @@ class TopoExaBGP(TopoHost): # Disable linter branch warning. It is expected to have these here. # pylint: disable=R0912 -def diagnose_env(): +def diagnose_env_linux(): """ Run diagnostics in the running environment. Returns `True` when everything is ok, otherwise `False`. @@ -1066,3 +1066,14 @@ def diagnose_env(): logger.removeHandler(fhandler) return ret + +def diagnose_env_freebsd(): + return True + +def diagnose_env(): + if sys.platform.startswith("linux"): + return diagnose_env_linux() + elif sys.platform.startswith("freebsd"): + return diagnose_env_freebsd() + + return False |
