Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cardano_node_tests/utils/cluster_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,12 @@ def _get_bootstrap_conf_dir(self, *, bootstrap_dir: pl.Path) -> pl.Path:
if not configuration.BOOTSTRAP_DIR:
msg = "The 'BOOTSTRAP_DIR' env variable is not set."
raise RuntimeError(msg)
bootstrap_conf_dir = pl.Path(configuration.BOOTSTRAP_DIR).expanduser().resolve()
bootstrap_conf_dir = pl.Path(configuration.BOOTSTRAP_DIR)
if not self._is_bootstrap_conf_dir(bootstrap_conf_dir):
msg = "The 'BOOTSTRAP_DIR' doesn't contain all the needed files."
msg = (
f"The 'BOOTSTRAP_DIR' is set to '{bootstrap_conf_dir}'"
", but doesn't contain all the needed files."
)
raise RuntimeError(msg)
return bootstrap_conf_dir

Expand Down Expand Up @@ -569,6 +572,6 @@ def prepare_scripts_files(
return cardonnay_local.InstanceFiles(
start_script=destdir / "start-cluster",
stop_script=destdir / "stop-cluster",
start_script_args=[configuration.BOOTSTRAP_DIR],
start_script_args=[str(configuration.BOOTSTRAP_DIR)],
dir=destdir,
)
10 changes: 9 additions & 1 deletion cardano_node_tests/utils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@
DEV_CLUSTER_RUNNING = helpers.is_truthy_env_var("DEV_CLUSTER_RUNNING")
FORBID_RESTART = helpers.is_truthy_env_var("FORBID_RESTART")

BOOTSTRAP_DIR = os.environ.get("BOOTSTRAP_DIR") or ""
BOOTSTRAP_DIR: str | pl.Path = os.environ.get("BOOTSTRAP_DIR") or ""
if BOOTSTRAP_DIR:
BOOTSTRAP_DIR = pl.Path(BOOTSTRAP_DIR).expanduser().resolve()
if not (BOOTSTRAP_DIR / "genesis-shelley.json").exists():
__msg = (
f"The `BOOTSTRAP_DIR` is set to '{BOOTSTRAP_DIR}'"
", but the 'genesis-shelley.json' file is not found."
)
raise RuntimeError(__msg)

NUM_POOLS = int(os.environ.get("NUM_POOLS") or 3)
if not BOOTSTRAP_DIR and NUM_POOLS < 3:
Expand Down
Loading