-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Component Audit: Check org and loc change on Global Registration form
Signed-off-by: Shubham Ganar <[email protected]>
- Loading branch information
1 parent
e17e37b
commit 9f00bfa
Showing
1 changed file
with
73 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
"""Tests for registration. | ||
:Requirement: Registration | ||
:CaseLevel: Acceptance | ||
:CaseComponent: Registration | ||
:CaseAutomation: Automated | ||
:CaseImportance: Critical | ||
:Team: Rocket | ||
:TestType: Functional | ||
:Upstream: No | ||
""" | ||
|
||
import pytest | ||
|
||
|
||
@pytest.mark.tier2 | ||
def test_positive_org_loc_change_for_global_registration( | ||
session, | ||
module_activation_key, | ||
module_org, | ||
module_location, | ||
default_os, | ||
target_sat, | ||
): | ||
"""Changing the organization and location to check if correct org and loc is updated on the global registration command | ||
:id: e83ed6bc-ceae-4021-87fe-3ecde1cbf347 | ||
:expectedresults: organization and location is updated correctly on the global registration command | ||
:CaseImportance: Medium | ||
""" | ||
new_org = target_sat.api.Organization().create() | ||
new_loc = target_sat.api.Location().create() | ||
new_activation_key = target_sat.api.ActivationKey(organization=new_org).create() | ||
|
||
with session: | ||
cmd = session.host.get_register_command( | ||
{ | ||
'general.operating_system': default_os.title, | ||
'general.activation_keys': module_activation_key.name, | ||
'general.insecure': True, | ||
} | ||
) | ||
expected_pairs = [ | ||
f'organization_id={module_org.id}', | ||
f'location_id={module_location.id}', | ||
] | ||
for pair in expected_pairs: | ||
assert pair in cmd | ||
# changing the org and loc to check if correct org and loc is updated on the registration command | ||
session.organization.select(org_name=new_org.name) | ||
session.location.select(loc_name=new_loc.name) | ||
cmd = session.host.get_register_command( | ||
{ | ||
'general.operating_system': default_os.title, | ||
'general.activation_keys': new_activation_key.name, | ||
'general.insecure': True, | ||
} | ||
) | ||
expected_pairs = [ | ||
f'organization_id={new_org.id}', | ||
f'location_id={new_loc.id}', | ||
] | ||
for pair in expected_pairs: | ||
assert pair in cmd |