test: simplify scenario handling
We can switch to a more sophisticated scheme later when adding more scenarios
This commit is contained in:
parent
0f56ea6ad1
commit
9b4cd7bd1c
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user