Skip to content

Commit

Permalink
Fix registration test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 committed Feb 5, 2024
1 parent 79a723c commit 9af68a9
Show file tree
Hide file tree
Showing 3 changed files with 524 additions and 30 deletions.
8 changes: 4 additions & 4 deletions pytest_fixtures/component/activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@


@pytest.fixture(scope='module')
def module_activation_key(module_sca_manifest_org, module_target_sat):
def module_activation_key(module_entitlement_manifest_org, module_target_sat):
"""Create activation key using default CV and library environment."""
activation_key = module_target_sat.api.ActivationKey(
content_view=module_sca_manifest_org.default_content_view.id,
environment=module_sca_manifest_org.library.id,
organization=module_sca_manifest_org,
content_view=module_entitlement_manifest_org.default_content_view.id,
environment=module_entitlement_manifest_org.library.id,
organization=module_entitlement_manifest_org,
).create()
return activation_key

Expand Down
13 changes: 7 additions & 6 deletions tests/foreman/api/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_host_registration_end_to_end(
@pytest.mark.tier3
@pytest.mark.rhel_ver_match('[^6]')
def test_positive_allow_reregistration_when_dmi_uuid_changed(
module_sca_manifest_org,
module_entitlement_manifest_org,
rhel_contenthost,
target_sat,
module_activation_key,
Expand All @@ -108,7 +108,7 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed(
"""
uuid_1 = str(uuid.uuid1())
uuid_2 = str(uuid.uuid4())
org = module_sca_manifest_org
org = module_entitlement_manifest_org
target_sat.execute(f'echo \'{{"dmi.system.uuid": "{uuid_1}"}}\' > /etc/rhsm/facts/uuid.facts')
command = target_sat.api.RegistrationCommand(
organization=org,
Expand All @@ -131,7 +131,7 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed(

def test_positive_update_packages_registration(
module_target_sat,
module_sca_manifest_org,
module_entitlement_manifest_org,
module_location,
rhel8_contenthost,
module_activation_key,
Expand All @@ -142,7 +142,8 @@ def test_positive_update_packages_registration(
:expectedresults: Package update is successful on host post registration.
"""
org = module_sca_manifest_org
org = module_entitlement_manifest_org
org = module_entitlement_manifest_org
command = module_target_sat.api.RegistrationCommand(
organization=org,
location=module_location,
Expand All @@ -162,7 +163,7 @@ def test_positive_update_packages_registration(
@pytest.mark.no_containers
def test_positive_rex_interface_for_global_registration(
module_target_sat,
module_sca_manifest_org,
module_entitlement_manifest_org,
module_location,
rhel8_contenthost,
module_activation_key,
Expand All @@ -186,7 +187,7 @@ def test_positive_rex_interface_for_global_registration(
add_interface_command = f'ip link add eth1 type dummy;ifconfig eth1 hw ether {mac_address};ip addr add {ip}/24 brd + dev eth1 label eth1:1;ip link set dev eth1 up'
result = rhel8_contenthost.execute(add_interface_command)
assert result.status == 0
org = module_sca_manifest_org
org = module_entitlement_manifest_org
command = module_target_sat.api.RegistrationCommand(
organization=org,
location=module_location,
Expand Down
Loading

0 comments on commit 9af68a9

Please sign in to comment.