diff --git a/tests/topotests/lib/micronet.py b/tests/topotests/lib/micronet.py index 8567bd3b4b..59dd80ff7b 100644 --- a/tests/topotests/lib/micronet.py +++ b/tests/topotests/lib/micronet.py @@ -358,11 +358,14 @@ class Commander(object): # pylint: disable=R0205 # wait for not supported in screen for now channel = None cmd = [self.get_exec_path("screen")] + if title: + cmd.append("-t") + cmd.append(title) if not os.path.exists( "/run/screen/S-{}/{}".format(os.environ["USER"], os.environ["STY"]) ): cmd = ["sudo", "-u", os.environ["SUDO_USER"]] + cmd - cmd.append(nscmd) + cmd.extend(nscmd.split(" ")) elif "DISPLAY" in os.environ: # We need it broken up for xterm user_cmd = cmd diff --git a/tests/topotests/lib/micronet_cli.py b/tests/topotests/lib/micronet_cli.py index 6459d5d151..4292f47ce0 100644 --- a/tests/topotests/lib/micronet_cli.py +++ b/tests/topotests/lib/micronet_cli.py @@ -113,11 +113,11 @@ def doline(unet, line, writef): hosts = [unet.hosts[x] for x in args] for host in hosts: if cmd == "t" or cmd == "term": - host.run_in_window("bash") + host.run_in_window("bash", title="sh-%s" % host) elif cmd == "v" or cmd == "vtysh": - host.run_in_window("vtysh") + host.run_in_window("vtysh", title="vt-%s" % host) elif cmd == "x" or cmd == "xterm": - host.run_in_window("bash", forcex=True) + host.run_in_window("bash", title="sh-%s" % host, forcex=True) elif cmd == "sh": hosts, cmd = host_cmd_split(unet, oargs) for host in hosts: diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index 6be644ac00..d3438f67e5 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -1613,7 +1613,7 @@ class Router(Node): shell_routers = g_extra_config["shell"] if "all" in shell_routers or self.name in shell_routers: - self.run_in_window(os.getenv("SHELL", "bash")) + self.run_in_window(os.getenv("SHELL", "bash"), title="sh-%s" % self.name) if self.daemons["eigrpd"] == 1: eigrpd_path = os.path.join(self.daemondir, "eigrpd") @@ -1631,7 +1631,7 @@ class Router(Node): vtysh_routers = g_extra_config["vtysh"] if "all" in vtysh_routers or self.name in vtysh_routers: - self.run_in_window("vtysh") + self.run_in_window("vtysh", title="vt-%s" % self.name) return status