-
Notifications
You must be signed in to change notification settings - Fork 32
Add BMC feature to foreman-proxy #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1263c65
2c9f0b6
a331e56
9d1c33f
59042b5
babe207
690f9d7
7e6c784
cf2c560
97dce2e
34cd628
b9bb58b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| :enabled: {{ feature_enabled }} | ||
| :bmc_default_provider: {{ foreman_proxy_bmc_ipmi_implementation }} | ||
| :redfish_verify_ssl: {{ foreman_proxy_bmc_redfish_verify_ssl }} |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,17 +2,37 @@ | |||||
| import json | ||||||
|
|
||||||
| import pytest | ||||||
| from conftest import enabled_features | ||||||
|
|
||||||
| FOREMAN_PROXY_PORT = 8443 | ||||||
|
|
||||||
|
|
||||||
| def is_bmc_enabled(): | ||||||
| return 'bmc' in enabled_features() | ||||||
|
|
||||||
|
|
||||||
| def get_proxy_v2_features(server, certificates, server_fqdn): | ||||||
| cmd = server.run( | ||||||
| f"curl --cacert {certificates['server_ca_certificate']} " | ||||||
| f"--cert {certificates['client_certificate']} " | ||||||
| f"--key {certificates['client_key']} " | ||||||
| f"--silent https://{server_fqdn}:{FOREMAN_PROXY_PORT}/v2/features" | ||||||
| ) | ||||||
| assert cmd.succeeded, f"Failed to query /v2/features: {cmd.stderr}" | ||||||
| return json.loads(cmd.stdout) | ||||||
|
|
||||||
|
|
||||||
| def test_foreman_proxy_features(server, certificates, server_fqdn): | ||||||
| cmd = server.run(f"curl --cacert {certificates['server_ca_certificate']} --silent https://{server_fqdn}:{FOREMAN_PROXY_PORT}/features") | ||||||
|
ekohl marked this conversation as resolved.
|
||||||
| assert cmd.succeeded | ||||||
| features = json.loads(cmd.stdout) | ||||||
| assert "logs" in features | ||||||
| assert "script" in features | ||||||
| assert "dynflow" in features | ||||||
| if is_bmc_enabled(): | ||||||
| assert "bmc" in features | ||||||
|
ekohl marked this conversation as resolved.
|
||||||
| else: | ||||||
| assert "bmc" not in features | ||||||
|
|
||||||
|
|
||||||
| def test_foreman_proxy_service(server): | ||||||
|
|
@@ -38,3 +58,13 @@ def test_foreman_proxy_client_auth_to_foreman(server, certificates, server_fqdn) | |||||
| ) | ||||||
| assert cmd.succeeded | ||||||
| assert cmd.stdout == '201' | ||||||
|
|
||||||
|
|
||||||
| @pytest.mark.skipif("not is_bmc_enabled()") | ||||||
|
evgeni marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theforeman/smoker@1f7fd3a I implemented a mechanism in smoker to dynamically read the plugins. Perhaps for a follow up to implement this for enabled features so you can use:
Suggested change
That would provide a much more generic basis for testing features.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't help myself: #508. |
||||||
| def test_bmc_capabilities(server, certificates, server_fqdn): | ||||||
| features = get_proxy_v2_features(server, certificates, server_fqdn) | ||||||
| assert 'bmc' in features | ||||||
| capabilities = features['bmc'].get('capabilities', []) | ||||||
| assert 'ipmitool' in capabilities | ||||||
| assert 'freeipmi' in capabilities | ||||||
| assert 'redfish' in capabilities | ||||||
Uh oh!
There was an error while loading. Please reload this page.