From a76fa89bf612f39a053390dfe1c78ba1f9331bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 25 Mar 2023 22:24:04 +0100 Subject: Network refactoring with explicit prefixes --- src/Process.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Process.hs') diff --git a/src/Process.hs b/src/Process.hs index a93b464..a90a734 100644 --- a/src/Process.hs +++ b/src/Process.hs @@ -88,7 +88,8 @@ lineReadingLoop process h act = spawnOn :: Either Network Node -> ProcName -> Maybe Signal -> String -> TestRun Process spawnOn target pname killWith cmd = do - let prefix = either (const "") (\node -> "ip netns exec \"" ++ unpackNodeName (nodeName node) ++ "\" ") target + let netns = either netnsName netnsName target + let prefix = T.unpack $ "ip netns exec \"" <> netns <> "\" " (Just hin, Just hout, Just herr, handle) <- liftIO $ createProcess (shell $ prefix ++ cmd) { std_in = CreatePipe, std_out = CreatePipe, std_err = CreatePipe , env = Just [("EREBOS_DIR", either netDir nodeDir target)] -- cgit v1.2.3