From 9b4cd7bd1ccb98a3cc9d0ad116dd61094c5166e1 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 21 Aug 2020 22:36:10 +0200 Subject: [PATCH] test: simplify scenario handling We can switch to a more sophisticated scheme later when adding more scenarios --- test/test.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/test.nix b/test/test.nix index 807c66e..fbc24c9 100644 --- a/test/test.nix +++ b/test/test.nix @@ -2,11 +2,6 @@ { scenario ? "default" }: -let - netns-isolation = builtins.getAttr scenario { default = false; withnetns = true; }; - testScriptFilename = builtins.getAttr scenario { default = ./scenarios/default.py; withnetns = ./scenarios/withnetns.py; }; -in - import ./make-test.nix rec { name = "nix-bitcoin-${scenario}"; @@ -23,7 +18,7 @@ import ./make-test.nix rec { # hardened ]; - nix-bitcoin.netns-isolation.enable = mkForce netns-isolation; + nix-bitcoin.netns-isolation.enable = (scenario == "withnetns"); services.bitcoind.extraConfig = mkForce "connect=0"; @@ -61,5 +56,7 @@ import ./make-test.nix rec { install -o nobody -g nogroup -m777 <(:) /secrets/dummy ''; }; - testScript = builtins.readFile ./scenarios/lib.py + "\n\n" + builtins.readFile testScriptFilename; + testScript = + builtins.readFile ./scenarios/lib.py + "\n\n" + + builtins.readFile "${./.}/scenarios/${scenario}.py"; }