Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Pukenis <[email protected]>
  • Loading branch information
LukasPukenis committed Dec 18, 2024
1 parent 77cca74 commit b3979cf
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions nat-lab/tests/test_batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,49 +293,49 @@ def features():
]


# @pytest.mark.asyncio
# @pytest.mark.parametrize(
# "setup_params",
# [
# proxying_peer_parameters(
# [ConnectionTag.DOCKER_CONE_CLIENT_1,
# ConnectionTag.DOCKER_CONE_CLIENT_2]
# )
# ],
# )
# async def test_proxying_peer_batched_keepalive(
# setup_params: List[SetupParameters],
# ) -> None:
# # Since batching keepalives are performed on application level instead of Wireguard
# # backend we need to ensure that proxying peers are receiving the keepalives. To test
# # for that we can enable link detection that guarantees quick detection if there's no corresponding
# # received traffic(WireGuard PassiveKeepalive). If batcher correctly emits pings, it
# # should trigger link detection quite quickly.
# async with AsyncExitStack() as exit_stack:
# env = await setup_mesh_nodes(exit_stack, setup_params)
#
# await asyncio.gather(*[
# await exit_stack.enter_async_context(
# run_async_context(
# client.wait_for_state_peer(
# node.public_key, [NodeState.CONNECTED], [
# PathType.RELAY]
# )
# )
# )
# for client, node in itertools.product(env.clients, env.nodes)
# if not client.is_node(node)
# ])
#
# alpha, beta = env.clients
# await beta.stop_device()
#
# _, beta_node = env.nodes
#
# await alpha.wait_for_state_peer(
# beta_node.public_key,
# [NodeState.CONNECTED],
# [PathType.RELAY],
# timeout=30,
# link_state=LinkState.DOWN,
# )
@pytest.mark.asyncio
@pytest.mark.parametrize(
"setup_params",
[
proxying_peer_parameters(
[ConnectionTag.DOCKER_CONE_CLIENT_1,
ConnectionTag.DOCKER_CONE_CLIENT_2]
)
],
)
async def test_proxying_peer_batched_keepalive(
setup_params: List[SetupParameters],
) -> None:
# Since batching keepalives are performed on application level instead of Wireguard
# backend we need to ensure that proxying peers are receiving the keepalives. To test
# for that we can enable link detection that guarantees quick detection if there's no corresponding
# received traffic(WireGuard PassiveKeepalive). If batcher correctly emits pings, it
# should trigger link detection quite quickly.
async with AsyncExitStack() as exit_stack:
env = await setup_mesh_nodes(exit_stack, setup_params)

await asyncio.gather(*[
await exit_stack.enter_async_context(
run_async_context(
client.wait_for_state_peer(
node.public_key, [NodeState.CONNECTED], [
PathType.RELAY]
)
)
)
for client, node in itertools.product(env.clients, env.nodes)
if not client.is_node(node)
])

alpha, beta = env.clients
await beta.stop_device()

_, beta_node = env.nodes

await alpha.wait_for_state_peer(
beta_node.public_key,
[NodeState.CONNECTED],
[PathType.RELAY],
timeout=30,
link_state=LinkState.DOWN,
)

0 comments on commit b3979cf

Please sign in to comment.