diff options
Diffstat (limited to 'tests/topotests/munet/mucmd.py')
-rw-r--r-- | tests/topotests/munet/mucmd.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/topotests/munet/mucmd.py b/tests/topotests/munet/mucmd.py index 5518c6d..cd356f3 100644 --- a/tests/topotests/munet/mucmd.py +++ b/tests/topotests/munet/mucmd.py @@ -9,7 +9,6 @@ import argparse import json import os -import subprocess import sys from pathlib import Path @@ -90,19 +89,14 @@ def main(*args): ecmd = "/usr/bin/nsenter" eargs = [ecmd] - output = subprocess.check_output(["/usr/bin/nsenter", "--help"], encoding="utf-8") - if " -a," in output: - eargs.append("-a") - else: - # -U doesn't work - for flag in ["-u", "-i", "-m", "-n", "-C", "-T"]: - if f" {flag}," in output: - eargs.append(flag) + #start mucmd same way base process is started + eargs.append(f"--mount=/proc/{pid}/ns/mnt") + eargs.append(f"--net=/proc/{pid}/ns/net") eargs.append(f"--pid=/proc/{pid}/ns/pid_for_children") + eargs.append(f"--uts=/proc/{pid}/ns/uts") eargs.append(f"--wd={rundir}") - eargs.extend(["-t", pid]) eargs += args.shellcmd - # print("Using ", eargs) + #print("Using ", eargs) return os.execvpe(ecmd, eargs, {**env, **envcfg}) |