Skip to content

Commit 57969b7

Browse files
committed
Fix test: check peer key instead of cluster.pem for join rejection
The cluster.pem file is created during master startup in MasterKeys._setup_keys(), regardless of whether the autoscale join succeeds or fails. When join is rejected (e.g., missing cluster_pub_signature), the discover-reply handler returns early before writing the bootstrap master's peer key to the peers directory. Updated test to check for the absence of the bootstrap master's peer key file (<cluster_pki_dir>/peers/<bootstrap-id>.pub) as the correct indicator that join was rejected.
1 parent 8c12dfb commit 57969b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/pytests/integration/cluster/test_autoscale_security.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,12 +525,12 @@ def test_autoscale_rejects_join_without_cluster_pub_signature(
525525
with factory.started(start_timeout=30):
526526
time.sleep(10)
527527

528-
# Check that cluster keys were NOT created (join failed)
528+
# Check that the bootstrap master's peer key was NOT written (join was rejected)
529529
cluster_pki_dir = pathlib.Path(factory.config["cluster_pki_dir"])
530-
cluster_key = cluster_pki_dir / "cluster.pem"
530+
bootstrap_peer_key = cluster_pki_dir / "peers" / f"{autoscale_bootstrap_master.config['id']}.pub"
531531

532-
assert not cluster_key.exists(), (
533-
"Cluster key should NOT be created when join is rejected"
532+
assert not bootstrap_peer_key.exists(), (
533+
f"Bootstrap master peer key should NOT be created when join is rejected: {bootstrap_peer_key}"
534534
)
535535

536536

0 commit comments

Comments
 (0)