Skip to content

Commit

Permalink
Make TP test module port configurable
Browse files Browse the repository at this point in the history
This enables running multiple TP's across different tests
simultaneously.
  • Loading branch information
jbesraa committed Sep 4, 2024
1 parent 7c528d2 commit 5d5db7d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions roles/tests-integration/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use bitcoind::{bitcoincore_rpc::RpcApi, BitcoinD, Conf};
use flate2::read::GzDecoder;
use std::{
env,
fs::{create_dir_all, File},
io::{BufReader, Read},
path::{Path, PathBuf},
};
use bitcoind::{bitcoincore_rpc::RpcApi, BitcoinD, Conf};
use flate2::read::GzDecoder;
use tar::Archive;

const VERSION_TP: &str = "0.1.7";
Expand Down Expand Up @@ -63,14 +63,16 @@ pub struct TemplateProvider {
}

impl TemplateProvider {
pub fn start() -> Self {
let temp_dir = PathBuf::from("/tmp/.template-provider/");
pub fn start(port: u16) -> Self {
let path_name = format!("/tmp/.template-provider-{}", port);
let temp_dir = PathBuf::from(&path_name);

let mut conf = Conf::default();
let port = format!("-sv2port={}", port);
conf.args.extend(vec![
"-txindex=1",
"-sv2",
"-sv2port=8442",
&port,
"-debug=sv2",
"-sv2interval=20",
"-sv2feedelta=1000",
Expand Down

0 comments on commit 5d5db7d

Please sign in to comment.