Skip to content
Draft
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
4 changes: 3 additions & 1 deletion src/playbooks/deploy-proxy/deploy-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
- database_mode == 'internal'
- valkey
- httpd
- pulp
- role: pulp
when:
- "enabled_features | has_feature('katello')"
- systemd_target
- foreman_proxy
- role: post_install
Expand Down
9 changes: 7 additions & 2 deletions src/playbooks/deploy/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@
when:
- database_mode == 'internal'
- valkey
- candlepin
- role: candlepin
when:
- "enabled_features | has_feature('foreman')"
- "enabled_features | has_feature('katello')"
- httpd
- foreman
- pulp
- role: pulp
when:
- "enabled_features | has_feature('katello')"
- role: systemd_target
- role: iop_core
when:
Expand Down
3 changes: 3 additions & 0 deletions src/vars/flavors/foreman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
flavor_features:
- foreman
10 changes: 5 additions & 5 deletions tests/pulp_test.py → tests/feature/katello/pulp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
import pytest
import yaml

from tests.conftest import PARAMETERS_FILE

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about this, but I see tests/feature/foreman-proxy/base_test.py also imports FOREMAN_PROXY_PORT.

Then there's also this:

@pytest.fixture(scope="module")
def obsah_state_path():
return os.environ.get("OBSAH_STATE", "/var/lib/foremanctl")

Should it be a global fixture?


PULP_API_SOCKET = '/run/httpd.pulp-api.sock'
PULP_CONTENT_SOCKET = '/run/httpd.pulp-content.sock'


def load_pulp_paths_from_parameters():
test_dir = os.path.dirname(os.path.abspath(__file__))
foremanctl_dir = os.path.dirname(test_dir)
params_file = os.path.join(foremanctl_dir, '.var', 'lib', 'foremanctl', 'parameters.yaml')
import_paths = export_paths = None

if os.path.exists(params_file):
with open(params_file, 'r') as f:
if os.path.exists(PARAMETERS_FILE):
with open(PARAMETERS_FILE, 'r') as f:
params = yaml.safe_load(f)
import_paths = params.get('pulp_import_paths', [])
export_paths = params.get('pulp_export_paths', [])
Expand Down
6 changes: 6 additions & 0 deletions tests/httpd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,42 @@ def test_https_foreman_ping(server, certificates, server_fqdn):
assert cmd.stdout == '200'


@pytest.mark.feature('katello')
def test_http_pulp_api_status(server, server_fqdn):
cmd = server.run(f"{CURL_CMD} --write-out '%{{http_code}}' http://{server_fqdn}/pulp/api/v3/status/")
assert cmd.succeeded
assert cmd.stdout == '404'


@pytest.mark.feature('katello')
def test_https_pulp_api_status(server, certificates, server_fqdn):
cmd = server.run(f"{CURL_CMD} --cacert {certificates['server_ca_certificate']} --write-out '%{{http_code}}' https://{server_fqdn}/pulp/api/v3/status/")
assert cmd.succeeded
assert cmd.stdout == '200'


@pytest.mark.feature('katello')
def test_http_pulp_content(server, server_fqdn):
cmd = server.run(f"{CURL_CMD} --write-out '%{{stderr}}%{{http_code}}' http://{server_fqdn}/pulp/content/")
assert cmd.succeeded
assert cmd.stderr == '200'


@pytest.mark.feature('katello')
def test_https_pulp_content(server, certificates, server_fqdn):
cmd = server.run(f"curl --silent --cacert {certificates['server_ca_certificate']} https://{server_fqdn}/pulp/content/")
assert cmd.succeeded
assert "Index of /pulp/content/" in cmd.stdout


@pytest.mark.feature('katello')
def test_https_pulp_auth(curl_request):
cmd = curl_request("pulp/api/v3/users/")
assert cmd.succeeded
assert cmd.stdout == '200'


@pytest.mark.feature('katello')
def test_https_pypi_endpoint(curl_request):
cmd = curl_request("pypi/test/", return_body=True)
assert cmd.succeeded
Expand Down
Loading