Skip to content

Commit

Permalink
fix root domain for guacamole redirect uri in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvalyaron committed Apr 4, 2023
1 parent d6a7d22 commit b7f4f94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions e2e_tests/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@ def get_cloud() -> cloud.Cloud:

def get_aad_authority_fqdn() -> str:
return urlparse(get_cloud().endpoints.active_directory).netloc


def get_azurewebsites_root_domain() -> str:
cloud_name = get_cloud().name
root_domains = {cloud.AZURE_PUBLIC_CLOUD.name: "azurewebsites.net",
cloud.AZURE_US_GOV_CLOUD.name: "azurewebsites.us"}

if cloud_name not in root_domains:
raise ValueError(f"The root domain of 'azurewebsites' was not configured for '{cloud_name}'")

return root_domains[cloud_name]
3 changes: 2 additions & 1 deletion e2e_tests/test_workspace_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import config
from e2e_tests.conftest import get_workspace_owner_token, disable_and_delete_ws_resource
from helpers import check_aad_auth_redirect
from cloud import get_azurewebsites_root_domain
from resources.resource import post_resource
from resources import strings

Expand Down Expand Up @@ -61,7 +62,7 @@ async def test_create_guacamole_service_into_aad_workspace(setup_test_aad_worksp
async def ping_guacamole_workspace_service(workspace_id, workspace_service_id, verify) -> None:
short_workspace_id = workspace_id[-4:]
short_workspace_service_id = workspace_service_id[-4:]
endpoint = f"https://guacamole-{config.TRE_ID}-ws-{short_workspace_id}-svc-{short_workspace_service_id}.azurewebsites.net/guacamole"
endpoint = f"https://guacamole-{config.TRE_ID}-ws-{short_workspace_id}-svc-{short_workspace_service_id}.{get_azurewebsites_root_domain()}/guacamole"

await check_aad_auth_redirect(endpoint, verify)

Expand Down

0 comments on commit b7f4f94

Please sign in to comment.