-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
K8s: test-gateway addition to tox #8161
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c57c206
K9s: test-gateway addition to tox
Param-29 a4dd625
precommit fix
Param-29 c8da625
restructure tox
rasswanth-s b6dc962
added new gateway connection tests for kubernetes
rasswanth-s 1181461
temporarily disable vpn
rasswanth-s 80c73e6
improved exception handling during connection
rasswanth-s 54fe0fc
Merge branch 'dev' into paramm/gateway-k9s
rasswanth-s File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -1,7 +1,23 @@ | ||
# third party | ||
import _pytest | ||
import pytest | ||
|
||
|
||
def pytest_configure(config: _pytest.config.Config) -> None: | ||
config.addinivalue_line("markers", "frontend: frontend integration tests") | ||
config.addinivalue_line("markers", "network: network integration tests") | ||
|
||
|
||
@pytest.fixture | ||
def gateway_port() -> int: | ||
return 9081 | ||
|
||
|
||
@pytest.fixture | ||
def domain_1_port() -> int: | ||
return 9082 | ||
|
||
|
||
@pytest.fixture | ||
def domain_2_port() -> int: | ||
return 9083 |
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,52 @@ | ||
# syft absolute | ||
import syft as sy | ||
from syft.abstract_node import NodeType | ||
from syft.client.domain_client import DomainClient | ||
from syft.client.gateway_client import GatewayClient | ||
from syft.service.network.node_peer import NodePeer | ||
from syft.service.response import SyftSuccess | ||
from syft.service.user.user_roles import ServiceRole | ||
|
||
|
||
def test_domain_connect_to_gateway(domain_1_port, gateway_port): | ||
gateway_client: GatewayClient = sy.login( | ||
port=gateway_port, email="[email protected]", password="changethis" | ||
) | ||
|
||
domain_client: DomainClient = sy.login( | ||
port=domain_1_port, email="[email protected]", password="changethis" | ||
) | ||
|
||
result = domain_client.connect_to_gateway(gateway_client) | ||
assert isinstance(result, SyftSuccess) | ||
|
||
assert len(domain_client.peers) == 1 | ||
assert len(gateway_client.peers) == 1 | ||
|
||
proxy_domain_client = gateway_client.peers[0] | ||
domain_peer = domain_client.peers[0] | ||
|
||
assert isinstance(proxy_domain_client, DomainClient) | ||
assert isinstance(domain_peer, NodePeer) | ||
|
||
# Domain's peer is a gateway and vice-versa | ||
assert domain_peer.node_type == NodeType.GATEWAY | ||
|
||
assert gateway_client.name == domain_peer.name | ||
assert domain_client.name == proxy_domain_client.name | ||
|
||
assert len(gateway_client.domains) == 1 | ||
assert len(gateway_client.enclaves) == 0 | ||
|
||
assert proxy_domain_client.metadata == domain_client.metadata | ||
assert proxy_domain_client.user_role == ServiceRole.NONE | ||
|
||
domain_client.login(email="[email protected]", password="changethis") | ||
proxy_domain_client.login(email="[email protected]", password="changethis") | ||
|
||
assert proxy_domain_client.logged_in_user == "[email protected]" | ||
assert proxy_domain_client.user_role == ServiceRole.ADMIN | ||
assert proxy_domain_client.credentials == domain_client.credentials | ||
assert ( | ||
proxy_domain_client.api.endpoints.keys() == domain_client.api.endpoints.keys() | ||
) |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubham3121 , for info, I have commented it out, as we are not currently using tailscale, headscale.This was causing very slow startup times, while launching a gateway.