Skip to content

Commit

Permalink
tests: use prod environment for magic-attach test
Browse files Browse the repository at this point in the history
The staging esm environment is presenting some problems
when the apt-helper command tries to verify the credential
for some services. We are now switching for the production
environment to mitigate that issue
  • Loading branch information
lucasmoura authored and orndorffgrant committed Aug 7, 2023
1 parent 5e7590b commit c538bd0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 3 additions & 4 deletions features/magic_attach.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ Feature: Magic attach flow related tests
@uses.config.machine_type.lxd-container
Scenario Outline: Attach using the magic attach flow
Given a `<release>` machine with ubuntu-advantage-tools installed
When I change contract to staging with sudo
And I create the file `/tmp/response-overlay.json` with the following:
When I create the file `/tmp/response-overlay.json` with the following:
"""
{
"https://contracts.staging.canonical.com/v1/magic-attach": [
"https://contracts.canonical.com/v1/magic-attach": [
{
"code": 200,
"response": {
Expand All @@ -26,7 +25,7 @@ Feature: Magic attach flow related tests
"expires": "expire-date",
"expiresIn": 2000,
"contractID": "test-contract-id",
"contractToken": "$behave_var{contract_token_staging}"
"contractToken": "$behave_var{contract_token}"
}
}]
}
Expand Down
7 changes: 7 additions & 0 deletions features/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,13 @@ def process_template_vars(
context.pro_config.contract_token_staging,
logger_fn,
)
elif function_name == "contract_token":
processed_template = _replace_and_log(
processed_template,
match.group(0),
context.pro_config.contract_token,
logger_fn,
)
elif function_name == "config":
item = args[1]
if not shown or item not in context.pro_config.redact_options:
Expand Down

0 comments on commit c538bd0

Please sign in to comment.