tests: Disable checking for updates

Override with CHECK_FOR_BSX_UPDATES.
This commit is contained in:
tecnovert
2025-10-17 12:31:21 +02:00
parent d16dc9e124
commit c6d5f47cea
6 changed files with 27 additions and 16 deletions

View File

@@ -161,10 +161,10 @@ expected_key_ids = {
} }
GUIX_SSL_CERT_DIR = None GUIX_SSL_CERT_DIR = None
OVERRIDE_DISABLED_COINS = toBool(os.getenv("OVERRIDE_DISABLED_COINS", "false")) OVERRIDE_DISABLED_COINS = toBool(os.getenv("OVERRIDE_DISABLED_COINS", False))
# If SKIP_GPG_VALIDATION is set to true the script will check hashes but not signatures # If SKIP_GPG_VALIDATION is set to true the script will check hashes but not signatures
SKIP_GPG_VALIDATION = toBool(os.getenv("SKIP_GPG_VALIDATION", "false")) SKIP_GPG_VALIDATION = toBool(os.getenv("SKIP_GPG_VALIDATION", False))
USE_PLATFORM = os.getenv("USE_PLATFORM", platform.system()) USE_PLATFORM = os.getenv("USE_PLATFORM", platform.system())
if USE_PLATFORM == "Darwin": if USE_PLATFORM == "Darwin":
@@ -192,11 +192,11 @@ if not len(logger.handlers):
logger.addHandler(logging.StreamHandler(sys.stdout)) logger.addHandler(logging.StreamHandler(sys.stdout))
logging.getLogger("gnupg").setLevel(logging.INFO) logging.getLogger("gnupg").setLevel(logging.INFO)
BSX_DOCKER_MODE = toBool(os.getenv("BSX_DOCKER_MODE", "false")) BSX_DOCKER_MODE = toBool(os.getenv("BSX_DOCKER_MODE", False))
BSX_LOCAL_TOR = toBool(os.getenv("BSX_LOCAL_TOR", "false")) BSX_LOCAL_TOR = toBool(os.getenv("BSX_LOCAL_TOR", False))
BSX_TEST_MODE = toBool(os.getenv("BSX_TEST_MODE", "false")) BSX_TEST_MODE = toBool(os.getenv("BSX_TEST_MODE", False))
BSX_UPDATE_UNMANAGED = toBool( BSX_UPDATE_UNMANAGED = toBool(
os.getenv("BSX_UPDATE_UNMANAGED", "true") os.getenv("BSX_UPDATE_UNMANAGED", True)
) # Disable updating unmanaged coin cores. ) # Disable updating unmanaged coin cores.
UI_HTML_PORT = int(os.getenv("UI_HTML_PORT", 12700)) UI_HTML_PORT = int(os.getenv("UI_HTML_PORT", 12700))
UI_WS_PORT = int(os.getenv("UI_WS_PORT", 11700)) UI_WS_PORT = int(os.getenv("UI_WS_PORT", 11700))
@@ -321,10 +321,8 @@ def setTorrcVars():
) )
TEST_TOR_PROXY = toBool( TEST_TOR_PROXY = toBool(os.getenv("TEST_TOR_PROXY", True)) # Expects a known exit node
os.getenv("TEST_TOR_PROXY", "true") TEST_ONION_LINK = toBool(os.getenv("TEST_ONION_LINK", False))
) # Expects a known exit node
TEST_ONION_LINK = toBool(os.getenv("TEST_ONION_LINK", "false"))
BITCOIN_FASTSYNC_URL = os.getenv( BITCOIN_FASTSYNC_URL = os.getenv(
"BITCOIN_FASTSYNC_URL", "BITCOIN_FASTSYNC_URL",
@@ -341,6 +339,8 @@ BITCOIN_FASTSYNC_SIG_URL = os.getenv(
# Encrypt new wallets with this password, must match the Particl wallet password when adding coins # Encrypt new wallets with this password, must match the Particl wallet password when adding coins
WALLET_ENCRYPTION_PWD = os.getenv("WALLET_ENCRYPTION_PWD", "") WALLET_ENCRYPTION_PWD = os.getenv("WALLET_ENCRYPTION_PWD", "")
CHECK_FOR_BSX_UPDATES = toBool(os.getenv("CHECK_FOR_BSX_UPDATES", True))
use_tor_proxy: bool = False use_tor_proxy: bool = False
with_coins_changed: bool = False with_coins_changed: bool = False
@@ -2973,7 +2973,7 @@ def main():
save_config(config_path, settings) save_config(config_path, settings)
logger.info("Done.") logger.info("Done.")
return 0 return 0
exitWithError("{} is already in the settings file".format(add_coin)) exitWithError(f"{add_coin} is already in the settings file")
if tor_control_password is None and settings.get("use_tor", False): if tor_control_password is None and settings.get("use_tor", False):
extra_opts["tor_control_password"] = settings.get( extra_opts["tor_control_password"] = settings.get(
@@ -3274,6 +3274,11 @@ def main():
settings["wshost"] = wshost settings["wshost"] = wshost
settings["wsport"] = UI_WS_PORT + port_offset settings["wsport"] = UI_WS_PORT + port_offset
if "CHECK_FOR_BSX_UPDATES" in os.environ:
settings["check_updates"] = CHECK_FOR_BSX_UPDATES
elif BSX_TEST_MODE is True:
settings["check_updates"] = False
if use_tor_proxy: if use_tor_proxy:
tor_control_password = generate_salt(24) tor_control_password = generate_salt(24)
addTorSettings(settings, tor_control_password) addTorSettings(settings, tor_control_password)

View File

@@ -55,6 +55,7 @@ from tests.basicswap.common import (
wait_for_unspent, wait_for_unspent,
wait_for_bid_tx_state, wait_for_bid_tx_state,
wait_for_in_progress, wait_for_in_progress,
TEST_HTTP_HOST,
TEST_HTTP_PORT, TEST_HTTP_PORT,
BASE_PORT, BASE_PORT,
BASE_RPC_PORT, BASE_RPC_PORT,
@@ -163,8 +164,8 @@ def prepareDir(datadir, nodeId, network_key, network_pubkey):
"debug": True, "debug": True,
"zmqhost": "tcp://127.0.0.1", "zmqhost": "tcp://127.0.0.1",
"zmqport": BASE_ZMQ_PORT + nodeId, "zmqport": BASE_ZMQ_PORT + nodeId,
"htmlhost": "127.0.0.1", "htmlhost": TEST_HTTP_HOST,
"htmlport": 12700 + nodeId, "htmlport": TEST_HTTP_PORT + nodeId,
"network_key": network_key, "network_key": network_key,
"network_pubkey": network_pubkey, "network_pubkey": network_pubkey,
"chainclients": { "chainclients": {
@@ -206,6 +207,7 @@ def prepareDir(datadir, nodeId, network_key, network_pubkey):
"min_delay_retry": 2, "min_delay_retry": 2,
"max_delay_retry": 10, "max_delay_retry": 10,
"restrict_unknown_seed_wallets": False, "restrict_unknown_seed_wallets": False,
"check_updates": False,
} }
with open(settings_path, "w") as fp: with open(settings_path, "w") as fp:
json.dump(settings, fp, indent=4) json.dump(settings, fp, indent=4)

View File

@@ -119,6 +119,7 @@ def prepare_swapclient_dir(datadir, node_id, network_key, network_pubkey):
"min_delay_retry": 2, "min_delay_retry": 2,
"max_delay_retry": 10, "max_delay_retry": 10,
"restrict_unknown_seed_wallets": False, "restrict_unknown_seed_wallets": False,
"check_updates": False,
} }
with open(settings_path, "w") as fp: with open(settings_path, "w") as fp:

View File

@@ -55,6 +55,7 @@ from tests.basicswap.common import (
wait_for_unspent, wait_for_unspent,
wait_for_in_progress, wait_for_in_progress,
wait_for_bid_tx_state, wait_for_bid_tx_state,
TEST_HTTP_HOST,
TEST_HTTP_PORT, TEST_HTTP_PORT,
BASE_PORT, BASE_PORT,
BASE_RPC_PORT, BASE_RPC_PORT,
@@ -169,8 +170,8 @@ def prepareDir(datadir, nodeId, network_key, network_pubkey):
"debug": True, "debug": True,
"zmqhost": "tcp://127.0.0.1", "zmqhost": "tcp://127.0.0.1",
"zmqport": BASE_ZMQ_PORT + nodeId, "zmqport": BASE_ZMQ_PORT + nodeId,
"htmlhost": "127.0.0.1", "htmlhost": TEST_HTTP_HOST,
"htmlport": 12700 + nodeId, "htmlport": TEST_HTTP_PORT + nodeId,
"network_key": network_key, "network_key": network_key,
"network_pubkey": network_pubkey, "network_pubkey": network_pubkey,
"chainclients": { "chainclients": {
@@ -212,6 +213,7 @@ def prepareDir(datadir, nodeId, network_key, network_pubkey):
"min_delay_retry": 2, "min_delay_retry": 2,
"max_delay_retry": 10, "max_delay_retry": 10,
"restrict_unknown_seed_wallets": False, "restrict_unknown_seed_wallets": False,
"check_updates": False,
} }
with open(settings_path, "w") as fp: with open(settings_path, "w") as fp:
json.dump(settings, fp, indent=4) json.dump(settings, fp, indent=4)

View File

@@ -77,7 +77,7 @@ class Test(unittest.TestCase):
prepare_nodes(3, "bitcoin") prepare_nodes(3, "bitcoin")
def run_thread(self, client_id): def run_thread(self, client_id):
client_path = os.path.join(TEST_PATH, "client{}".format(client_id)) client_path = os.path.join(TEST_PATH, f"client{client_id}")
testargs = [ testargs = [
"basicswap-run", "basicswap-run",
"-datadir=" + client_path, "-datadir=" + client_path,

View File

@@ -190,6 +190,7 @@ def prepare_swapclient_dir(
"max_delay_retry": 10, "max_delay_retry": 10,
"debug_ui": True, "debug_ui": True,
"restrict_unknown_seed_wallets": False, "restrict_unknown_seed_wallets": False,
"check_updates": False,
} }
if BTC_USE_DESCRIPTORS: if BTC_USE_DESCRIPTORS: