-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nat-lab test for starting telio with an existing tunnel
Also fix some bugs found on the way.
- Loading branch information
1 parent
237d70f
commit cb22eec
Showing
11 changed files
with
106 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from typing import List | ||
from contextlib import AsyncExitStack | ||
from helpers import SetupParameters, ping_between_all_nodes, setup_mesh_nodes | ||
from utils.bindings import ( | ||
default_features, | ||
TelioAdapterType, | ||
) | ||
from utils.connection_util import ConnectionTag | ||
|
||
|
||
def _generate_setup_parameters( | ||
conn_tags: List[ConnectionTag], | ||
) -> List[SetupParameters]: | ||
return [ | ||
SetupParameters( | ||
connection_tag=conn_tag, | ||
adapter_type_override=TelioAdapterType.BORING_TUN, | ||
features=default_features(), | ||
fingerprint=f"{conn_tag}", | ||
) | ||
for conn_tag in conn_tags | ||
] | ||
|
||
|
||
async def test_start_with_tun() -> None: | ||
setup_params = _generate_setup_parameters([ | ||
ConnectionTag.DOCKER_CONE_CLIENT_1, | ||
ConnectionTag.DOCKER_CONE_CLIENT_2, | ||
]) | ||
|
||
async with AsyncExitStack() as exit_stack: | ||
env = await setup_mesh_nodes(exit_stack, setup_params) | ||
alpha_client, _ = env.clients | ||
alpha, _ = env.nodes | ||
|
||
await alpha_client.stop_device() | ||
tun = await alpha_client.create_tun("tun11") | ||
await alpha_client.start_with_tun(tun, "tun11") | ||
await alpha_client.set_meshnet_config(env.api.get_meshnet_config(alpha.id)) | ||
await ping_between_all_nodes(env) | ||
await alpha_client.stop_device() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters