summaryrefslogtreecommitdiff
path: root/src/Run.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Run.hs')
-rw-r--r--src/Run.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Run.hs b/src/Run.hs
index f54a38c..67948d4 100644
--- a/src/Run.hs
+++ b/src/Run.hs
@@ -207,7 +207,7 @@ withNode netexpr tvname inner = do
withDisconnectedUp :: HasNetns n => n -> TestRun a -> TestRun a
withDisconnectedUp n inner = do
- let netns = netnsName n
+ let netns = getNetns n
disconnected <- asks $ S.member netns . tsDisconnectedUp . snd
if disconnected
then inner
@@ -220,7 +220,7 @@ withDisconnectedUp n inner = do
withDisconnectedBridge :: HasNetns n => n -> TestRun a -> TestRun a
withDisconnectedBridge n inner = do
- let netns = netnsName n
+ let netns = getNetns n
disconnected <- asks $ S.member netns . tsDisconnectedBridge . snd
if disconnected
then inner
@@ -233,14 +233,14 @@ withDisconnectedBridge n inner = do
withNodePacketLoss :: Node -> Scientific -> TestRun a -> TestRun a
withNodePacketLoss node loss inner = do
- x <- local (fmap $ \s -> s { tsNodePacketLoss = M.insertWith (\l l' -> 1 - (1 - l) * (1 - l')) (netnsName node) loss $ tsNodePacketLoss s }) $ do
+ x <- local (fmap $ \s -> s { tsNodePacketLoss = M.insertWith (\l l' -> 1 - (1 - l) * (1 - l')) (getNetns node) loss $ tsNodePacketLoss s }) $ do
resetLoss
inner
resetLoss
return x
where
resetLoss = do
- tl <- asks $ fromMaybe 0 . M.lookup (netnsName node) . tsNodePacketLoss . snd
+ tl <- asks $ fromMaybe 0 . M.lookup (getNetns node) . tsNodePacketLoss . snd
liftIO $ callOn node $ "tc qdisc replace dev veth0 root netem loss " <> T.pack (show (tl * 100)) <> "%"