diff --git a/src/playbooks/deploy-proxy/deploy-proxy.yaml b/src/playbooks/deploy-proxy/deploy-proxy.yaml index 5ba00c2a1..0627ce61a 100644 --- a/src/playbooks/deploy-proxy/deploy-proxy.yaml +++ b/src/playbooks/deploy-proxy/deploy-proxy.yaml @@ -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 diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index 4e77b6398..1e6fae90a 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -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: diff --git a/src/vars/flavors/foreman.yml b/src/vars/flavors/foreman.yml new file mode 100644 index 000000000..ac29b9597 --- /dev/null +++ b/src/vars/flavors/foreman.yml @@ -0,0 +1,3 @@ +--- +flavor_features: + - foreman diff --git a/tests/pulp_test.py b/tests/feature/katello/pulp_test.py similarity index 94% rename from tests/pulp_test.py rename to tests/feature/katello/pulp_test.py index 4f69c2ed4..7db9b5e04 100644 --- a/tests/pulp_test.py +++ b/tests/feature/katello/pulp_test.py @@ -4,17 +4,17 @@ import pytest import yaml +from tests.conftest import PARAMETERS_FILE + 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', []) diff --git a/tests/httpd_test.py b/tests/httpd_test.py index 85cf5011b..6eb8683e3 100644 --- a/tests/httpd_test.py +++ b/tests/httpd_test.py @@ -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