summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/topotest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/lib/topotest.py')
-rw-r--r--tests/topotests/lib/topotest.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py
index 00bfac4103..a187971e41 100644
--- a/tests/topotests/lib/topotest.py
+++ b/tests/topotests/lib/topotest.py
@@ -992,11 +992,11 @@ class Router(Node):
# Backward compatibility:
# Load configuration defaults like topogen.
self.config_defaults = configparser.ConfigParser(
- {
+ defaults = {
"verbosity": "info",
"frrdir": "/usr/lib/frr",
"routertype": "frr",
- "memleak_path": None,
+ "memleak_path": "",
}
)
self.config_defaults.read(
@@ -1525,7 +1525,7 @@ class Router(Node):
for daemon in self.daemons:
if (self.daemons[daemon] == 1) and not (daemon in daemonsRunning):
sys.stderr.write("%s: Daemon %s not running\n" % (self.name, daemon))
- if daemon is "staticd":
+ if daemon == "staticd":
sys.stderr.write(
"You may have a copy of staticd installed but are attempting to test against\n"
)
@@ -1591,7 +1591,7 @@ class Router(Node):
logger.info("{}: running version: {}".format(self.name, self.version))
rversion = self.version
- if rversion is None:
+ if rversion == None:
return False
result = version_cmp(rversion, version)
@@ -1737,3 +1737,10 @@ class LegacySwitch(OVSSwitch):
def __init__(self, name, **params):
OVSSwitch.__init__(self, name, failMode="standalone", **params)
self.switchIP = None
+
+def frr_unicode(s):
+ '''Convert string to unicode, depending on python version'''
+ if sys.version_info[0] > 2:
+ return s
+ else:
+ return unicode(s)