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

[6.15.z] Add workaround for BZ:2255264 and extend for OS version check #14206

Closed
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
35 changes: 34 additions & 1 deletion tests/foreman/cli/test_computeresource_vmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

from robottelo.config import settings
from robottelo.constants import FOREMAN_PROVIDERS
from robottelo.hosts import ContentHost
from robottelo.utils.issue_handlers import is_open


@pytest.mark.tier1
Expand Down Expand Up @@ -150,6 +152,37 @@ def test_positive_provision_end_to_end(
!= 'Pending installation',
timeout=1800,
delay=30,
silent_failure=True,
handle_exception=True,
)
vcenter8_issue = provision_method == 'bootdisk' and vmware == '8' and is_open('BZ:2255264')
host_info = sat.cli.Host.info({'id': host['id']})
assert host_info['status']['build-status'] == 'Installed'
assert (
host_info['status']['build-status'] == 'Pending installation'
if vcenter8_issue
else 'Installed'
)

# Perform OS version check and check if root password is properly updated
provisioning_host = ContentHost(host_info['network-interfaces'][0]['ipv4-address'])
expected_rhel_version = host_info['operating-system']['operating-system'][-3:]

# Wait for the host to be rebooted and SSH daemon to be started.
provisioning_host.wait_for_connection()

if int(expected_rhel_version.split('.')[0]) >= 9:
assert (
provisioning_host.execute(
'echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config; systemctl restart sshd'
).status
== 0
)
host_ssh_os = sat.execute(
f'sshpass -p {settings.provisioning.host_root_password} '
'ssh -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -o PasswordAuthentication=yes '
f'-o UserKnownHostsFile=/dev/null root@{provisioning_host.hostname} cat /etc/redhat-release'
)
assert host_ssh_os.status == 0
assert (
expected_rhel_version in host_ssh_os.stdout
), f'The installed OS version differs from the expected version {expected_rhel_version}'
Loading