From 9bfa7b6efe9e67ec1896feeef38bbf2188fec1da Mon Sep 17 00:00:00 2001 From: Roberto Alfieri Date: Fri, 14 Aug 2026 11:03:49 +0200 Subject: [PATCH] Add s2i tempest e2e and KUTTL jobs Add two non-voting jobs that validate the openstack-tempest container image built by s2i-openstack-containers: 1. KUTTL job (test-operator-kuttl-s2i-tempest): patches the operator deployment to default to the s2i image, then runs the tempest-s2i KUTTL suite validating that the Tempest CR reconciles to Ready. 2. E2E job (podified-multinode-edpm-deployment-crc-test-operator-s2i-tempest): full CRC deployment using the s2i-built tempest image to run actual tempest tests against a live OpenStack environment. Both jobs depend on s2i-openstack-container-content-provider to build the tempest image from source via the buildset registry. Depends-On: https://github.com/openstack-k8s-operators/s2i-openstack-containers/pull/26 Depends-On: https://github.com/openstack-k8s-operators/s2i-openstack-containers/pull/66 Co-authored-by: Cursor --- .../tests/tempest-s2i/00-set-s2i-image.yaml | 12 ++++++ test/kuttl/tests/tempest-s2i/01-assert.yaml | 16 ++++++++ .../tests/tempest-s2i/01-deploy-tempest.yaml | 5 +++ test/kuttl/tests/tempest-s2i/99-cleanup.yaml | 6 +++ test/kuttl/tests/tempest-s2i/99-errors.yaml | 10 +++++ zuul.d/jobs.yaml | 37 +++++++++++++++++++ zuul.d/projects.yaml | 14 +++++++ 7 files changed, 100 insertions(+) create mode 100644 test/kuttl/tests/tempest-s2i/00-set-s2i-image.yaml create mode 100644 test/kuttl/tests/tempest-s2i/01-assert.yaml create mode 100644 test/kuttl/tests/tempest-s2i/01-deploy-tempest.yaml create mode 100644 test/kuttl/tests/tempest-s2i/99-cleanup.yaml create mode 100644 test/kuttl/tests/tempest-s2i/99-errors.yaml diff --git a/test/kuttl/tests/tempest-s2i/00-set-s2i-image.yaml b/test/kuttl/tests/tempest-s2i/00-set-s2i-image.yaml new file mode 100644 index 00000000..6d5014dc --- /dev/null +++ b/test/kuttl/tests/tempest-s2i/00-set-s2i-image.yaml @@ -0,0 +1,12 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: | + if [ -z "${S2I_TEMPEST_IMAGE}" ]; then + echo "S2I_TEMPEST_IMAGE is not set, skipping operator patch" + exit 0 + fi + echo "Patching test-operator with s2i tempest image: ${S2I_TEMPEST_IMAGE}" + oc -n openstack-operators set env deployment/test-operator-controller-manager \ + RELATED_IMAGE_TEST_TEMPEST_IMAGE_URL_DEFAULT="${S2I_TEMPEST_IMAGE}" + oc -n openstack-operators rollout status deployment/test-operator-controller-manager --timeout=120s diff --git a/test/kuttl/tests/tempest-s2i/01-assert.yaml b/test/kuttl/tests/tempest-s2i/01-assert.yaml new file mode 100644 index 00000000..31343b4c --- /dev/null +++ b/test/kuttl/tests/tempest-s2i/01-assert.yaml @@ -0,0 +1,16 @@ +apiVersion: test.openstack.org/v1beta1 +kind: Tempest +metadata: + name: tempest-sample +status: + conditions: + - type: Ready + status: "True" + - type: DeploymentReady + status: "True" + - type: InputReady + status: "True" + - type: NetworkAttachmentsReady + status: "True" + - type: ServiceConfigReady + status: "True" diff --git a/test/kuttl/tests/tempest-s2i/01-deploy-tempest.yaml b/test/kuttl/tests/tempest-s2i/01-deploy-tempest.yaml new file mode 100644 index 00000000..b7049185 --- /dev/null +++ b/test/kuttl/tests/tempest-s2i/01-deploy-tempest.yaml @@ -0,0 +1,5 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: | + oc kustomize ../../../../config/samples/layout/tempest | oc apply -f - diff --git a/test/kuttl/tests/tempest-s2i/99-cleanup.yaml b/test/kuttl/tests/tempest-s2i/99-cleanup.yaml new file mode 100644 index 00000000..91a2f550 --- /dev/null +++ b/test/kuttl/tests/tempest-s2i/99-cleanup.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +delete: +- apiVersion: test.openstack.org/v1beta1 + kind: Tempest + name: tempest-sample diff --git a/test/kuttl/tests/tempest-s2i/99-errors.yaml b/test/kuttl/tests/tempest-s2i/99-errors.yaml new file mode 100644 index 00000000..bc31cd04 --- /dev/null +++ b/test/kuttl/tests/tempest-s2i/99-errors.yaml @@ -0,0 +1,10 @@ +apiVersion: test.openstack.org/v1beta1 +kind: Tempest +metadata: + name: tempest-sample +--- +apiVersion: v1 +kind: Pod +metadata: + labels: + instanceName: tempest-sample diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index a8e8f389..0443a0f4 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -217,3 +217,40 @@ override-checkout: main - name: github.com/openstack-k8s-operators/openstack-must-gather override-checkout: main + +- job: + name: test-operator-kuttl-s2i-tempest + parent: test-operator-kuttl + description: | + KUTTL test using the s2i-built openstack-tempest container image. + Patches the test-operator deployment to default to the s2i image, + then runs the tempest-s2i KUTTL suite which validates that the + Tempest CR reconciles to Ready with the s2i image. + required-projects: + - name: openstack-k8s-operators/s2i-openstack-containers + override-checkout: main + vars: + cifmw_kuttl_tests_env_vars: + PV_NUM: 20 + S2I_TEMPEST_IMAGE: >- + {{ s2i_ci_content.registry }}/{{ s2i_ci_content.namespace }}/openstack-tempest:{{ s2i_ci_content.tag }} + +- job: + name: podified-multinode-edpm-deployment-crc-test-operator-s2i-tempest + parent: podified-multinode-edpm-deployment-crc-test-operator + description: | + E2E test using the s2i-built openstack-tempest container image. + Validates that the tempest image built by s2i-openstack-containers + works correctly with the test-operator against a live OpenStack + deployment. + required-projects: + - name: openstack-k8s-operators/s2i-openstack-containers + override-checkout: main + vars: + cifmw_test_operator_stages: + - name: tempest + type: tempest + cifmw_test_operator_tempest_registry: "{{ s2i_ci_content.registry }}" + cifmw_test_operator_tempest_namespace: "{{ s2i_ci_content.namespace }}" + cifmw_test_operator_tempest_container: openstack-tempest + cifmw_test_operator_tempest_image_tag: "{{ s2i_ci_content.tag }}" diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 50a2c727..5f76cbca 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -6,9 +6,23 @@ - openstack-k8s-operators-content-provider: vars: cifmw_install_yamls_sdk_version: v1.41.1 + - s2i-openstack-container-content-provider: + vars: + s2i_ci_images: + - tempest/tempest - test-operator-kuttl: dependencies: - openstack-k8s-operators-content-provider + - test-operator-kuttl-s2i-tempest: + voting: false + dependencies: + - openstack-k8s-operators-content-provider + - s2i-openstack-container-content-provider - podified-multinode-edpm-deployment-crc-test-operator: dependencies: - openstack-k8s-operators-content-provider + - podified-multinode-edpm-deployment-crc-test-operator-s2i-tempest: + voting: false + dependencies: + - openstack-k8s-operators-content-provider + - s2i-openstack-container-content-provider