fix: correct fake WireGuard key length and guard cell2_client teardown
Unit Tests / test (push) Successful in 11m14s

The synthetic cell fixture used a 46-char base64 key where the validator
expects exactly 43 chars before '='. The key failed format validation so
add_cell_peer returned False, making the cell connection store nothing and
all TestCellPermissionsApi tests hit 404.

The TestCellServiceAccessRestrictions and TestLiveCellConnection teardown
fixtures called _remove_connection(cell2_client, ...) without checking if
cell2_client is None (expected when no second cell is configured), causing
AttributeError on teardown.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-06 06:20:52 -04:00
parent f84f16fcd6
commit 3e26186f85
+3 -3
View File
@@ -193,7 +193,7 @@ class TestCellPermissionsApi:
fake_dns_ip = '10.99.0.1' fake_dns_ip = '10.99.0.1'
fake_invite = { fake_invite = {
'cell_name': 'e2etest-synthetic-cell', 'cell_name': 'e2etest-synthetic-cell',
'public_key': 'AAAAFakePublicKeyForE2eTestingAAAAAAAAAAAAAAAA=', 'public_key': 'FakePublicKeyForE2eCellTestAAAAAAAAAAAAAAAA=',
'endpoint': '127.0.0.2:51820', 'endpoint': '127.0.0.2:51820',
'vpn_subnet': fake_subnet, 'vpn_subnet': fake_subnet,
'dns_ip': fake_dns_ip, 'dns_ip': fake_dns_ip,
@@ -334,7 +334,7 @@ class TestLiveCellConnection:
if cell2_name: if cell2_name:
_remove_connection(admin_client, cell2_name) _remove_connection(admin_client, cell2_name)
if cell1_name: if cell1_name and cell2_client:
_remove_connection(cell2_client, cell1_name) _remove_connection(cell2_client, cell1_name)
def _connect_cells(self, admin_client, cell2_client, def _connect_cells(self, admin_client, cell2_client,
@@ -530,7 +530,7 @@ class TestCellServiceAccessRestrictions:
cell1_name = None cell1_name = None
if cell2_name: if cell2_name:
_remove_connection(admin_client, cell2_name) _remove_connection(admin_client, cell2_name)
if cell1_name: if cell1_name and cell2_client:
_remove_connection(cell2_client, cell1_name) _remove_connection(cell2_client, cell1_name)
def _get_forward_rules(self, client) -> str: def _get_forward_rules(self, client) -> str: