Skip to content

Commit 5731e27

Browse files
[test_operator] Common default values for container images
test-operator currently supports 4 test frameworks: tempest, tobiko, horizontests and ansibletests. The relevant variables required to download their corresponding container images had to be configured separately, but usually were configured with common values. With this PR, default values for registry, namespace and tag can be configured and they apply to the 4 test frameworks.
1 parent 17a08ad commit 5731e27

File tree

2 files changed

+33
-25
lines changed

2 files changed

+33
-25
lines changed

roles/test_operator/README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/
2424
* `cifmw_test_operator_delete_logs_pod`: (Boolean) Delete tempest log pod created by the role at the end of the testing. Default value: `false`.
2525
* `cifmw_test_operator_privileged`: (Boolean) Spawn the test pods with `allowPrivilegedEscalation: true` and default linux capabilities. This is required for certain test-operator functionalities to work properly (e.g.: `extraRPMs`, certain set of tobiko tests). Default value: `true`
2626
* `cifmw_test_operator_selinux_level`: (String) Specify SELinux level that should be used for pods spawned with the test-operator. Note, that `cifmw_test_operator_privileged: true` must be set when this parameter has non-empty value. Default value: `s0:c478,c978`
27+
* `cifmw_test_operator_default_registry`: (String) Default registry for all the supported test frameworks (tempest, tobiko, horizontest and ansibletest) to pull their container images. It can be overridden at test framework level. Defaults to `quay.io`
28+
* `cifmw_test_operator_default_namespace`: (String) Default registry's namespace for all the supported test frameworks (tempest, tobiko, horizontest and ansibletest) to pull their container images. It can be overridden at test framework level. Defaults to `podified-antelope-centos9`
29+
* `cifmw_test_operator_default_image_tag`: (String) Default tag for all the supported test frameworks (tempest, tobiko, horizontest and ansibletest) to pull their container images. It can be overridden at test framework level. Defaults to `current-podified`
2730
* `cifmw_test_operator_stages`: (List) List of dictionaries defining the stages that should be used in the test operator role. List items options are:
2831
* `name`: (String) The name of the stage. The name must be unique.
2932
* `type`: (String) The framework name you would like to call, currently the options are: tempest, ansibletest, horizontest, tobiko.
3033
* `test_vars_file`: (String) Path to the file used for testing, this file should contain the testing params for this stage. Only parameters specific for the controller can be used (Tempest, Ansibletest, Horizontest and Tobiko).
3134
* `test_vars`: (String) Testing parameters for this specific stage if a `test_vars` is used the specified parameters would override the ones in the `test_vars_file`. Only parameters specific for the controller can be used (Tempest, Ansibletest, Horizontest and Tobiko).
32-
> Important note! Only variables with the following structure can be used to override inside a stage: `cifmw_test_operator_[test-operator CR name]_[parameter name]` the only exception to that is `cifmw_test_operator_concurrency` which can not be override inside a stage.
35+
> Important note! Only variables with the following structure can be used to override inside a stage: `cifmw_test_operator_[test-operator CR name]_[parameter name]`. For example, these variables cannot be overridden per stage: `cifmw_test_operator_concurrency`, `cifmw_test_operator_default_registry`, `cifmw_test_operator_default_namespace`, `cifmw_test_operator_default_image_tag`.
3336
* `pre_test_stage_hooks`: (List) List of pre hooks to run as described [hooks README](https://github.com/openstack-k8s-operators/ci-framework/tree/main/roles/run_hook#hooks-expected-format).
3437
* `post_test_stage_hooks`: (List) List of post hooks to run as described [hooks README](https://github.com/openstack-k8s-operators/ci-framework/tree/main/roles/run_hook#hooks-expected-format).
3538
Default value:
@@ -39,13 +42,14 @@ cifmw_test_operator_stages:
3942
type: tempest
4043
```
4144

45+
4246
## Tempest specific parameters
4347
* `cifmw_test_operator_tempest_name`: (String) Value used in the `Tempest.Metadata.Name` field. The value specifies the name of some resources spawned by the test-operator role. Default value: `tempest-tests`
44-
* `cifmw_test_operator_tempest_registry`: (String) The registry where to pull tempest container. Default value: `quay.io`
45-
* `cifmw_test_operator_tempest_namespace`: (String) Registry's namespace where to pull tempest container. Default value: `podified-antelope-centos9`
48+
* `cifmw_test_operator_tempest_registry`: (String) The registry where to pull tempest container. Default value: `{{ cifmw_test_operator_default_registry }}`
49+
* `cifmw_test_operator_tempest_namespace`: (String) Registry's namespace where to pull tempest container. Default value: `{{ cifmw_test_operator_default_namespace }}`
4650
* `cifmw_test_operator_tempest_container`: (String) Name of the tempest container. Default value: `openstack-tempest`
4751
* `cifmw_test_operator_tempest_image`: (String) Tempest image to be used. Default value: `{{ cifmw_test_operator_tempest_registry }}/{{ cifmw_test_operator_tempest_namespace }}/{{ cifmw_test_operator_tempest_container }}`
48-
* `cifmw_test_operator_tempest_image_tag`: (String) Tag for the `cifmw_test_operator_tempest_image`. Default value: `current-podified`
52+
* `cifmw_test_operator_tempest_image_tag`: (String) Tag for the `cifmw_test_operator_tempest_image`. Default value: `{{ cifmw_test_operator_default_image_tag }}`
4953
* `cifmw_test_operator_tempest_include_list`: (String) List of tests to be executed. Setting this will not use the `list_allowed` plugin. Default value: `''`
5054
* `cifmw_test_operator_tempest_exclude_list`: (String) List of tests to be skipped. Setting this will not use the `list_skipped` plugin. Default value: `''`
5155
* `cifmw_test_operator_tempest_expected_failures_list`: (String) List of tests for which failures will be ignored. Default value: `''`
@@ -97,11 +101,11 @@ Default value: {}
97101

98102
## Tobiko specific parameters
99103
* `cifmw_test_operator_tobiko_name`: (String) Value used in the `Tobiko.Metadata.Name` field. The value specifies the name of some resources spawned by the test-operator role. Default value: `tobiko-tests`
100-
* `cifmw_test_operator_tobiko_registry`: (String) The registry where to pull tobiko container. Default value: `quay.io`
101-
* `cifmw_test_operator_tobiko_namespace`: (String) Registry's namespace where to pull tobiko container. Default value: `podified-antelope-centos9`
104+
* `cifmw_test_operator_tobiko_registry`: (String) The registry where to pull tobiko container. Default value: `{{ cifmw_test_operator_default_registry }}`
105+
* `cifmw_test_operator_tobiko_namespace`: (String) Registry's namespace where to pull tobiko container. Default value: `{{ cifmw_test_operator_default_namespace }}`
102106
* `cifmw_test_operator_tobiko_container`: (String) Name of the tobiko container. Default value: `openstack-tobiko`
103107
* `cifmw_test_operator_tobiko_image`: (String) Tobiko image to be used. Default value: `{{ cifmw_test_operator_tobiko_registry }}/{{ cifmw_test_operator_tobiko_namespace }}/{{ cifmw_test_operator_tobiko_container }}`
104-
* `cifmw_test_operator_tobiko_image_tag`: (String) Tag for the `cifmw_test_operator_tobiko_image`. Default value: `current-podified`
108+
* `cifmw_test_operator_tobiko_image_tag`: (String) Tag for the `cifmw_test_operator_tobiko_image`. Default value: `{{ cifmw_test_operator_default_image_tag }}`
105109
* `cifmw_test_operator_tobiko_testenv`: (String) Executed tobiko testenv. See tobiko `tox.ini` file for further details. Some allowed values: scenario, sanity, faults, neutron, octavia, py3, etc. Default value: `scenario`
106110
* `cifmw_test_operator_tobiko_version`: (String) Tobiko version to install. It could refer to a branch (master, osp-16.2), a tag (0.6.x, 0.7.x) or an sha-1. Default value: `master`
107111
* `cifmw_test_operator_tobiko_pytest_addopts`: (String) `PYTEST_ADDOPTS` env variable with input pytest args. Example: `-m <markers> --maxfail <max-failed-tests> --skipregex <regex>`. Defaults to `null`. In case of `null` value, `PYTEST_ADDOPTS` is not set (tobiko tests are executed without any extra pytest options).
@@ -142,11 +146,11 @@ Default value: {}
142146

143147
## AnsibleTest specific parameters
144148
* `cifmw_test_operator_ansibletest_name`: (String) Value used in the `Ansibletest.Metadata.Name` field. The value specifies the name of some resources spawned by the test-operator role. Default value: `ansibletest`
145-
* `cifmw_test_operator_ansibletest_registry`: (String) The registry where to pull ansibletests container. Default value: `quay.io`
146-
* `cifmw_test_operator_ansibletest_namespace`: (String) Registry's namespace where to pull ansibletests container. Default value:podified-antelope-centos9
149+
* `cifmw_test_operator_ansibletest_registry`: (String) The registry where to pull ansibletests container. Default value: `{{ cifmw_test_operator_default_registry }}`
150+
* `cifmw_test_operator_ansibletest_namespace`: (String) Registry's namespace where to pull ansibletests container. Default value: `{{ cifmw_test_operator_default_namespace }}`
147151
* `cifmw_test_operator_ansibletest_container`: (String) Name of the ansibletests container. Default value: `openstack-ansible-tests`
148152
* `cifmw_test_operator_ansibletest_image`: (String) Ansibletests image to be used. Default value: `{{ cifmw_test_operator_ansibletest_registry }}/{{ cifmw_test_operator_ansibletest_namespace }}/{{ cifmw_test_operator_ansibletest_container }}`
149-
* `cifmw_test_operator_ansibletest_image_tag`: (String) Ansibletests image to be used. Default value: `current-podified`
153+
* `cifmw_test_operator_ansibletest_image_tag`: (String) Ansibletests image to be used. Default value: `{{ cifmw_test_operator_default_image_tag }}`
150154
* `cifmw_test_operator_ansibletest_compute_ssh_key_secret_name`: (String) The name of the k8s secret that contains an ssh key for computes. Default value: `dataplane-ansible-ssh-private-key-secret`
151155
* `cifmw_test_operator_ansibletest_workload_ssh_key_secret_name`: (String) The name of the k8s secret that contains an ssh key for the ansible workload. Default value: `""`
152156
* `cifmw_test_operator_ansibletest_ansible_git_repo`: (String) Git repo to clone into container. Default value: `""`
@@ -187,11 +191,11 @@ Default value: {}
187191

188192
## Horizontest specific parameters
189193
* `cifmw_test_operator_horizontest_name`: (String) Value used in the `Horizontest.Metadata.Name` field. The value specifies the name of some resources spawned by the test-operator role. Default value: `horizontest-tests`
190-
* `cifmw_test_operator_horizontest_registry`: (String) The registry where to pull horizontest container. Default value: `quay.io`
191-
* `cifmw_test_operator_horizontest_namespace`: (String) Registry's namespace where to pull horizontest container. Default value: `podified-antelope-centos9`
194+
* `cifmw_test_operator_horizontest_registry`: (String) The registry where to pull horizontest container. Default value: `{{ cifmw_test_operator_default_registry }}`
195+
* `cifmw_test_operator_horizontest_namespace`: (String) Registry's namespace where to pull horizontest container. Default value: `{{ cifmw_test_operator_default_namespace }}`
192196
* `cifmw_test_operator_horizontest_container`: (String) Name of the horizontest container. Default value: `openstack-horizontest`
193197
* `cifmw_test_operator_horizontest_image`: (String) Horizontest image to be used. Default value: `{{ cifmw_test_operator_horizontest_registry }}/{{ cifmw_test_operator_horizontest_namespace }}/{{ cifmw_test_operator_horizontest_container }}`
194-
* `cifmw_test_operator_horizontest_image_tag`: (String) Tag for the `cifmw_test_operator_horizontest_image`. Default value: `current-podified`
198+
* `cifmw_test_operator_horizontest_image_tag`: (String) Tag for the `cifmw_test_operator_horizontest_image`. Default value: `{{ cifmw_test_operator_default_image_tag }}`
195199
* `cifmw_test_operator_horizontest_admin_username`: (String) OpenStack admin credentials. Default value: `admin`
196200
* `cifmw_test_operator_horizontest_admin_password`: (String) OpenStack admin credentials. Default value: `12345678`
197201
* `cifmw_test_operator_horizontest_dashboard_url`: (String) The URL of the Horizon dashboard. Default value: `https://horizon-openstack.apps.ocp.openstack.lab/`

roles/test_operator/defaults/main.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@ cifmw_test_operator_storage_class: "{{ cifmw_test_operator_storage_class_prefix
4141
cifmw_test_operator_delete_logs_pod: false
4242
cifmw_test_operator_privileged: true
4343
cifmw_test_operator_selinux_level: "s0:c478,c978"
44+
# default test framework registry, namespace and tag can be overridden per test framework (tempest, tobiko, horizontest and ansibletest)
45+
cifmw_test_operator_default_registry: quay.io
46+
cifmw_test_operator_default_namespace: podified-antelope-centos9
47+
cifmw_test_operator_default_image_tag: current-podified
4448

4549
# Section 2: tempest parameters - used when run_test_fw is 'tempest'
4650
cifmw_test_operator_tempest_name: "tempest-tests"
47-
cifmw_test_operator_tempest_registry: quay.io
48-
cifmw_test_operator_tempest_namespace: podified-antelope-centos9
51+
cifmw_test_operator_tempest_registry: "{{ cifmw_test_operator_default_registry }}"
52+
cifmw_test_operator_tempest_namespace: "{{ cifmw_test_operator_default_namespace }}"
4953
cifmw_test_operator_tempest_container: openstack-tempest-all
5054
cifmw_test_operator_tempest_image: "{{ stage_vars_dict.cifmw_test_operator_tempest_registry }}/{{ stage_vars_dict.cifmw_test_operator_tempest_namespace }}/{{ stage_vars_dict.cifmw_test_operator_tempest_container }}"
51-
cifmw_test_operator_tempest_image_tag: current-podified
55+
cifmw_test_operator_tempest_image_tag: "{{ cifmw_test_operator_default_image_tag }}"
5256
cifmw_test_operator_tempest_network_attachments: []
5357
cifmw_test_operator_tempest_tests_include_override_scenario: false
5458
cifmw_test_operator_tempest_tests_exclude_override_scenario: false
@@ -137,11 +141,11 @@ cifmw_test_operator_tempest_config:
137141

138142
# Section 3: tobiko parameters - used when run_test_fw is 'tobiko'
139143
cifmw_test_operator_tobiko_name: "tobiko-tests"
140-
cifmw_test_operator_tobiko_registry: quay.io
141-
cifmw_test_operator_tobiko_namespace: podified-antelope-centos9
144+
cifmw_test_operator_tobiko_registry: "{{ cifmw_test_operator_default_registry }}"
145+
cifmw_test_operator_tobiko_namespace: "{{ cifmw_test_operator_default_namespace }}"
142146
cifmw_test_operator_tobiko_container: openstack-tobiko
143147
cifmw_test_operator_tobiko_image: "{{ stage_vars_dict.cifmw_test_operator_tobiko_registry }}/{{ stage_vars_dict.cifmw_test_operator_tobiko_namespace }}/{{ stage_vars_dict.cifmw_test_operator_tobiko_container }}"
144-
cifmw_test_operator_tobiko_image_tag: current-podified
148+
cifmw_test_operator_tobiko_image_tag: "{{ cifmw_test_operator_default_image_tag }}"
145149
cifmw_test_operator_tobiko_testenv: scenario
146150
cifmw_test_operator_tobiko_version: master
147151
cifmw_test_operator_tobiko_pytest_addopts: null
@@ -182,11 +186,11 @@ cifmw_test_operator_tobiko_config:
182186

183187
# Section 4: ansibletest parameters - used when run_test_fw is 'ansibletest'
184188
cifmw_test_operator_ansibletest_name: "ansibletest"
185-
cifmw_test_operator_ansibletest_registry: quay.io
186-
cifmw_test_operator_ansibletest_namespace: podified-antelope-centos9
189+
cifmw_test_operator_ansibletest_registry: "{{ cifmw_test_operator_default_registry }}"
190+
cifmw_test_operator_ansibletest_namespace: "{{ cifmw_test_operator_default_namespace }}"
187191
cifmw_test_operator_ansibletest_container: openstack-ansible-tests
188192
cifmw_test_operator_ansibletest_image: "{{ stage_vars_dict.cifmw_test_operator_ansibletest_registry }}/{{ stage_vars_dict.cifmw_test_operator_ansibletest_namespace }}/{{ stage_vars_dict.cifmw_test_operator_ansibletest_container }}"
189-
cifmw_test_operator_ansibletest_image_tag: current-podified
193+
cifmw_test_operator_ansibletest_image_tag: "{{ cifmw_test_operator_default_image_tag }}"
190194
cifmw_test_operator_ansibletest_compute_ssh_key_secret_name: "dataplane-ansible-ssh-private-key-secret"
191195
cifmw_test_operator_ansibletest_workload_ssh_key_secret_name: ""
192196
cifmw_test_operator_ansibletest_ansible_git_repo: ""
@@ -227,11 +231,11 @@ cifmw_test_operator_ansibletest_config:
227231

228232
# Section 5: horizontest parameters - used when run_test_fw is 'horizontest'
229233
cifmw_test_operator_horizontest_name: "horizontest-tests"
230-
cifmw_test_operator_horizontest_registry: quay.io
231-
cifmw_test_operator_horizontest_namespace: podified-antelope-centos9
234+
cifmw_test_operator_horizontest_registry: "{{ cifmw_test_operator_default_registry }}"
235+
cifmw_test_operator_horizontest_namespace: "{{ cifmw_test_operator_default_namespace }}"
232236
cifmw_test_operator_horizontest_container: openstack-horizontest
233237
cifmw_test_operator_horizontest_image: "{{ stage_vars_dict.cifmw_test_operator_horizontest_registry }}/{{ stage_vars_dict.cifmw_test_operator_horizontest_namespace }}/{{ stage_vars_dict.cifmw_test_operator_horizontest_container }}"
234-
cifmw_test_operator_horizontest_image_tag: current-podified
238+
cifmw_test_operator_horizontest_image_tag: "{{ cifmw_test_operator_default_image_tag }}"
235239
cifmw_test_operator_horizontest_admin_username: admin
236240
cifmw_test_operator_horizontest_admin_password: "12345678"
237241
cifmw_test_operator_horizontest_dashboard_url: "https://horizon-openstack.apps.ocp.openstack.lab/"

0 commit comments

Comments
 (0)