Skip to content

Commit

Permalink
Debug PRT
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapaioa committed Sep 19, 2024
1 parent 48c081e commit b7168ba
Showing 1 changed file with 5 additions and 53 deletions.
58 changes: 5 additions & 53 deletions tests/foreman/cli/test_bootstrap_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,17 @@
from robottelo.config import settings


@pytest.mark.e2e
@pytest.mark.pit_server
@pytest.mark.pit_client
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
@pytest.mark.tier1
def test_positive_register(
module_org,
module_location,
module_lce,
module_ak_cv_lce,
module_published_cv,
target_sat,
rhel_contenthost,
):
"""System is registered
def test_os_version(rhel_contenthost):
"""System has os_version
:id: e34561fd-e0d6-4587-84eb-f86bd131aab1
:steps:
1. Ensure system is not registered
2. Register a system
3. Ensure system is registered
4. Register system once again
1. Check system os_version
:expectedresults: system is registered, host is created
:expectedresults: Success
:CaseAutomation: Automated
Expand All @@ -53,36 +37,4 @@ def test_positive_register(
:BZ: 2001476
"""
if rhel_contenthost.os_version.major == 7:
python_cmd = 'python'
elif rhel_contenthost.os_version.major == 8:
python_cmd = '/usr/libexec/platform-python'
else:
python_cmd = 'python3'
hg = target_sat.api.HostGroup(location=[module_location], organization=[module_org]).create()
# assure system is not registered
result = rhel_contenthost.execute('subscription-manager identity')
# result will be 1 if not registered
assert result.status == 1
assert rhel_contenthost.execute(
f'curl -o /root/bootstrap.py "http://{target_sat.hostname}/pub/bootstrap.py" '
)
assert rhel_contenthost.execute(
f'{python_cmd} /root/bootstrap.py -s {target_sat.hostname} -o {module_org.name}'
f' -L {module_location.name} -a {module_ak_cv_lce.name} --hostgroup={hg.name}'
' --skip puppet --skip foreman'
)
# assure system is registered
result = rhel_contenthost.execute('subscription-manager identity')
# result will be 0 if registered
assert result.status == 0
# register system once again
assert rhel_contenthost.execute(
f'{python_cmd} /root/bootstrap.py -s "{target_sat.hostname}" -o {module_org.name} '
f'-L {module_location.name} -a {module_ak_cv_lce.name} --hostgroup={hg.name}'
'--skip puppet --skip foreman '
)
# assure system is registered
result = rhel_contenthost.execute('subscription-manager identity')
# result will be 0 if registered
assert result.status == 0
assert rhel_contenthost.os_version.major == 9

0 comments on commit b7168ba

Please sign in to comment.