Skip to content

Commit ed9296a

Browse files
committed
[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 eab8350 commit ed9296a

File tree

2 files changed

+32
-24
lines changed

2 files changed

+32
-24
lines changed

roles/test_operator/README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/
2525
* `cifmw_test_operator_delete_logs_pod`: (Boolean) Delete tempest log pod created by the role at the end of the testing. Default value: `false`.
2626
* `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`
2727
* `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`
28+
* `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`
29+
* `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`
30+
* `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`
31+
2832

2933
## Tempest specific parameters
3034
* `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`
31-
* `cifmw_test_operator_tempest_registry`: (String) The registry where to pull tempest container. Default value: `quay.io`
32-
* `cifmw_test_operator_tempest_namespace`: (String) Registry's namespace where to pull tempest container. Default value: `podified-antelope-centos9`
35+
* `cifmw_test_operator_tempest_registry`: (String) The registry where to pull tempest container. Default value: `{{ cifmw_test_operator_default_registry }}`
36+
* `cifmw_test_operator_tempest_namespace`: (String) Registry's namespace where to pull tempest container. Default value: `{{ cifmw_test_operator_default_namespace }}`
3337
* `cifmw_test_operator_tempest_container`: (String) Name of the tempest container. Default value: `openstack-tempest`
3438
* `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 }}`
35-
* `cifmw_test_operator_tempest_image_tag`: (String) Tag for the `cifmw_test_operator_tempest_image`. Default value: `current-podified`
39+
* `cifmw_test_operator_tempest_image_tag`: (String) Tag for the `cifmw_test_operator_tempest_image`. Default value: `{{ cifmw_test_operator_default_image_tag }}`
3640
* `cifmw_test_operator_tempest_include_list`: (String) List of tests to be executed. Setting this will not use the `list_allowed` plugin. Default value: `''`
3741
* `cifmw_test_operator_tempest_exclude_list`: (String) List of tests to be skipped. Setting this will not use the `list_skipped` plugin. Default value: `''`
3842
* `cifmw_test_operator_tempest_expected_failures_list`: (String) List of tests for which failures will be ignored. Default value: `''`
@@ -76,11 +80,11 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/
7680

7781
## Tobiko specific parameters
7882
* `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`
79-
* `cifmw_test_operator_tobiko_registry`: (String) The registry where to pull tobiko container. Default value: `quay.io`
80-
* `cifmw_test_operator_tobiko_namespace`: (String) Registry's namespace where to pull tobiko container. Default value: `podified-antelope-centos9`
83+
* `cifmw_test_operator_tobiko_registry`: (String) The registry where to pull tobiko container. Default value: `{{ cifmw_test_operator_default_registry }}`
84+
* `cifmw_test_operator_tobiko_namespace`: (String) Registry's namespace where to pull tobiko container. Default value: `{{ cifmw_test_operator_default_namespace }}`
8185
* `cifmw_test_operator_tobiko_container`: (String) Name of the tobiko container. Default value: `openstack-tobiko`
8286
* `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 }}`
83-
* `cifmw_test_operator_tobiko_image_tag`: (String) Tag for the `cifmw_test_operator_tobiko_image`. Default value: `current-podified`
87+
* `cifmw_test_operator_tobiko_image_tag`: (String) Tag for the `cifmw_test_operator_tobiko_image`. Default value: `{{ cifmw_test_operator_default_image_tag }}`
8488
* `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`
8589
* `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`
8690
* `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).
@@ -121,11 +125,11 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/
121125

122126
## AnsibleTest specific parameters
123127
* `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`
124-
* `cifmw_test_operator_ansibletest_registry`: (String) The registry where to pull ansibletests container. Default value: `quay.io`
125-
* `cifmw_test_operator_ansibletest_namespace`: (String) Registry's namespace where to pull ansibletests container. Default value:podified-antelope-centos9
128+
* `cifmw_test_operator_ansibletest_registry`: (String) The registry where to pull ansibletests container. Default value: `{{ cifmw_test_operator_default_registry }}`
129+
* `cifmw_test_operator_ansibletest_namespace`: (String) Registry's namespace where to pull ansibletests container. Default value: `{{ cifmw_test_operator_default_namespace }}`
126130
* `cifmw_test_operator_ansibletest_container`: (String) Name of the ansibletests container. Default value: `openstack-ansible-tests`
127131
* `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 }}`
128-
* `cifmw_test_operator_ansibletest_image_tag`: (String) Ansibletests image to be used. Default value: `current-podified`
132+
* `cifmw_test_operator_ansibletest_image_tag`: (String) Ansibletests image to be used. Default value: `{{ cifmw_test_operator_default_image_tag }}`
129133
* `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`
130134
* `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: `""`
131135
* `cifmw_test_operator_ansibletest_ansible_git_repo`: (String) Git repo to clone into container. Default value: `""`
@@ -166,11 +170,11 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/
166170

