test: add scenario 'netnsRegtest'

The 'basic' test command now cover regtest mode and using nix-bitcoin without
the secure-node preset.
This commit is contained in:
Erik Arvstedt 2020-10-29 21:20:28 +01:00
parent e0675cb256
commit 0e2ff948d3
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
3 changed files with 18 additions and 16 deletions

View File

@ -16,7 +16,7 @@ env:
jobs: jobs:
- TestModules=1 STABLE=1 SCENARIO=default - TestModules=1 STABLE=1 SCENARIO=default
- TestModules=1 STABLE=1 SCENARIO=netns - TestModules=1 STABLE=1 SCENARIO=netns
- EvalModules=1 STABLE=1 - TestModules=1 STABLE=1 SCENARIO=netnsRegtest
- PKG=hwi STABLE=1 - PKG=hwi STABLE=1
- PKG=hwi STABLE=0 - PKG=hwi STABLE=0
- PKG=lightning-charge STABLE=1 - PKG=lightning-charge STABLE=1
@ -35,12 +35,6 @@ env:
- PKG=joinmarket STABLE=0 - PKG=joinmarket STABLE=0
script: script:
- printf '%s (%s)\n' "$NIX_PATH" "$VER" - printf '%s (%s)\n' "$NIX_PATH" "$VER"
#
- |
if [[ $EvalModules ]]; then
test/run-tests.sh --scenario full eval
travis_terminate 0
fi
- | - |
getBuildExpr() { getBuildExpr() {
if [[ $TestModules ]]; then if [[ $TestModules ]]; then

View File

@ -169,12 +169,12 @@ EOF
} }
# A basic subset of tests to keep the total runtime within # 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. # These are also run on the CI server.
basic() { basic() {
scenario=default buildTest "$@" scenario=default buildTest "$@"
scenario=netns buildTest "$@" scenario=netns buildTest "$@"
scenario=full evalTest "$@" scenario=netnsRegtest buildTest "$@"
} }
all() { all() {
@ -182,6 +182,7 @@ all() {
scenario=netns buildTest "$@" scenario=netns buildTest "$@"
scenario=full buildTest "$@" scenario=full buildTest "$@"
scenario=regtest buildTest "$@" scenario=regtest buildTest "$@"
scenario=netnsRegtest buildTest "$@"
} }
build() { build() {

View File

@ -111,12 +111,7 @@ let testEnv = rec {
}; };
netns = { netns = {
imports = [ scenarios.secureNode ]; imports = with scenarios; [ netnsBase secureNode ];
nix-bitcoin.netns-isolation.enable = true;
test.data.netns = config.nix-bitcoin.netns-isolation.netns;
tests.netns-isolation = true;
environment.systemPackages = [ pkgs.fping ];
# This test is rather slow and unaffected by netns settings # This test is rather slow and unaffected by netns settings
tests.backups = mkForce false; tests.backups = mkForce false;
}; };
@ -133,12 +128,24 @@ let testEnv = rec {
services.joinmarket.enable = true; 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 = { regtestBase = {
tests.regtest = true; tests.regtest = true;
services.bitcoind.regtest = true; services.bitcoind.regtest = true;
systemd.services.bitcoind.postStart = mkAfter '' systemd.services.bitcoind.postStart = mkAfter ''
cli=${config.services.bitcoind.cli}/bin/bitcoin-cli cli=${config.services.bitcoind.cliBase}/bin/bitcoin-cli
address=$($cli getnewaddress) address=$($cli getnewaddress)
$cli generatetoaddress 10 $address $cli generatetoaddress 10 $address
''; '';