Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix registration test cases #14026

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -88,7 +88,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 @@ -107,7 +107,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 @@ -130,7 +130,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 @@ -141,7 +141,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 @@ -161,7 +162,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 @@ -185,7 +186,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
Loading