167171
## Horizontest specific parameters
168172
* `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`
169-
* `cifmw_test_operator_horizontest_registry`: (String) The registry where to pull horizontest container. Default value: `quay.io`
170-
* `cifmw_test_operator_horizontest_namespace`: (String) Registry's namespace where to pull horizontest container. Default value: `podified-antelope-centos9`
173+
* `cifmw_test_operator_horizontest_registry`: (String) The registry where to pull horizontest container. Default value: `{{ cifmw_test_operator_default_registry }}`
174+
* `cifmw_test_operator_horizontest_namespace`: (String) Registry's namespace where to pull horizontest container. Default value: `{{ cifmw_test_operator_default_namespace }}`
171175
* `cifmw_test_operator_horizontest_container`: (String) Name of the horizontest container. Default value: `openstack-horizontest`
172176
* `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 }}`
173-
* `cifmw_test_operator_horizontest_image_tag`: (String) Tag for the `cifmw_test_operator_horizontest_image`. Default value: `current-podified`
177+
* `cifmw_test_operator_horizontest_image_tag`: (String) Tag for the `cifmw_test_operator_horizontest_image`. Default value: `{{ cifmw_test_operator_default_image_tag }}`
174178
* `cifmw_test_operator_horizontest_admin_username`: (String) OpenStack admin credentials. Default value: `admin`
175179
* `cifmw_test_operator_horizontest_admin_password`: (String) OpenStack admin credentials. Default value: `12345678`
176180
* `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
@@ -38,14 +38,18 @@ cifmw_test_operator_storage_class: "{{ cifmw_test_operator_storage_class_prefix
3838
cifmw_test_operator_delete_logs_pod: false
3939
cifmw_test_operator_privileged: true
4040
cifmw_test_operator_selinux_level: "s0:c478,c978"
41+
# default test framework registry, namespace and tag can be overridden per test framework (tempest, tobiko, horizontest and ansibletest)
42+
cifmw_test_operator_default_registry: quay.io
43+
cifmw_test_operator_default_namespace: podified-antelope-centos9
44+
cifmw_test_operator_default_image_tag: current-podified
4145

4246
# Section 2: tempest parameters - used when run_test_fw is 'tempest'
4347
cifmw_test_operator_tempest_name: "tempest-tests"
44-
cifmw_test_operator_tempest_registry: quay.io
45-
cifmw_test_operator_tempest_namespace: podified-antelope-centos9
48+
cifmw_test_operator_tempest_registry: "{{ cifmw_test_operator_default_registry }}"
49+
cifmw_test_operator_tempest_namespace: "{{ cifmw_test_operator_default_namespace }}"
4650
cifmw_test_operator_tempest_container: openstack-tempest-all
4751
cifmw_test_operator_tempest_image: "{{ cifmw_test_operator_tempest_registry }}/{{ cifmw_test_operator_tempest_namespace }}/{{ cifmw_test_operator_tempest_container }}"
48-
cifmw_test_operator_tempest_image_tag: current-podified
52+
cifmw_test_operator_tempest_image_tag: "{{ cifmw_test_operator_default_image_tag }}"
4953
cifmw_test_operator_tempest_network_attachments: []
5054
cifmw_test_operator_tempest_tests_include_override_scenario: false
5155
cifmw_test_operator_tempest_tests_exclude_override_scenario: false
@@ -133,11 +137,11 @@ cifmw_test_operator_tempest_config:
133137

134138
# Section 3: tobiko parameters - used when run_test_fw is 'tobiko'
135139
cifmw_test_operator_tobiko_name: "tobiko-tests"
136-
cifmw_test_operator_tobiko_registry: quay.io
137-
cifmw_test_operator_tobiko_namespace: podified-antelope-centos9
140+
cifmw_test_operator_tobiko_registry: "{{ cifmw_test_operator_default_registry }}"
141+
cifmw_test_operator_tobiko_namespace: "{{ cifmw_test_operator_default_namespace }}"
138142
cifmw_test_operator_tobiko_container: openstack-tobiko
139143
cifmw_test_operator_tobiko_image: "{{ cifmw_test_operator_tobiko_registry }}/{{ cifmw_test_operator_tobiko_namespace }}/{{ cifmw_test_operator_tobiko_container }}"
140-
cifmw_test_operator_tobiko_image_tag: current-podified
144+
cifmw_test_operator_tobiko_image_tag: "{{ cifmw_test_operator_default_image_tag }}"
141145
cifmw_test_operator_tobiko_testenv: scenario
142146
cifmw_test_operator_tobiko_version: master
143147
cifmw_test_operator_tobiko_pytest_addopts: null
@@ -178,11 +182,11 @@ cifmw_test_operator_tobiko_config:
178182

179183
# Section 4: ansibletest parameters - used when run_test_fw is 'ansibletest'
180184
cifmw_test_operator_ansibletest_name: "ansibletest"
181-
cifmw_test_operator_ansibletest_registry: quay.io
182-
cifmw_test_operator_ansibletest_namespace: podified-antelope-centos9
185+
cifmw_test_operator_ansibletest_registry: "{{ cifmw_test_operator_default_registry }}"
186+
cifmw_test_operator_ansibletest_namespace: "{{ cifmw_test_operator_default_namespace }}"
183187
cifmw_test_operator_ansibletest_container: openstack-ansible-tests
184188
cifmw_test_operator_ansibletest_image: "{{ cifmw_test_operator_ansibletest_registry }}/{{ cifmw_test_operator_ansibletest_namespace }}/{{ cifmw_test_operator_ansibletest_container }}"
185-
cifmw_test_operator_ansibletest_image_tag: current-podified
189+
cifmw_test_operator_ansibletest_image_tag: "{{ cifmw_test_operator_default_image_tag }}"
186190
cifmw_test_operator_ansibletest_compute_ssh_key_secret_name: "dataplane-ansible-ssh-private-key-secret"
187191
cifmw_test_operator_ansibletest_workload_ssh_key_secret_name: ""
188192
cifmw_test_operator_ansibletest_ansible_git_repo: ""
@@ -223,11 +227,11 @@ cifmw_test_operator_ansibletest_config:
223227

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

0 commit comments

Comments
 (0)