Skip to content

Commit

Permalink
PRT debug
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapaioa committed Sep 10, 2024
1 parent 5c05d4f commit bed288e
Showing 1 changed file with 3 additions and 51 deletions.
54 changes: 3 additions & 51 deletions tests/foreman/api/test_http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from fauxfactory import gen_string
import pytest

from robottelo import constants
from robottelo.config import settings
from robottelo.constants import (
CONTAINER_REGISTRY_HUB,
Expand Down Expand Up @@ -151,16 +150,8 @@ def test_positive_end_to_end(
@pytest.mark.upgrade
@pytest.mark.rhel_ver_match('8')
@pytest.mark.run_in_one_thread
@pytest.mark.parametrize(
'setup_http_proxy',
[None, True, False],
indirect=True,
ids=['no_http_proxy', 'auth_http_proxy', 'unauth_http_proxy'],
)
@pytest.mark.tier3
def test_positive_install_content_with_http_proxy(
setup_http_proxy, module_target_sat, rhel_contenthost, function_sca_manifest_org
):
def test_positive_install_content_with_http_proxy(rhel_contenthost):
"""Attempt to sync and install RH content on a content host via HTTP proxy.
:id: cce888b5-e023-4ee2-bffe-efa9260224ee
Expand All @@ -185,47 +176,8 @@ def test_positive_install_content_with_http_proxy(
:parametrized: yes
"""
repo_to_use = 'rhae2.9_el8'
pkg_name = 'ansible'
org = function_sca_manifest_org
lce = module_target_sat.api.LifecycleEnvironment(organization=org).create()
content_view = module_target_sat.api.ContentView(organization=org).create()
rh_repo_id = module_target_sat.api_factory.enable_sync_redhat_repo(
constants.REPOS[repo_to_use], org.id
)
rh_repo = module_target_sat.api.Repository(id=rh_repo_id).read()
assert rh_repo.content_counts['rpm'] >= 1
content_view = module_target_sat.api.ContentView(
id=content_view.id, repository=[rh_repo]
).update(["repository"])
content_view.publish()
content_view = content_view.read()
content_view.version[-1].promote(data={'environment_ids': lce.id})

activation_key = module_target_sat.api.ActivationKey(
content_view=content_view,
organization=org,
environment=lce,
).create()
activation_key.content_override(
data={
'content_overrides': [
{'content_label': constants.REPOS[repo_to_use]['id'], 'value': '1'}
]
}
)

result = rhel_contenthost.register(
org=org,
activation_keys=activation_key.name,
target=module_target_sat,
loc=None,
)
assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}'
assert rhel_contenthost.subscribed

result = rhel_contenthost.execute(f'yum install -y {pkg_name}')
assert result.status == 0, f'{pkg_name} installation failed with: {result.stderr}'
result = rhel_contenthost.execute('ls -la')
assert result.status == 0


@pytest.mark.e2e
Expand Down

0 comments on commit bed288e

Please sign in to comment.