Skip to content

Commit

Permalink
Shuffled the RHEL versions for api, cli, and ui modules
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Talreja <[email protected]>
  • Loading branch information
Gauravtalreja1 committed Jan 1, 2025
1 parent caf18cd commit 6bb3fdb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
13 changes: 11 additions & 2 deletions tests/foreman/api/test_computeresource_libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,15 @@ def test_negative_update_url(url, request, module_target_sat, module_org, module
@pytest.mark.on_premises_provisioning
@pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True)
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi', 'secureboot'], indirect=True)
@pytest.mark.rhel_ver_match('[7]')
@pytest.mark.rhel_ver_list('[9, 10]')
def test_positive_provision_end_to_end(
request,
setting_update,
module_provisioning_rhel_content,
module_libvirt_provisioning_sat,
module_sca_manifest_org,
module_location,
module_ssh_key_file,
pxe_loader,
provisioning_hostgroup,
):
Expand Down Expand Up @@ -377,7 +378,15 @@ def test_positive_provision_end_to_end(

# Verify SecureBoot is enabled on host after provisioning is completed sucessfully
if pxe_loader.vm_firmware == 'uefi_secure_boot':
provisioning_host = ContentHost(host.ip)
provisioning_host = ContentHost(host.ip, auth=module_ssh_key_file)
# Wait for the host to be rebooted and SSH daemon to be started.
provisioning_host.wait_for_connection()
# Enable Root Login
if int(host.operatingsystem.read().major) >= 9:
assert (
provisioning_host.execute(
'echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config; systemctl restart sshd'
).status
== 0
)
assert 'SecureBoot enabled' in provisioning_host.execute('mokutil --sb-state').stdout
2 changes: 1 addition & 1 deletion tests/foreman/cli/test_computeresource_libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def test_positive_update_console_password(libvirt_url, set_console_password, mod

@pytest.mark.e2e
@pytest.mark.on_premises_provisioning
@pytest.mark.rhel_ver_match('[8]')
@pytest.mark.rhel_ver_match('[7]')
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi', 'secureboot'], indirect=True)
@pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True)
def test_positive_provision_end_to_end(
Expand Down
13 changes: 2 additions & 11 deletions tests/foreman/ui/test_computeresource_libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_positive_end_to_end(session, module_target_sat, module_org, module_loca

@pytest.mark.e2e
@pytest.mark.on_premises_provisioning
@pytest.mark.rhel_ver_list('[9, 10]')
@pytest.mark.rhel_ver_match('[8]')
@pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True)
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi', 'secureboot'], indirect=True)
def test_positive_provision_end_to_end(
Expand All @@ -132,7 +132,6 @@ def test_positive_provision_end_to_end(
provisioning_hostgroup,
module_libvirt_provisioning_sat,
module_provisioning_rhel_content,
module_ssh_key_file,
):
"""Provision Host on libvirt compute resource, and delete it afterwards
Expand Down Expand Up @@ -206,17 +205,9 @@ def test_positive_provision_end_to_end(
# Verify SecureBoot is enabled on host after provisioning is completed sucessfully
if pxe_loader.vm_firmware == 'uefi_secure_boot':
host = sat.api.Host().search(query={'host': hostname})[0].read()
provisioning_host = ContentHost(host.ip, auth=module_ssh_key_file)
provisioning_host = ContentHost(host.ip)
# Wait for the host to be rebooted and SSH daemon to be started.
provisioning_host.wait_for_connection()
# Enable Root Login
if int(host.operatingsystem.read().major) >= 9:
assert (
provisioning_host.execute(
'echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config; systemctl restart sshd'
).status
== 0
)
assert 'SecureBoot enabled' in provisioning_host.execute('mokutil --sb-state').stdout

session.host.delete(name)
Expand Down

0 comments on commit 6bb3fdb

Please sign in to comment.