From 1670b628cc7accea1c7ecd9359a7dccb6bd50a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 29 Nov 2024 21:40:16 +0100 Subject: Represent root network as an internal variable --- src/Run/Monad.hs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/Run/Monad.hs') diff --git a/src/Run/Monad.hs b/src/Run/Monad.hs index 512dd72..2882197 100644 --- a/src/Run/Monad.hs +++ b/src/Run/Monad.hs @@ -21,7 +21,6 @@ import Data.Scientific import qualified Data.Text as T import {-# SOURCE #-} GDB -import {-# SOURCE #-} Network import Network.Ip import Output import {-# SOURCE #-} Process @@ -39,8 +38,7 @@ data TestEnv = TestEnv } data TestState = TestState - { tsNetwork :: Network - , tsVars :: [(VarName, SomeVarValue)] + { tsVars :: [(VarName, SomeVarValue)] , tsDisconnectedUp :: Set NetworkNamespace , tsDisconnectedBridge :: Set NetworkNamespace , tsNodePacketLoss :: Map NetworkNamespace Scientific @@ -94,8 +92,6 @@ instance MonadError Failed TestRun where instance MonadEval TestRun where lookupVar name = maybe (fail $ "variable not in scope: '" ++ unpackVarName name ++ "'") return =<< asks (lookup name . tsVars . snd) - rootNetwork = asks $ tsNetwork . snd - withVar name value = local (fmap $ \s -> s { tsVars = ( name, someConstValue value ) : tsVars s }) instance MonadOutput TestRun where -- cgit v1.2.3