Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias Peters committed Jan 7, 2025
1 parent 554b1b4 commit c809a39
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nat-lab/run_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ def get_pytest_arguments(options) -> List[str]:
marks = marks.replace("and not moose", "")
args.extend(["-m", marks])

args.extend(["-k", "test_pq"])

return args


Expand Down
35 changes: 35 additions & 0 deletions nat-lab/tests/test_pq.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import config
import pytest
from contextlib import AsyncExitStack
Expand Down Expand Up @@ -510,3 +511,37 @@ async def test_pq_vpn_upgrade_from_non_pq(

preshared = await read_preshared_key_slot(nlx_conn)
assert preshared != EMPTY_PRESHARED_KEY_SLOT


@pytest.mark.timeout(240)
async def test_pq_vpn_connection_with_nonet() -> None:
public_ip = "10.0.254.1"
async with AsyncExitStack() as exit_stack:
env = await exit_stack.enter_async_context(
setup_environment(
exit_stack,
[
SetupParameters(
connection_tag=ConnectionTag.DOCKER_CONE_CLIENT_1,
adapter_type_override=TelioAdapterType.NEP_TUN,
is_meshnet=False,
),
]
)
)

client_conn, *_ = [conn.connection for conn in env.connections]
client_alpha, *_ = env.clients

ip = await stun.get(client_conn, config.STUN_SERVER)
assert ip == public_ip, f"wrong public IP before connecting to VPN {ip}"

await _connect_vpn_pq(
client_conn,
client_alpha,
)

async with client_alpha.get_router().break_udp_conn_to_host(str(config.NLX_SERVER["ipv4"])):
await asyncio.sleep(185)

await ping(client_conn, config.PHOTO_ALBUM_IP)

0 comments on commit c809a39

Please sign in to comment.