diff options
Diffstat (limited to 'tests/topotests/lib/topogen.py')
| -rw-r--r-- | tests/topotests/lib/topogen.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py index 41da660b7d..f5b3ad06d9 100644 --- a/tests/topotests/lib/topogen.py +++ b/tests/topotests/lib/topogen.py @@ -212,7 +212,10 @@ class Topogen(object): # Mininet(Micronet) to build the actual topology. assert not inspect.isclass(topodef) - self.net = Mininet(controller=None) + self.net = Mininet() + + # Adjust the parent namespace + topotest.fix_netns_limits(self.net) # New direct way: Either a dictionary defines the topology or a build function # is supplied, or a json filename all of which build the topology by calling @@ -504,7 +507,7 @@ class Topogen(object): def set_error(self, message, code=None): "Sets an error message and signal other tests to skip." - logger.info(message) + logger.info("setting error msg: %s", message) # If no code is defined use a sequential number if code is None: @@ -799,7 +802,7 @@ class TopoRouter(TopoGear): grep_cmd = "grep 'ip {}' {}".format(daemonstr, source) else: grep_cmd = "grep 'router {}' {}".format(daemonstr, source) - result = self.run(grep_cmd).strip() + result = self.run(grep_cmd, warn=False).strip() if result: self.load_config(daemon) else: @@ -822,7 +825,7 @@ class TopoRouter(TopoGear): all routers. """ daemonstr = self.RD.get(daemon) - self.logger.info('loading "{}" configuration: {}'.format(daemonstr, source)) + self.logger.debug('loading "{}" configuration: {}'.format(daemonstr, source)) self.net.loadConf(daemonstr, source, param) def check_router_running(self): @@ -945,16 +948,16 @@ class TopoRouter(TopoGear): vtysh_command = 'vtysh {} -c "{}" 2>/dev/null'.format(dparam, command) - self.logger.info('vtysh command => "{}"'.format(command)) + self.logger.debug('vtysh command => "{}"'.format(command)) output = self.run(vtysh_command) dbgout = output.strip() if dbgout: if "\n" in dbgout: dbgout = dbgout.replace("\n", "\n\t") - self.logger.info("vtysh result:\n\t{}".format(dbgout)) + self.logger.debug("vtysh result:\n\t{}".format(dbgout)) else: - self.logger.info('vtysh result: "{}"'.format(dbgout)) + self.logger.debug('vtysh result: "{}"'.format(dbgout)) if isjson is False: return output @@ -994,7 +997,7 @@ class TopoRouter(TopoGear): dbgcmds = commands if is_string(commands) else "\n".join(commands) dbgcmds = "\t" + dbgcmds.replace("\n", "\n\t") - self.logger.info("vtysh command => FILE:\n{}".format(dbgcmds)) + self.logger.debug("vtysh command => FILE:\n{}".format(dbgcmds)) res = self.run(vtysh_command) os.unlink(fname) @@ -1003,9 +1006,9 @@ class TopoRouter(TopoGear): if dbgres: if "\n" in dbgres: dbgres = dbgres.replace("\n", "\n\t") - self.logger.info("vtysh result:\n\t{}".format(dbgres)) + self.logger.debug("vtysh result:\n\t{}".format(dbgres)) else: - self.logger.info('vtysh result: "{}"'.format(dbgres)) + self.logger.debug('vtysh result: "{}"'.format(dbgres)) return res def report_memory_leaks(self, testname): |
