diff --git a/roles/tests-integration/tests/common/mod.rs b/roles/tests-integration/tests/common/mod.rs index 40f9bbba3..17e0b21ac 100644 --- a/roles/tests-integration/tests/common/mod.rs +++ b/roles/tests-integration/tests/common/mod.rs @@ -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"; @@ -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",