Skip to content

Commit

Permalink
tests: change ua to pro
Browse files Browse the repository at this point in the history
On the basic API tests, we are changing the ua command
to pro instead
  • Loading branch information
lucasmoura authored and renanrodrigo committed Mar 18, 2024
1 parent e1398e9 commit 09c05c3
Showing 1 changed file with 98 additions and 98 deletions.
196 changes: 98 additions & 98 deletions features/api.feature
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Feature: Client behaviour for the API endpoints
"type": "Version"
}
"""
When I run `ua api u.pro.attach.auto.should_auto_attach.v1` with sudo
When I run `pro api u.pro.attach.auto.should_auto_attach.v1` with sudo
Then API data field output matches regexp:
"""
{
Expand All @@ -133,7 +133,7 @@ Feature: Client behaviour for the API endpoints
"type": "ShouldAutoAttach"
}
"""
When I run `ua api u.pro.status.is_attached.v1` with sudo
When I run `pro api u.pro.status.is_attached.v1` with sudo
Then API data field output matches regexp:
"""
{
Expand All @@ -149,7 +149,7 @@ Feature: Client behaviour for the API endpoints
"type": "IsAttached"
}
"""
When I run `ua api u.pro.status.enabled_services.v1` with sudo
When I run `pro api u.pro.status.enabled_services.v1` with sudo
Then API data field output matches regexp:
"""
{
Expand All @@ -174,110 +174,110 @@ Feature: Client behaviour for the API endpoints
@uses.config.contract_token
Scenario Outline: u.pro.status.is_attached.v1
Given a `<release>` `<machine_type>` machine with ubuntu-advantage-tools installed
When I run `ua api u.pro.status.is_attached.v1` with sudo
When I run `pro api u.pro.status.is_attached.v1` with sudo
Then API data field output matches regexp:
"""
{
"attributes": {
"contract_remaining_days": 0,
"contract_status": null,
"is_attached": false,
"is_attached_and_contract_valid": false
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""
"""
{
"attributes": {
"contract_remaining_days": 0,
"contract_status": null,
"is_attached": false,
"is_attached_and_contract_valid": false
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""
When I attach `contract_token` with sudo
And I run `ua api u.pro.status.is_attached.v1` with sudo
And I run `pro api u.pro.status.is_attached.v1` with sudo
Then API data field output matches regexp:
"""
{
"attributes": {
"contract_remaining_days": \d+,
"contract_status": "active",
"is_attached": true,
"is_attached_and_contract_valid": true
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""
"""
{
"attributes": {
"contract_remaining_days": \d+,
"contract_status": "active",
"is_attached": true,
"is_attached_and_contract_valid": true
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""
When I set the machine token overlay to the following yaml
"""
machineTokenInfo:
contractInfo:
effectiveTo: $behave_var{today +2}
"""
"""
machineTokenInfo:
contractInfo:
effectiveTo: $behave_var{today +2}
"""
And I run `ua api u.pro.status.is_attached.v1` with sudo
Then API data field output matches regexp:
"""
{
"attributes": {
"contract_remaining_days": 2,
"contract_status": "active-soon-to-expire",
"is_attached": true,
"is_attached_and_contract_valid": true
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""
"""
{
"attributes": {
"contract_remaining_days": 2,
"contract_status": "active-soon-to-expire",
"is_attached": true,
"is_attached_and_contract_valid": true
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""
When I set the machine token overlay to the following yaml
"""
machineTokenInfo:
contractInfo:
effectiveTo: $behave_var{today -2}
"""
And I run `ua api u.pro.status.is_attached.v1` with sudo
"""
machineTokenInfo:
contractInfo:
effectiveTo: $behave_var{today -2}
"""
And I run `pro api u.pro.status.is_attached.v1` with sudo
Then API data field output matches regexp:
"""
{
"attributes": {
"contract_remaining_days": -2,
"contract_status": "grace-period",
"is_attached": true,
"is_attached_and_contract_valid": true
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""
"""
{
"attributes": {
"contract_remaining_days": -2,
"contract_status": "grace-period",
"is_attached": true,
"is_attached_and_contract_valid": true
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""
When I set the machine token overlay to the following yaml
"""
machineTokenInfo:
contractInfo:
effectiveTo: $behave_var{today -50}
"""
And I run `ua api u.pro.status.is_attached.v1` with sudo
"""
machineTokenInfo:
contractInfo:
effectiveTo: $behave_var{today -50}
"""
And I run `pro api u.pro.status.is_attached.v1` with sudo
Then API data field output matches regexp:
"""
{
"attributes": {
"contract_remaining_days": -50,
"contract_status": "expired",
"is_attached": true,
"is_attached_and_contract_valid": false
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""
"""
{
"attributes": {
"contract_remaining_days": -50,
"contract_status": "expired",
"is_attached": true,
"is_attached_and_contract_valid": false
},
"meta": {
"environment_vars": []
},
"type": "IsAttached"
}
"""

Examples: ubuntu release
| release | machine_type |
| xenial | lxd-container |
| bionic | lxd-container |
| focal | lxd-container |
| jammy | lxd-container |
| mantic | lxd-container |
| release | machine_type |
| xenial | lxd-container |
| bionic | lxd-container |
| focal | lxd-container |
| jammy | lxd-container |
| mantic | lxd-container |

0 comments on commit 09c05c3

Please sign in to comment.