From 0e2ff948d3223bf1ac9d6d6f7dbc22ab43aee60c Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 29 Oct 2020 21:20:28 +0100 Subject: [PATCH] test: add scenario 'netnsRegtest' The 'basic' test command now cover regtest mode and using nix-bitcoin without the secure-node preset. --- .travis.yml | 8 +------- test/run-tests.sh | 5 +++-- test/tests.nix | 21 ++++++++++++++------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 907f19b..b0ba652 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ env: jobs: - TestModules=1 STABLE=1 SCENARIO=default - TestModules=1 STABLE=1 SCENARIO=netns - - EvalModules=1 STABLE=1 + - TestModules=1 STABLE=1 SCENARIO=netnsRegtest - PKG=hwi STABLE=1 - PKG=hwi STABLE=0 - PKG=lightning-charge STABLE=1 @@ -35,12 +35,6 @@ env: - PKG=joinmarket STABLE=0 script: - printf '%s (%s)\n' "$NIX_PATH" "$VER" - # - - | - if [[ $EvalModules ]]; then - test/run-tests.sh --scenario full eval - travis_terminate 0 - fi - | getBuildExpr() { if [[ $TestModules ]]; then diff --git a/test/run-tests.sh b/test/run-tests.sh index 0776b40..dd9845e 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -169,12 +169,12 @@ EOF } # A basic subset of tests to keep the total runtime within -# manageable bounds (<3 min on desktop systems). +# manageable bounds (<4 min on desktop systems). # These are also run on the CI server. basic() { scenario=default buildTest "$@" scenario=netns buildTest "$@" - scenario=full evalTest "$@" + scenario=netnsRegtest buildTest "$@" } all() { @@ -182,6 +182,7 @@ all() { scenario=netns buildTest "$@" scenario=full buildTest "$@" scenario=regtest buildTest "$@" + scenario=netnsRegtest buildTest "$@" } build() { diff --git a/test/tests.nix b/test/tests.nix index 9d2e3a8..436536d 100644 --- a/test/tests.nix +++ b/test/tests.nix @@ -111,12 +111,7 @@ let testEnv = rec { }; netns = { - imports = [ scenarios.secureNode ]; - nix-bitcoin.netns-isolation.enable = true; - test.data.netns = config.nix-bitcoin.netns-isolation.netns; - tests.netns-isolation = true; - environment.systemPackages = [ pkgs.fping ]; - + imports = with scenarios; [ netnsBase secureNode ]; # This test is rather slow and unaffected by netns settings tests.backups = mkForce false; }; @@ -133,12 +128,24 @@ let testEnv = rec { services.joinmarket.enable = true; }; + # netns and regtest, without secure-node.nix + netnsRegtest = { + imports = with scenarios; [ netnsBase regtest ]; + }; + + netnsBase = { + nix-bitcoin.netns-isolation.enable = true; + test.data.netns = config.nix-bitcoin.netns-isolation.netns; + tests.netns-isolation = true; + environment.systemPackages = [ pkgs.fping ]; + }; + regtestBase = { tests.regtest = true; services.bitcoind.regtest = true; systemd.services.bitcoind.postStart = mkAfter '' - cli=${config.services.bitcoind.cli}/bin/bitcoin-cli + cli=${config.services.bitcoind.cliBase}/bin/bitcoin-cli address=$($cli getnewaddress) $cli generatetoaddress 10 $address '';