From 96a2e8fbd8ef6dabfa7aa687ee737f3bbec15eba Mon Sep 17 00:00:00 2001 From: Leos Stejskal Date: Wed, 26 Nov 2025 16:06:19 +0100 Subject: [PATCH] SAT-40191 Compute resources & plugins Allow enabling and installing of two features: foreman_azure_rm & foreman_google This includes foreman plugins and hammer-cli plugins. Related tasks * https://github.com/theforeman/foreman-oci-images/commit/5c09bfbc3dc5522e63991798b8484e04ee6d23c1 --- .github/workflows/test.yml | 6 ++++++ tests/foreman_compute_resources_test.py | 10 ++++++++++ tests/foreman_plugins_test.py | 6 ++++++ 3 files changed, 22 insertions(+) create mode 100644 tests/foreman_compute_resources_test.py create mode 100644 tests/foreman_plugins_test.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db107a07..ab0335d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -105,6 +105,9 @@ jobs: - name: Add optional feature - foreman-proxy run: | ./foremanctl deploy --add-feature foreman-proxy + - name: Add optional feature - foreman_azure_rm and foreman_google + run: | + ./foremanctl deploy --add-feature foreman_azure_rm --add-feature foreman_google - name: Run tests run: | ./forge test --pytest-args="--certificate-source=${{ matrix.certificate_source }} --database-mode=${{ matrix.database }}" @@ -211,6 +214,9 @@ jobs: - name: Add optional feature - foreman-proxy run: | ./foremanctl deploy --add-feature foreman-proxy + - name: Add optional feature - foreman_azure_rm and foreman_google + run: | + ./foremanctl deploy --add-feature foreman_azure_rm --add-feature foreman_google - name: Stop services run: vagrant ssh quadlet -- sudo systemctl stop foreman.target diff --git a/tests/foreman_compute_resources_test.py b/tests/foreman_compute_resources_test.py new file mode 100644 index 00000000..bb2bbc0c --- /dev/null +++ b/tests/foreman_compute_resources_test.py @@ -0,0 +1,10 @@ +import pytest + +FOREMAN_HOST = 'localhost' +FOREMAN_PORT = 3000 + +@pytest.mark.parametrize("compute_resource", ['AzureRm', 'EC2', 'GCE', 'Libvirt', 'Openstack', 'Vmware']) +def test_foreman_compute_resources(server, compute_resource): + hammer = server.run("hammer compute-resource create --help | grep provider") + assert hammer.succeeded + assert compute_resource in hammer.stdout diff --git a/tests/foreman_plugins_test.py b/tests/foreman_plugins_test.py new file mode 100644 index 00000000..4226b37d --- /dev/null +++ b/tests/foreman_plugins_test.py @@ -0,0 +1,6 @@ +import pytest + +@pytest.mark.parametrize("foreman_plugin", ['foreman_azure_rm', 'foreman_google']) +def test_foreman_compute_resources(foremanapi, foreman_plugin): + plugins = [plugin['name'] for plugin in foremanapi.list('plugins')] + assert foreman_plugin in plugins