summaryrefslogtreecommitdiff
path: root/src/Run.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-11-29 21:40:16 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2024-11-29 21:40:16 +0100
commit1670b628cc7accea1c7ecd9359a7dccb6bd50a45 (patch)
treeefad1d67a737fe654acb8ccfeb3b06fcf767de63 /src/Run.hs
parent56878ad193071539a1fd83298c4509fe21b880fd (diff)
Represent root network as an internal variable
Diffstat (limited to 'src/Run.hs')
-rw-r--r--src/Run.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Run.hs b/src/Run.hs
index fd02af3..54fdba6 100644
--- a/src/Run.hs
+++ b/src/Run.hs
@@ -59,8 +59,7 @@ runTest out opts test variables = do
, teGDB = fst <$> mgdb
}
tstate = TestState
- { tsNetwork = error "network not initialized"
- , tsVars = builtins
+ { tsVars = builtins
, tsNodePacketLoss = M.empty
, tsDisconnectedUp = S.empty
, tsDisconnectedBridge = S.empty
@@ -184,7 +183,8 @@ withInternet inner = do
testDir <- asks $ optTestDir . teOptions . fst
inet <- newInternet testDir
res <- withNetwork (inetRoot inet) $ \net -> do
- local (fmap $ \s -> s { tsNetwork = net }) $ inner net
+ withTypedVar rootNetworkVar net $ do
+ inner net
delInternet inet
return res