From 2de618a699fc519cdbea2c0dfb48a3336e6f2ea9 Mon Sep 17 00:00:00 2001 From: Kasia Koziol Date: Thu, 2 Oct 2025 09:30:21 +0200 Subject: [PATCH 1/6] CSPL-3558 Integ tests init --- ...AL2023-build-test-push-workflow-AL2023.yml | 1 + .../arm-AL2023-int-test-workflow.yml | 1 + .../arm-RHEL-build-test-push-workflow.yml | 1 + .../workflows/arm-RHEL-int-test-workflow.yml | 1 + .../arm-Ubuntu-build-test-push-workflow.yml | 1 + .../arm-Ubuntu-int-test-workflow.yml | 1 + .../workflows/build-test-push-workflow.yml | 1 + .../distroless-build-test-push-workflow.yml | 1 + .../distroless-int-test-workflow.yml | 1 + .github/workflows/int-test-workflow.yml | 1 + .../workflows/manual-int-test-workflow.yml | 1 + .../namespace-scope-int-workflow.yml | 1 + .../workflows/nightly-int-test-workflow.yml | 1 + go.mod | 1 + go.sum | 23 ++++ .../c3/appframework_aws_test.go | 2 +- .../c3/manager_appframework_test.go | 4 +- .../c3/appframework_azure_test.go | 2 +- .../c3/manager_appframework_azure_test.go | 2 +- .../c3/manager_appframework_test.go | 4 +- ...dex_and_ingestion_separation_suite_test.go | 57 ++++++++ .../index_and_ingestion_separation_test.go | 122 ++++++++++++++++++ test/testenv/deployment.go | 48 ++++--- test/testenv/util.go | 37 +++++- test/testenv/verificationutils.go | 28 ++++ 25 files changed, 317 insertions(+), 26 deletions(-) create mode 100644 test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go create mode 100644 test/index_and_ingestion_separation/index_and_ingestion_separation_test.go diff --git a/.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml b/.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml index 9122120fe..aec3def7b 100644 --- a/.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml +++ b/.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml @@ -120,6 +120,7 @@ jobs: appframeworksS1, managersecret, managermc, + indexingestseparation, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/arm-AL2023-int-test-workflow.yml b/.github/workflows/arm-AL2023-int-test-workflow.yml index a75d447d7..37d8812e8 100644 --- a/.github/workflows/arm-AL2023-int-test-workflow.yml +++ b/.github/workflows/arm-AL2023-int-test-workflow.yml @@ -68,6 +68,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, + indexingestseparation, ] runs-on: ubuntu-latest needs: build-operator-image-arm-al2023 diff --git a/.github/workflows/arm-RHEL-build-test-push-workflow.yml b/.github/workflows/arm-RHEL-build-test-push-workflow.yml index b27986330..1b79b531a 100644 --- a/.github/workflows/arm-RHEL-build-test-push-workflow.yml +++ b/.github/workflows/arm-RHEL-build-test-push-workflow.yml @@ -68,6 +68,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, + indexingestseparation, ] runs-on: ubuntu-latest needs: build-operator-image-arm-rhel diff --git a/.github/workflows/arm-RHEL-int-test-workflow.yml b/.github/workflows/arm-RHEL-int-test-workflow.yml index b27986330..1b79b531a 100644 --- a/.github/workflows/arm-RHEL-int-test-workflow.yml +++ b/.github/workflows/arm-RHEL-int-test-workflow.yml @@ -68,6 +68,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, + indexingestseparation, ] runs-on: ubuntu-latest needs: build-operator-image-arm-rhel diff --git a/.github/workflows/arm-Ubuntu-build-test-push-workflow.yml b/.github/workflows/arm-Ubuntu-build-test-push-workflow.yml index b382cf2b5..1449178ec 100644 --- a/.github/workflows/arm-Ubuntu-build-test-push-workflow.yml +++ b/.github/workflows/arm-Ubuntu-build-test-push-workflow.yml @@ -120,6 +120,7 @@ jobs: appframeworksS1, managersecret, managermc, + indexingestseparation, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/arm-Ubuntu-int-test-workflow.yml b/.github/workflows/arm-Ubuntu-int-test-workflow.yml index 6218d7eda..3806a9654 100644 --- a/.github/workflows/arm-Ubuntu-int-test-workflow.yml +++ b/.github/workflows/arm-Ubuntu-int-test-workflow.yml @@ -68,6 +68,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, + indexingestseparation, ] runs-on: ubuntu-latest needs: build-operator-image-arm-ubuntu diff --git a/.github/workflows/build-test-push-workflow.yml b/.github/workflows/build-test-push-workflow.yml index 1943889a7..568823343 100644 --- a/.github/workflows/build-test-push-workflow.yml +++ b/.github/workflows/build-test-push-workflow.yml @@ -166,6 +166,7 @@ jobs: managerappframeworkm4, managersecret, managermc, + indexingestseparation, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/distroless-build-test-push-workflow.yml b/.github/workflows/distroless-build-test-push-workflow.yml index d6c6c350a..77dc5fa40 100644 --- a/.github/workflows/distroless-build-test-push-workflow.yml +++ b/.github/workflows/distroless-build-test-push-workflow.yml @@ -165,6 +165,7 @@ jobs: managerappframeworkm4, managersecret, managermc, + indexingestseparation, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/distroless-int-test-workflow.yml b/.github/workflows/distroless-int-test-workflow.yml index 16bd4c607..320a2692a 100644 --- a/.github/workflows/distroless-int-test-workflow.yml +++ b/.github/workflows/distroless-int-test-workflow.yml @@ -64,6 +64,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, + indexingestseparation, ] runs-on: ubuntu-latest needs: build-operator-image-distroless diff --git a/.github/workflows/int-test-workflow.yml b/.github/workflows/int-test-workflow.yml index 4922d63bc..4af8fee67 100644 --- a/.github/workflows/int-test-workflow.yml +++ b/.github/workflows/int-test-workflow.yml @@ -61,6 +61,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, + indexingestseparation, ] runs-on: ubuntu-latest needs: build-operator-image diff --git a/.github/workflows/manual-int-test-workflow.yml b/.github/workflows/manual-int-test-workflow.yml index f35a590a4..d83a56759 100644 --- a/.github/workflows/manual-int-test-workflow.yml +++ b/.github/workflows/manual-int-test-workflow.yml @@ -23,6 +23,7 @@ jobs: managerscaling, managercrcrud, licensemanager, + indexingestseparation, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/namespace-scope-int-workflow.yml b/.github/workflows/namespace-scope-int-workflow.yml index 7ee81d35d..6fc6138eb 100644 --- a/.github/workflows/namespace-scope-int-workflow.yml +++ b/.github/workflows/namespace-scope-int-workflow.yml @@ -19,6 +19,7 @@ jobs: managerscaling, managercrcrud, licensemanager, + indexingestseparation, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/nightly-int-test-workflow.yml b/.github/workflows/nightly-int-test-workflow.yml index 7da08c44c..03187afe8 100644 --- a/.github/workflows/nightly-int-test-workflow.yml +++ b/.github/workflows/nightly-int-test-workflow.yml @@ -59,6 +59,7 @@ jobs: managerscaling, managercrcrud, licensemanager, + indexingestseparation, ] runs-on: ubuntu-latest needs: build-operator-image diff --git a/go.mod b/go.mod index 8f24791da..e499de5bf 100644 --- a/go.mod +++ b/go.mod @@ -103,6 +103,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect + github.com/onsi/ginkgo v1.16.5 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.1 // indirect diff --git a/go.sum b/go.sum index 107db504c..f91f845f7 100644 --- a/go.sum +++ b/go.sum @@ -110,6 +110,8 @@ github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0 github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= @@ -129,6 +131,7 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -193,6 +196,7 @@ github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -245,8 +249,16 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus= github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.38.0 h1:c/WX+w8SLAinvuKKQFh77WEucCnPk4j2OTUr7lt7BeY= github.com/onsi/gomega v1.38.0/go.mod h1:OcXcwId0b9QsE7Y49u+BTrL4IdKOBOKnD6VQNTJEB6o= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -352,6 +364,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -359,6 +372,7 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -384,13 +398,18 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -422,6 +441,7 @@ golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= @@ -479,13 +499,16 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/test/appframework_aws/c3/appframework_aws_test.go b/test/appframework_aws/c3/appframework_aws_test.go index cd241e2eb..8a7d267bc 100644 --- a/test/appframework_aws/c3/appframework_aws_test.go +++ b/test/appframework_aws/c3/appframework_aws_test.go @@ -3182,7 +3182,7 @@ var _ = Describe("c3appfw test", func() { // Deploy the Indexer Cluster testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster") indexerReplicas := 3 - _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "") + _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster") // Deploy the Search Head Cluster diff --git a/test/appframework_aws/c3/manager_appframework_test.go b/test/appframework_aws/c3/manager_appframework_test.go index e00da4428..46cfc94b6 100644 --- a/test/appframework_aws/c3/manager_appframework_test.go +++ b/test/appframework_aws/c3/manager_appframework_test.go @@ -355,7 +355,7 @@ var _ = Describe("c3appfw test", func() { shcName := fmt.Sprintf("%s-shc", deployment.GetName()) idxName := fmt.Sprintf("%s-idxc", deployment.GetName()) shc, err := deployment.DeploySearchHeadCluster(ctx, shcName, cm.GetName(), lm.GetName(), "", mcName) - idxc, err := deployment.DeployIndexerCluster(ctx, idxName, lm.GetName(), 3, cm.GetName(), "") + idxc, err := deployment.DeployIndexerCluster(ctx, idxName, lm.GetName(), 3, cm.GetName(), "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") // Wait for License Manager to be in READY phase testenv.LicenseManagerReady(ctx, deployment, testcaseEnvInst) @@ -3324,7 +3324,7 @@ var _ = Describe("c3appfw test", func() { // Deploy the Indexer Cluster testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster") indexerReplicas := 3 - _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "") + _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster") // Deploy the Search Head Cluster diff --git a/test/appframework_az/c3/appframework_azure_test.go b/test/appframework_az/c3/appframework_azure_test.go index a79d4941a..19c365517 100644 --- a/test/appframework_az/c3/appframework_azure_test.go +++ b/test/appframework_az/c3/appframework_azure_test.go @@ -993,7 +993,7 @@ var _ = Describe("c3appfw test", func() { // Deploy the Indexer Cluster testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster") indexerReplicas := 3 - _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "") + _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster") // Deploy the Search Head Cluster diff --git a/test/appframework_az/c3/manager_appframework_azure_test.go b/test/appframework_az/c3/manager_appframework_azure_test.go index 2422d3e85..05b652d16 100644 --- a/test/appframework_az/c3/manager_appframework_azure_test.go +++ b/test/appframework_az/c3/manager_appframework_azure_test.go @@ -991,7 +991,7 @@ var _ = Describe("c3appfw test", func() { // Deploy the Indexer Cluster testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster") indexerReplicas := 3 - _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "") + _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster") // Deploy the Search Head Cluster diff --git a/test/appframework_gcp/c3/manager_appframework_test.go b/test/appframework_gcp/c3/manager_appframework_test.go index 02b7c81be..756f962c4 100644 --- a/test/appframework_gcp/c3/manager_appframework_test.go +++ b/test/appframework_gcp/c3/manager_appframework_test.go @@ -361,7 +361,7 @@ var _ = Describe("c3appfw test", func() { shcName := fmt.Sprintf("%s-shc", deployment.GetName()) idxName := fmt.Sprintf("%s-idxc", deployment.GetName()) shc, err := deployment.DeploySearchHeadCluster(ctx, shcName, cm.GetName(), lm.GetName(), "", mcName) - idxc, err := deployment.DeployIndexerCluster(ctx, idxName, lm.GetName(), 3, cm.GetName(), "") + idxc, err := deployment.DeployIndexerCluster(ctx, idxName, lm.GetName(), 3, cm.GetName(), "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") // Wait for License Manager to be in READY phase testenv.LicenseManagerReady(ctx, deployment, testcaseEnvInst) @@ -3327,7 +3327,7 @@ var _ = Describe("c3appfw test", func() { // Deploy the Indexer Cluster testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster") indexerReplicas := 3 - _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "") + _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", indexerReplicas, deployment.GetName(), "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster") // Deploy the Search Head Cluster diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go new file mode 100644 index 000000000..106a0d221 --- /dev/null +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go @@ -0,0 +1,57 @@ +// Copyright (c) 2018-2025 Splunk Inc. All rights reserved. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package indexingestsep + +import ( + "testing" + "time" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/splunk/splunk-operator/test/testenv" +) + +const ( + // PollInterval specifies the polling interval + PollInterval = 5 * time.Second + + // ConsistentPollInterval is the interval to use to consistently check a state is stable + ConsistentPollInterval = 200 * time.Millisecond + ConsistentDuration = 2000 * time.Millisecond +) + +var ( + testenvInstance *testenv.TestEnv + testSuiteName = "indexingestsep-" + testenv.RandomDNSName(3) +) + +// TestBasic is the main entry point +func TestBasic(t *testing.T) { + RegisterFailHandler(Fail) + + RunSpecs(t, "Running "+testSuiteName) +} + +var _ = BeforeSuite(func() { + var err error + testenvInstance, err = testenv.NewDefaultTestEnv(testSuiteName) + Expect(err).ToNot(HaveOccurred()) +}) + +var _ = AfterSuite(func() { + if testenvInstance != nil { + Expect(testenvInstance.Teardown()).ToNot(HaveOccurred()) + } +}) diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go new file mode 100644 index 000000000..bf6ce87a2 --- /dev/null +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go @@ -0,0 +1,122 @@ +// Copyright (c) 2018-2025 Splunk Inc. All rights reserved. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package indexingestsep + +import ( + "context" + "fmt" + + "github.com/onsi/ginkgo/types" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + enterpriseApi "github.com/splunk/splunk-operator/api/v4" + + "github.com/splunk/splunk-operator/test/testenv" +) + +var _ = Describe("indexingestsep test", func() { + + var testcaseEnvInst *testenv.TestCaseEnv + var deployment *testenv.Deployment + + ctx := context.TODO() + + BeforeEach(func() { + var err error + + name := fmt.Sprintf("%s-%s", "master"+testenvInstance.GetName(), testenv.RandomDNSName(3)) + testcaseEnvInst, err = testenv.NewDefaultTestCaseEnv(testenvInstance.GetKubeClient(), name) + Expect(err).To(Succeed(), "Unable to create testcaseenv") + + deployment, err = testcaseEnvInst.NewDeployment(testenv.RandomDNSName(3)) + Expect(err).To(Succeed(), "Unable to create deployment") + }) + + AfterEach(func() { + if types.SpecState(CurrentSpecReport().State) == types.SpecStateFailed { + testcaseEnvInst.SkipTeardown = true + } + if deployment != nil { + deployment.Teardown() + } + + if testcaseEnvInst != nil { + Expect(testcaseEnvInst.Teardown()).ToNot(HaveOccurred()) + } + }) + + Context("Ingestor and Indexer deployment", func() { + It("indexingestsep, smoke, indexingestseparation: Splunk Operator can configure Ingestors and Indexers", func() { + // Deploy Cluster Manager + testcaseEnvInst.Log.Info("Deploy Cluster Manager") + cmSpec := enterpriseApi.ClusterManagerSpec{ + CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ + Spec: enterpriseApi.Spec{ + ImagePullPolicy: "Always", + Image: testcaseEnvInst.GetSplunkImage(), + }, + }, + } + _, err := deployment.DeployClusterManagerWithGivenSpec(ctx, deployment.GetName(), cmSpec) + Expect(err).To(Succeed(), "Unable to deploy Cluster Manager") + + // Create Service Account + serviceAccountName := "index-ingest-sa" + testcaseEnvInst.CreateServiceAccount(serviceAccountName) + + // Deploy Indexer Cluster + testcaseEnvInst.Log.Info("Deploy Indexer Cluster") + pullBus := enterpriseApi.PushBusSpec{ + Type: "sqs_smartbus", + SQS: enterpriseApi.SQSSpec{ + QueueName: "test-queue", + AuthRegion: "us-west-2", + Endpoint: "https://sqs.us-west-2.amazonaws.com", + LargeMessageStoreEndpoint: "https://s3.us-west-2.amazonaws.com", + LargeMessageStorePath: "s3://test-bucket/smartbus-test", + DeadLetterQueueName: "test-dead-letter-queue", + MaxRetriesPerPart: 4, + RetryPolicy: "max_count", + SendInterval: "5s", + EncodingFormat: "s2s", + }, + } + pipelineConfig := enterpriseApi.PipelineConfigSpec{ + RemoteQueueRuleset: false, + RuleSet: true, + RemoteQueueTyping: false, + RemoteQueueOutput: false, + Typing: true, + IndexerPipe: true, + } + _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", 3, deployment.GetName(), "", pullBus, pipelineConfig, serviceAccountName) + Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster") + + // Deploy Ingestor Cluster + testcaseEnvInst.Log.Info("Deploy Ingestor Cluster") + _, err = deployment.DeployIngestorCluster(ctx, deployment.GetName()+"-ingest", 3, pullBus, pipelineConfig, serviceAccountName) + Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster") + + // Ensure that Cluster Manager is in Ready phase + testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst) + + // Ensure that Indexer Cluster is in Ready phase + testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) + + // Ensure that Ingestor Cluster is in Ready phase + testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + }) + }) +}) diff --git a/test/testenv/deployment.go b/test/testenv/deployment.go index 85e753a84..85ea4ada9 100644 --- a/test/testenv/deployment.go +++ b/test/testenv/deployment.go @@ -431,9 +431,9 @@ func (d *Deployment) DeployClusterMasterWithSmartStoreIndexes(ctx context.Contex } // DeployIndexerCluster deploys the indexer cluster -func (d *Deployment) DeployIndexerCluster(ctx context.Context, name, LicenseManagerName string, count int, clusterManagerRef string, ansibleConfig string) (*enterpriseApi.IndexerCluster, error) { +func (d *Deployment) DeployIndexerCluster(ctx context.Context, name, LicenseManagerName string, count int, clusterManagerRef string, ansibleConfig string, busSpec enterpriseApi.PushBusSpec, pipelineConfig enterpriseApi.PipelineConfigSpec, serviceAccountName string) (*enterpriseApi.IndexerCluster, error) { d.testenv.Log.Info("Deploying indexer cluster", "name", name, "CM", clusterManagerRef) - indexer := newIndexerCluster(name, d.testenv.namespace, LicenseManagerName, count, clusterManagerRef, ansibleConfig, d.testenv.splunkImage) + indexer := newIndexerCluster(name, d.testenv.namespace, LicenseManagerName, count, clusterManagerRef, ansibleConfig, d.testenv.splunkImage, busSpec, pipelineConfig, serviceAccountName) pdata, _ := json.Marshal(indexer) d.testenv.Log.Info("indexer cluster spec", "cr", string(pdata)) deployed, err := d.deployCR(ctx, name, indexer) @@ -444,6 +444,22 @@ func (d *Deployment) DeployIndexerCluster(ctx context.Context, name, LicenseMana return deployed.(*enterpriseApi.IndexerCluster), err } +// DeployIngestorCluster deploys the ingestor cluster +func (d *Deployment) DeployIngestorCluster(ctx context.Context, name string, count int, busSpec enterpriseApi.PushBusSpec, pipelineConfig enterpriseApi.PipelineConfigSpec, serviceAccountName string) (*enterpriseApi.IngestorCluster, error) { + d.testenv.Log.Info("Deploying ingestor cluster", "name", name) + + ingestor := newIngestorCluster(name, d.testenv.namespace, count, d.testenv.splunkImage, busSpec, pipelineConfig, serviceAccountName) + pdata, _ := json.Marshal(ingestor) + + d.testenv.Log.Info("ingestor cluster spec", "cr", string(pdata)) + deployed, err := d.deployCR(ctx, name, ingestor) + if err != nil { + return nil, err + } + + return deployed.(*enterpriseApi.IngestorCluster), err +} + // DeploySearchHeadCluster deploys a search head cluster func (d *Deployment) DeploySearchHeadCluster(ctx context.Context, name, ClusterManagerRef, LicenseManagerName string, ansibleConfig string, mcRef string) (*enterpriseApi.SearchHeadCluster, error) { d.testenv.Log.Info("Deploying search head cluster", "name", name) @@ -675,7 +691,7 @@ func (d *Deployment) DeploySingleSiteCluster(ctx context.Context, name string, i } // Deploy the indexer cluster - _, err := d.DeployIndexerCluster(ctx, name+"-idxc", LicenseManager, indexerReplicas, name, "") + _, err := d.DeployIndexerCluster(ctx, name+"-idxc", LicenseManager, indexerReplicas, name, "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } @@ -733,7 +749,7 @@ func (d *Deployment) DeployMultisiteClusterMasterWithSearchHead(ctx context.Cont multisite_master: splunk-%s-%s-service site: %s `, name, "cluster-master", siteName) - _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseMaster, indexerReplicas, name, siteDefaults) + _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseMaster, indexerReplicas, name, siteDefaults, enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } @@ -805,7 +821,7 @@ func (d *Deployment) DeployMultisiteClusterWithSearchHead(ctx context.Context, n multisite_master: splunk-%s-%s-service site: %s `, name, "cluster-manager", siteName) - _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseManager, indexerReplicas, name, siteDefaults) + _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseManager, indexerReplicas, name, siteDefaults, enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } @@ -866,7 +882,7 @@ func (d *Deployment) DeployMultisiteCluster(ctx context.Context, name string, in multisite_master: splunk-%s-%s-service site: %s `, name, "cluster-manager", siteName) - _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseManager, indexerReplicas, name, siteDefaults) + _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseManager, indexerReplicas, name, siteDefaults, enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } @@ -1002,7 +1018,7 @@ func (d *Deployment) DeployMultisiteClusterWithSearchHeadAndIndexes(ctx context. multisite_master: splunk-%s-%s-service site: %s `, name, "cluster-manager", siteName) - _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseManager, indexerReplicas, name, siteDefaults) + _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseManager, indexerReplicas, name, siteDefaults, enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } @@ -1057,7 +1073,7 @@ func (d *Deployment) DeployMultisiteClusterMasterWithSearchHeadAndIndexes(ctx co multisite_master: splunk-%s-%s-service site: %s `, name, "cluster-master", siteName) - _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseManager, indexerReplicas, name, siteDefaults) + _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, LicenseManager, indexerReplicas, name, siteDefaults, enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } @@ -1162,7 +1178,7 @@ func (d *Deployment) DeploySingleSiteClusterWithGivenAppFrameworkSpec(ctx contex } // Deploy the indexer cluster - idxc, err = d.DeployIndexerCluster(ctx, name+"-idxc", licenseManager, indexerReplicas, name, "") + idxc, err = d.DeployIndexerCluster(ctx, name+"-idxc", licenseManager, indexerReplicas, name, "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return cm, idxc, sh, err } @@ -1240,7 +1256,7 @@ func (d *Deployment) DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx } // Deploy the indexer cluster - idxc, err = d.DeployIndexerCluster(ctx, name+"-idxc", licenseMaster, indexerReplicas, name, "") + idxc, err = d.DeployIndexerCluster(ctx, name+"-idxc", licenseMaster, indexerReplicas, name, "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return cm, idxc, sh, err } @@ -1340,7 +1356,7 @@ func (d *Deployment) DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx con multisite_master: splunk-%s-%s-service site: %s `, name, "cluster-manager", siteName) - idxc, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, licenseManager, indexerReplicas, name, siteDefaults) + idxc, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, licenseManager, indexerReplicas, name, siteDefaults, enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return cm, idxc, sh, err } @@ -1444,7 +1460,7 @@ func (d *Deployment) DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(c multisite_master: splunk-%s-%s-service site: %s `, name, "cluster-master", siteName) - idxc, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, licenseMaster, indexerReplicas, name, siteDefaults) + idxc, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, licenseMaster, indexerReplicas, name, siteDefaults, enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return cm, idxc, sh, err } @@ -1525,7 +1541,7 @@ func (d *Deployment) DeploySingleSiteClusterWithGivenMonitoringConsole(ctx conte } // Deploy the indexer cluster - _, err = d.DeployIndexerCluster(ctx, name+"-idxc", licenseManager, indexerReplicas, name, "") + _, err = d.DeployIndexerCluster(ctx, name+"-idxc", licenseManager, indexerReplicas, name, "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } @@ -1597,7 +1613,7 @@ func (d *Deployment) DeploySingleSiteClusterMasterWithGivenMonitoringConsole(ctx } // Deploy the indexer cluster - _, err = d.DeployIndexerCluster(ctx, name+"-idxc", licenseMaster, indexerReplicas, name, "") + _, err = d.DeployIndexerCluster(ctx, name+"-idxc", licenseMaster, indexerReplicas, name, "", enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } @@ -1691,7 +1707,7 @@ func (d *Deployment) DeployMultisiteClusterWithMonitoringConsole(ctx context.Con multisite_master: splunk-%s-%s-service site: %s `, name, "cluster-manager", siteName) - _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, licenseManager, indexerReplicas, name, siteDefaults) + _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, licenseManager, indexerReplicas, name, siteDefaults, enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } @@ -1791,7 +1807,7 @@ func (d *Deployment) DeployMultisiteClusterMasterWithMonitoringConsole(ctx conte multisite_master: splunk-%s-%s-service site: %s `, name, "cluster-master", siteName) - _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, licenseMaster, indexerReplicas, name, siteDefaults) + _, err := d.DeployIndexerCluster(ctx, name+"-"+siteName, licenseMaster, indexerReplicas, name, siteDefaults, enterpriseApi.PushBusSpec{}, enterpriseApi.PipelineConfigSpec{}, "") if err != nil { return err } diff --git a/test/testenv/util.go b/test/testenv/util.go index fce1b58b1..357af2b0f 100644 --- a/test/testenv/util.go +++ b/test/testenv/util.go @@ -357,7 +357,7 @@ func newClusterMasterWithGivenIndexes(name, ns, licenseManagerName, ansibleConfi } // newIndexerCluster creates and initialize the CR for IndexerCluster Kind -func newIndexerCluster(name, ns, licenseManagerName string, replicas int, clusterManagerRef, ansibleConfig, splunkImage string) *enterpriseApi.IndexerCluster { +func newIndexerCluster(name, ns, licenseManagerName string, replicas int, clusterManagerRef, ansibleConfig, splunkImage string, busSpec enterpriseApi.PushBusSpec, pipelineConfig enterpriseApi.PipelineConfigSpec, serviceAccountName string) *enterpriseApi.IndexerCluster { licenseMasterRef, licenseManagerRef := swapLicenseManager(name, licenseManagerName) clusterMasterRef, clusterManagerRef := swapClusterManager(name, clusterManagerRef) @@ -374,7 +374,8 @@ func newIndexerCluster(name, ns, licenseManagerName string, replicas int, cluste Spec: enterpriseApi.IndexerClusterSpec{ CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Volumes: []corev1.Volume{}, + ServiceAccount: serviceAccountName, + Volumes: []corev1.Volume{}, Spec: enterpriseApi.Spec{ ImagePullPolicy: "Always", Image: splunkImage, @@ -393,13 +394,43 @@ func newIndexerCluster(name, ns, licenseManagerName string, replicas int, cluste }, Defaults: ansibleConfig, }, - Replicas: int32(replicas), + Replicas: int32(replicas), + PipelineConfig: pipelineConfig, + PullBus: busSpec, }, } return &new } +// newIngestorCluster creates and initialize the CR for IngestorCluster Kind +func newIngestorCluster(name, ns string, replicas int, splunkImage string, busSpec enterpriseApi.PushBusSpec, pipelineConfig enterpriseApi.PipelineConfigSpec, serviceAccountName string) *enterpriseApi.IngestorCluster { + return &enterpriseApi.IngestorCluster{ + TypeMeta: metav1.TypeMeta{ + Kind: "IngestorCluster", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: ns, + Finalizers: []string{"enterprise.splunk.com/delete-pvc"}, + }, + + Spec: enterpriseApi.IngestorClusterSpec{ + CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ + ServiceAccount: serviceAccountName, + Volumes: []corev1.Volume{}, + Spec: enterpriseApi.Spec{ + ImagePullPolicy: "Always", + Image: splunkImage, + }, + }, + Replicas: int32(replicas), + PipelineConfig: pipelineConfig, + PushBus: busSpec, + }, + } +} + func newSearchHeadCluster(name, ns, clusterManagerRef, licenseManagerName, ansibleConfig, splunkImage string) *enterpriseApi.SearchHeadCluster { licenseMasterRef, licenseManagerRef := swapLicenseManager(name, licenseManagerName) diff --git a/test/testenv/verificationutils.go b/test/testenv/verificationutils.go index e5c734405..6ec2cc310 100644 --- a/test/testenv/verificationutils.go +++ b/test/testenv/verificationutils.go @@ -185,6 +185,34 @@ func SingleSiteIndexersReady(ctx context.Context, deployment *Deployment, testen }, ConsistentDuration, ConsistentPollInterval).Should(gomega.Equal(enterpriseApi.PhaseReady)) } +// IngestorsReady verify ingestors go to ready state +func IngestorReady(ctx context.Context, deployment *Deployment, testenvInstance *TestCaseEnv) { + ingest := &enterpriseApi.IngestorCluster{} + instanceName := fmt.Sprintf("%s-ingest", deployment.GetName()) + + gomega.Eventually(func() enterpriseApi.Phase { + err := deployment.GetInstance(ctx, instanceName, ingest) + if err != nil { + return enterpriseApi.PhaseError + } + + testenvInstance.Log.Info("Waiting for ingestor instance's phase to be ready", "instance", instanceName, "phase", ingest.Status.Phase) + DumpGetPods(testenvInstance.GetName()) + + return ingest.Status.Phase + }, deployment.GetTimeout(), PollInterval).Should(gomega.Equal(enterpriseApi.PhaseReady)) + + // In a steady state, we should stay in Ready and not flip-flop around + gomega.Consistently(func() enterpriseApi.Phase { + _ = deployment.GetInstance(ctx, instanceName, ingest) + + testenvInstance.Log.Info("Check for Consistency ingestor instance's phase to be ready", "instance", instanceName, "phase", ingest.Status.Phase) + DumpGetSplunkVersion(ctx, testenvInstance.GetName(), deployment, "-ingest-") + + return ingest.Status.Phase + }, ConsistentDuration, ConsistentPollInterval).Should(gomega.Equal(enterpriseApi.PhaseReady)) +} + // ClusterManagerReady verify Cluster Manager Instance is in ready status func ClusterManagerReady(ctx context.Context, deployment *Deployment, testenvInstance *TestCaseEnv) { // Ensure that the cluster-manager goes to Ready phase From 03931398b533b19946f243cd13cd507374043767 Mon Sep 17 00:00:00 2001 From: Kasia Koziol Date: Thu, 2 Oct 2025 12:00:40 +0200 Subject: [PATCH 2/6] CSPL-3558 Adding extra validation for integraion test --- ...AL2023-build-test-push-workflow-AL2023.yml | 2 +- .../arm-AL2023-int-test-workflow.yml | 2 +- .../arm-RHEL-build-test-push-workflow.yml | 2 +- .../workflows/arm-RHEL-int-test-workflow.yml | 2 +- .../arm-Ubuntu-build-test-push-workflow.yml | 2 +- .../arm-Ubuntu-int-test-workflow.yml | 2 +- .../workflows/build-test-push-workflow.yml | 2 +- .../distroless-build-test-push-workflow.yml | 2 +- .../distroless-int-test-workflow.yml | 2 +- .github/workflows/int-test-workflow.yml | 2 +- .../workflows/manual-int-test-workflow.yml | 2 +- .../namespace-scope-int-workflow.yml | 2 +- .../workflows/nightly-int-test-workflow.yml | 2 +- ...dex_and_ingestion_separation_suite_test.go | 4 +- .../index_and_ingestion_separation_test.go | 175 ++++++++++++++++-- test/testenv/util.go | 30 +++ 16 files changed, 205 insertions(+), 30 deletions(-) diff --git a/.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml b/.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml index aec3def7b..d354dfd5e 100644 --- a/.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml +++ b/.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml @@ -120,7 +120,7 @@ jobs: appframeworksS1, managersecret, managermc, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/arm-AL2023-int-test-workflow.yml b/.github/workflows/arm-AL2023-int-test-workflow.yml index 37d8812e8..8862b6dc3 100644 --- a/.github/workflows/arm-AL2023-int-test-workflow.yml +++ b/.github/workflows/arm-AL2023-int-test-workflow.yml @@ -68,7 +68,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest needs: build-operator-image-arm-al2023 diff --git a/.github/workflows/arm-RHEL-build-test-push-workflow.yml b/.github/workflows/arm-RHEL-build-test-push-workflow.yml index 1b79b531a..eb2580800 100644 --- a/.github/workflows/arm-RHEL-build-test-push-workflow.yml +++ b/.github/workflows/arm-RHEL-build-test-push-workflow.yml @@ -68,7 +68,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest needs: build-operator-image-arm-rhel diff --git a/.github/workflows/arm-RHEL-int-test-workflow.yml b/.github/workflows/arm-RHEL-int-test-workflow.yml index 1b79b531a..eb2580800 100644 --- a/.github/workflows/arm-RHEL-int-test-workflow.yml +++ b/.github/workflows/arm-RHEL-int-test-workflow.yml @@ -68,7 +68,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest needs: build-operator-image-arm-rhel diff --git a/.github/workflows/arm-Ubuntu-build-test-push-workflow.yml b/.github/workflows/arm-Ubuntu-build-test-push-workflow.yml index 1449178ec..8606c1da6 100644 --- a/.github/workflows/arm-Ubuntu-build-test-push-workflow.yml +++ b/.github/workflows/arm-Ubuntu-build-test-push-workflow.yml @@ -120,7 +120,7 @@ jobs: appframeworksS1, managersecret, managermc, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/arm-Ubuntu-int-test-workflow.yml b/.github/workflows/arm-Ubuntu-int-test-workflow.yml index 3806a9654..3084d9307 100644 --- a/.github/workflows/arm-Ubuntu-int-test-workflow.yml +++ b/.github/workflows/arm-Ubuntu-int-test-workflow.yml @@ -68,7 +68,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest needs: build-operator-image-arm-ubuntu diff --git a/.github/workflows/build-test-push-workflow.yml b/.github/workflows/build-test-push-workflow.yml index 568823343..bc5e28998 100644 --- a/.github/workflows/build-test-push-workflow.yml +++ b/.github/workflows/build-test-push-workflow.yml @@ -166,7 +166,7 @@ jobs: managerappframeworkm4, managersecret, managermc, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/distroless-build-test-push-workflow.yml b/.github/workflows/distroless-build-test-push-workflow.yml index 77dc5fa40..f1fda9f10 100644 --- a/.github/workflows/distroless-build-test-push-workflow.yml +++ b/.github/workflows/distroless-build-test-push-workflow.yml @@ -165,7 +165,7 @@ jobs: managerappframeworkm4, managersecret, managermc, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/distroless-int-test-workflow.yml b/.github/workflows/distroless-int-test-workflow.yml index 320a2692a..8250b379c 100644 --- a/.github/workflows/distroless-int-test-workflow.yml +++ b/.github/workflows/distroless-int-test-workflow.yml @@ -64,7 +64,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest needs: build-operator-image-distroless diff --git a/.github/workflows/int-test-workflow.yml b/.github/workflows/int-test-workflow.yml index 4af8fee67..b89bbd28e 100644 --- a/.github/workflows/int-test-workflow.yml +++ b/.github/workflows/int-test-workflow.yml @@ -61,7 +61,7 @@ jobs: managercrcrud, licensemanager, managerdeletecr, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest needs: build-operator-image diff --git a/.github/workflows/manual-int-test-workflow.yml b/.github/workflows/manual-int-test-workflow.yml index d83a56759..ca5299cb7 100644 --- a/.github/workflows/manual-int-test-workflow.yml +++ b/.github/workflows/manual-int-test-workflow.yml @@ -23,7 +23,7 @@ jobs: managerscaling, managercrcrud, licensemanager, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/namespace-scope-int-workflow.yml b/.github/workflows/namespace-scope-int-workflow.yml index 6fc6138eb..8a1365f1e 100644 --- a/.github/workflows/namespace-scope-int-workflow.yml +++ b/.github/workflows/namespace-scope-int-workflow.yml @@ -19,7 +19,7 @@ jobs: managerscaling, managercrcrud, licensemanager, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest env: diff --git a/.github/workflows/nightly-int-test-workflow.yml b/.github/workflows/nightly-int-test-workflow.yml index 03187afe8..10fde82be 100644 --- a/.github/workflows/nightly-int-test-workflow.yml +++ b/.github/workflows/nightly-int-test-workflow.yml @@ -59,7 +59,7 @@ jobs: managerscaling, managercrcrud, licensemanager, - indexingestseparation, + indingsep, ] runs-on: ubuntu-latest needs: build-operator-image diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go index 106a0d221..d73d50691 100644 --- a/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -package indexingestsep +package indingsep import ( "testing" @@ -34,7 +34,7 @@ const ( var ( testenvInstance *testenv.TestEnv - testSuiteName = "indexingestsep-" + testenv.RandomDNSName(3) + testSuiteName = "indingsep-" + testenv.RandomDNSName(3) ) // TestBasic is the main entry point diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go index bf6ce87a2..b67929820 100644 --- a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go @@ -11,11 +11,12 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -package indexingestsep +package indingsep import ( "context" "fmt" + "strings" "github.com/onsi/ginkgo/types" . "github.com/onsi/ginkgo/v2" @@ -26,7 +27,7 @@ import ( "github.com/splunk/splunk-operator/test/testenv" ) -var _ = Describe("indexingestsep test", func() { +var _ = Describe("indingsep test", func() { var testcaseEnvInst *testenv.TestCaseEnv var deployment *testenv.Deployment @@ -36,7 +37,7 @@ var _ = Describe("indexingestsep test", func() { BeforeEach(func() { var err error - name := fmt.Sprintf("%s-%s", "master"+testenvInstance.GetName(), testenv.RandomDNSName(3)) + name := fmt.Sprintf("%s-%s", testenvInstance.GetName(), testenv.RandomDNSName(3)) testcaseEnvInst, err = testenv.NewDefaultTestCaseEnv(testenvInstance.GetKubeClient(), name) Expect(err).To(Succeed(), "Unable to create testcaseenv") @@ -58,7 +59,40 @@ var _ = Describe("indexingestsep test", func() { }) Context("Ingestor and Indexer deployment", func() { - It("indexingestsep, smoke, indexingestseparation: Splunk Operator can configure Ingestors and Indexers", func() { + It("indingsep, smoke, indingsep: Splunk Operator can configure Ingestors and Indexers", func() { + bus := enterpriseApi.PushBusSpec{ + Type: "sqs_smartbus", + SQS: enterpriseApi.SQSSpec{ + QueueName: "test-queue", + AuthRegion: "us-west-2", + Endpoint: "https://sqs.us-west-2.amazonaws.com", + LargeMessageStoreEndpoint: "https://s3.us-west-2.amazonaws.com", + LargeMessageStorePath: "s3://test-bucket/smartbus-test", + DeadLetterQueueName: "test-dead-letter-queue", + MaxRetriesPerPart: 4, + RetryPolicy: "max_count", + SendInterval: "5s", + EncodingFormat: "s2s", + }, + } + pipelineConfig := enterpriseApi.PipelineConfigSpec{ + RemoteQueueRuleset: false, + RuleSet: true, + RemoteQueueTyping: false, + RemoteQueueOutput: false, + Typing: true, + IndexerPipe: true, + } + serviceAccountName := "index-ingest-sa" + + // Create Service Account + testcaseEnvInst.CreateServiceAccount(serviceAccountName) + + // Deploy Ingestor Cluster + testcaseEnvInst.Log.Info("Deploy Ingestor Cluster") + _, err := deployment.DeployIngestorCluster(ctx, deployment.GetName()+"-ingest", 3, bus, pipelineConfig, serviceAccountName) + Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster") + // Deploy Cluster Manager testcaseEnvInst.Log.Info("Deploy Cluster Manager") cmSpec := enterpriseApi.ClusterManagerSpec{ @@ -69,16 +103,28 @@ var _ = Describe("indexingestsep test", func() { }, }, } - _, err := deployment.DeployClusterManagerWithGivenSpec(ctx, deployment.GetName(), cmSpec) + _, err = deployment.DeployClusterManagerWithGivenSpec(ctx, deployment.GetName(), cmSpec) Expect(err).To(Succeed(), "Unable to deploy Cluster Manager") - // Create Service Account - serviceAccountName := "index-ingest-sa" - testcaseEnvInst.CreateServiceAccount(serviceAccountName) - // Deploy Indexer Cluster testcaseEnvInst.Log.Info("Deploy Indexer Cluster") - pullBus := enterpriseApi.PushBusSpec{ + _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", 3, deployment.GetName(), "", bus, pipelineConfig, serviceAccountName) + Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster") + + // Ensure that Ingestor Cluster is in Ready phase + testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + + // Ensure that Cluster Manager is in Ready phase + testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst) + + // Ensure that Indexer Cluster is in Ready phase + testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) + }) + }) + + Context("Ingestor and Indexer deployment", func() { + It("indingsep, integration, indingsep: Splunk Operator can configure Ingestors and Indexers", func() { + bus := enterpriseApi.PushBusSpec{ Type: "sqs_smartbus", SQS: enterpriseApi.SQSSpec{ QueueName: "test-queue", @@ -101,22 +147,121 @@ var _ = Describe("indexingestsep test", func() { Typing: true, IndexerPipe: true, } - _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", 3, deployment.GetName(), "", pullBus, pipelineConfig, serviceAccountName) - Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster") + serviceAccountName := "index-ingest-sa" + + // Create Service Account + testcaseEnvInst.CreateServiceAccount(serviceAccountName) // Deploy Ingestor Cluster testcaseEnvInst.Log.Info("Deploy Ingestor Cluster") - _, err = deployment.DeployIngestorCluster(ctx, deployment.GetName()+"-ingest", 3, pullBus, pipelineConfig, serviceAccountName) + _, err := deployment.DeployIngestorCluster(ctx, deployment.GetName()+"-ingest", 3, bus, pipelineConfig, serviceAccountName) Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster") + // Deploy Cluster Manager + testcaseEnvInst.Log.Info("Deploy Cluster Manager") + cmSpec := enterpriseApi.ClusterManagerSpec{ + CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ + Spec: enterpriseApi.Spec{ + ImagePullPolicy: "Always", + Image: testcaseEnvInst.GetSplunkImage(), + }, + }, + } + _, err = deployment.DeployClusterManagerWithGivenSpec(ctx, deployment.GetName(), cmSpec) + Expect(err).To(Succeed(), "Unable to deploy Cluster Manager") + + // Deploy Indexer Cluster + testcaseEnvInst.Log.Info("Deploy Indexer Cluster") + _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", 3, deployment.GetName(), "", bus, pipelineConfig, serviceAccountName) + Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster") + + // Ensure that Ingestor Cluster is in Ready phase + testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + // Ensure that Cluster Manager is in Ready phase testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst) // Ensure that Indexer Cluster is in Ready phase testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) - // Ensure that Ingestor Cluster is in Ready phase - testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + // Get instance of current Ingestor Cluster CR with latest config + ingest := &enterpriseApi.IngestorCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-ingest", ingest) + Expect(err).To(Succeed(), "Failed to get instance of Ingestor Cluster") + + // Verify Ingestor Cluster Status + Expect(ingest.Status.PushBus).To(Equal(bus), "Ingestor PushBus status is not the same as provided as input") + Expect(ingest.Status.PipelineConfig).To(Equal(pipelineConfig), "Ingestor PipelineConfig status is not the same as provided as input") + + // Get instance of current Indexer Cluster CR with latest config + index := &enterpriseApi.IndexerCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-idxc", index) + Expect(err).To(Succeed(), "Failed to get instance of Indexer Cluster") + + // Verify Indexer Cluster Status + Expect(index.Status.PullBus).To(Equal(bus), "Indexer PullBus status is not the same as provided as input") + Expect(index.Status.PipelineConfig).To(Equal(pipelineConfig), "Indexer PipelineConfig status is not the same as provided as input") + + // Verify conf files + pods := testenv.DumpGetPods(deployment.GetName()) + for _, pod := range pods { + defaultsConf := "" + + if strings.Contains(pod, "ingest") || strings.Contains(pod, "idxc") { + // Get outputs.conf + outputsPath := "opt/splunk/etc/system/local/outputs.conf" + outputsConf, err := testenv.GetConfFile(pod, outputsPath, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get outputs.conf from Ingestor Cluster pod") + Expect(outputsConf).To(ContainSubstring("[remote_queue:test-queue]"), "outputs.conf does not contain smartbus queue name configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.type = sqs_smartbus"), "outputs.conf does not contain smartbus type configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.auth_region = us-west-2"), "outputs.conf does not contain smartbus region configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.dead_letter_queue.name = test-dead-letter-queue"), "outputs.conf does not contain smartbus dead letter queue configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.encoding_format = s2s"), "outputs.conf does not contain smartbus encoding format configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.endpoint = https://sqs.us-west-2.amazonaws.com"), "outputs.conf does not contain smartbus endpoint configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.large_message_store.endpoint = https://s3.us-west-2.amazonaws.com"), "outputs.conf does not contain smartbus large message store endpoint configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.large_message_store.path = s3://test-bucket/smartbus-test"), "outputs.conf does not contain smartbus large message store path configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.retry_policy = max_count"), "outputs.conf does not contain smartbus retry policy configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.send_interval = 5s"), "outputs.conf does not contain smartbus send interval configuration") + Expect(outputsConf).To(ContainSubstring("remote_queue.max_count.sqs_smartbus.max_retries_per_part = 4"), "outputs.conf does not contain smartbus max retries per part configuration") + + // Get default-mode.conf + defaultsPath := "opt/splunk/etc/system/local/default-mode.conf" + defaultsConf, err := testenv.GetConfFile(pod, defaultsPath, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get default-mode.conf from Ingestor Cluster pod") + Expect(defaultsConf).To(ContainSubstring("[pipeline:remotequeueruleset]\ndisabled = false"), "default-mode.conf does not contain remote queue ruleset stanza") + Expect(defaultsConf).To(ContainSubstring("[pipeline:ruleset]\ndisabled = true"), "default-mode.conf does not contain ruleset stanza") + Expect(defaultsConf).To(ContainSubstring("[pipeline:remotequeuetyping]\ndisabled = false"), "default-mode.conf does not contain remote queue typing stanza") + Expect(defaultsConf).To(ContainSubstring("[pipeline:remotequeueoutput]\ndisabled = false"), "default-mode.conf does not contain remote queue output stanza") + Expect(defaultsConf).To(ContainSubstring("[pipeline:typing]\ndisabled = true"), "default-mode.conf does not contain typing stanza") + + // Get AWS env variables + envVars, err := testenv.GetAWSEnv(pod, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get AWS env variables from Ingestor Cluster pod") + Expect(envVars).To(ContainSubstring("AWS_REGION=us-west-2"), "AWS env variables do not contain region") + Expect(envVars).To(ContainSubstring("AWS_DEFAULT_REGION=us-west-2"), "AWS env variables do not contain default region") + Expect(envVars).To(ContainSubstring("AWS_WEB_IDENTITY_TOKEN_FILE=/var/run/secrets/eks.amazonaws.com/serviceaccount/token"), "AWS env variables do not contain web identity token file") + Expect(envVars).To(ContainSubstring("AWS_ROLE_ARN=arn:aws:iam::"), "AWS env variables do not contain role arn") + Expect(envVars).To(ContainSubstring("AWS_STS_REGIONAL_ENDPOINTS=regional"), "AWS env variables do not contain STS regional endpoints") + } + + if strings.Contains(pod, "ingest") { + Expect(defaultsConf).To(ContainSubstring("[pipeline:indexerPipe]\ndisabled = true"), "default-mode.conf does not contain indexer pipe stanza") + } else if strings.Contains(pod, "idxc") { + // Get inputs.conf + inputsPath := "opt/splunk/etc/system/local/inputs.conf" + inputsConf, err := testenv.GetConfFile(pod, inputsPath, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get inputs.conf from Indexer Cluster pod") + Expect(inputsConf).To(ContainSubstring("[remote_queue:test-queue]"), "inputs.conf does not contain smartbus queue name configuration") + Expect(inputsConf).To(ContainSubstring("remote_queue.type = sqs_smartbus"), "inputs.conf does not contain smartbus type configuration") + Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.auth_region = us-west-2"), "inputs.conf does not contain smartbus region configuration") + Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.dead_letter_queue.name = test-dead-letter-queue"), "inputs.conf does not contain smartbus dead letter queue configuration") + Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.endpoint = https://sqs.us-west-2.amazonaws.com"), "inputs.conf does not contain smartbus endpoint configuration") + Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.large_message_store.endpoint = https://s3.us-west-2.amazonaws.com"), "inputs.conf does not contain smartbus large message store endpoint configuration") + Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.large_message_store.path = s3://test-bucket/smartbus-test"), "inputs.conf does not contain smartbus large message store path configuration") + Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.retry_policy = max_count"), "inputs.conf does not contain smartbus retry policy configuration") + Expect(inputsConf).To(ContainSubstring("remote_queue.max_count.sqs_smartbus.max_retries_per_part = 4"), "inputs.conf does not contain smartbus max retries per part configuration") + } + } }) }) }) diff --git a/test/testenv/util.go b/test/testenv/util.go index 357af2b0f..64065af8d 100644 --- a/test/testenv/util.go +++ b/test/testenv/util.go @@ -1219,3 +1219,33 @@ func DeleteConfigMap(ns string, ConfigMapName string) error { } return nil } + +// GetConfFile gets config file from pod +func GetConfFile(podName, filePath, ns string) (string, error) { + var config string + var err error + + output, err := exec.Command("kubectl", "exec", "-n", ns, podName, "--", "cat", filePath).Output() + if err != nil { + cmd := fmt.Sprintf("kubectl exec -n %s %s -- cat %s", ns, podName, filePath) + logf.Log.Error(err, "Failed to execute command", "command", cmd) + return config, err + } + + return string(output), err +} + +// GetAWSEnv gets AWS environment variables from pod +func GetAWSEnv(podName, ns string) (string, error) { + var config string + var err error + + output, err := exec.Command("kubectl", "exec", "-n", ns, podName, "--", "env", "|", "grep", "-i", "aws").Output() + if err != nil { + cmd := fmt.Sprintf("kubectl exec -n %s %s -- env | grep -i aws", ns, podName) + logf.Log.Error(err, "Failed to execute command", "command", cmd) + return config, err + } + + return string(output), err +} From 4d3865ccef5b79d9e51632d9f8ced39c0ab86fd1 Mon Sep 17 00:00:00 2001 From: Kasia Koziol Date: Thu, 2 Oct 2025 14:43:06 +0200 Subject: [PATCH 3/6] CSPL-3558 Refactoring --- ...dex_and_ingestion_separation_suite_test.go | 54 +++++++ .../index_and_ingestion_separation_test.go | 146 +++++------------- test/testenv/util.go | 10 ++ 3 files changed, 106 insertions(+), 104 deletions(-) diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go index d73d50691..235f85f79 100644 --- a/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go @@ -20,6 +20,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + enterpriseApi "github.com/splunk/splunk-operator/api/v4" "github.com/splunk/splunk-operator/test/testenv" ) @@ -35,6 +36,59 @@ const ( var ( testenvInstance *testenv.TestEnv testSuiteName = "indingsep-" + testenv.RandomDNSName(3) + + bus = enterpriseApi.PushBusSpec{ + Type: "sqs_smartbus", + SQS: enterpriseApi.SQSSpec{ + QueueName: "test-queue", + AuthRegion: "us-west-2", + Endpoint: "https://sqs.us-west-2.amazonaws.com", + LargeMessageStoreEndpoint: "https://s3.us-west-2.amazonaws.com", + LargeMessageStorePath: "s3://test-bucket/smartbus-test", + DeadLetterQueueName: "test-dead-letter-queue", + MaxRetriesPerPart: 4, + RetryPolicy: "max_count", + SendInterval: "5s", + EncodingFormat: "s2s", + }, + } + pipelineConfig = enterpriseApi.PipelineConfigSpec{ + RemoteQueueRuleset: false, + RuleSet: true, + RemoteQueueTyping: false, + RemoteQueueOutput: false, + Typing: true, + IndexerPipe: true, + } + serviceAccountName = "index-ingest-sa" + + inputs = []string{ + "[remote_queue:test-queue]", + "remote_queue.type = sqs_smartbus", + "remote_queue.sqs_smartbus.auth_region = us-west-2", + "remote_queue.sqs_smartbus.dead_letter_queue.name = test-dead-letter-queue", + "remote_queue.sqs_smartbus.endpoint = https://sqs.us-west-2.amazonaws.com", + "remote_queue.sqs_smartbus.large_message_store.endpoint = https://s3.us-west-2.amazonaws.com", + "remote_queue.sqs_smartbus.large_message_store.path = s3://test-bucket/smartbus-test", + "remote_queue.sqs_smartbus.retry_policy = max_count", + "remote_queue.max_count.sqs_smartbus.max_retries_per_part = 4"} + outputs = append(inputs, "remote_queue.sqs_smartbus.encoding_format = s2s", "remote_queue.sqs_smartbus.send_interval = 5s") + defaultsAll = []string{ + "[pipeline:remotequeueruleset]\ndisabled = false", + "[pipeline:ruleset]\ndisabled = true", + "[pipeline:remotequeuetyping]\ndisabled = false", + "[pipeline:remotequeueoutput]\ndisabled = false", + "[pipeline:typing]\ndisabled = true", + } + defaultsIngest = append(defaultsAll, "[pipeline:indexerPipe]\ndisabled = true") + + awsEnvVars = []string{ + "AWS_REGION=us-west-2", + "AWS_DEFAULT_REGION=us-west-2", + "AWS_WEB_IDENTITY_TOKEN_FILE=/var/run/secrets/eks.amazonaws.com/serviceaccount/token", + "AWS_ROLE_ARN=arn:aws:iam::", + "AWS_STS_REGIONAL_ENDPOINTS=regional", + } ) // TestBasic is the main entry point diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go index b67929820..5ee126899 100644 --- a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go @@ -32,6 +32,8 @@ var _ = Describe("indingsep test", func() { var testcaseEnvInst *testenv.TestCaseEnv var deployment *testenv.Deployment + var cmSpec enterpriseApi.ClusterManagerSpec + ctx := context.TODO() BeforeEach(func() { @@ -43,6 +45,15 @@ var _ = Describe("indingsep test", func() { deployment, err = testcaseEnvInst.NewDeployment(testenv.RandomDNSName(3)) Expect(err).To(Succeed(), "Unable to create deployment") + + cmSpec = enterpriseApi.ClusterManagerSpec{ + CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ + Spec: enterpriseApi.Spec{ + ImagePullPolicy: "Always", + Image: testcaseEnvInst.GetSplunkImage(), + }, + }, + } }) AfterEach(func() { @@ -59,33 +70,9 @@ var _ = Describe("indingsep test", func() { }) Context("Ingestor and Indexer deployment", func() { - It("indingsep, smoke, indingsep: Splunk Operator can configure Ingestors and Indexers", func() { - bus := enterpriseApi.PushBusSpec{ - Type: "sqs_smartbus", - SQS: enterpriseApi.SQSSpec{ - QueueName: "test-queue", - AuthRegion: "us-west-2", - Endpoint: "https://sqs.us-west-2.amazonaws.com", - LargeMessageStoreEndpoint: "https://s3.us-west-2.amazonaws.com", - LargeMessageStorePath: "s3://test-bucket/smartbus-test", - DeadLetterQueueName: "test-dead-letter-queue", - MaxRetriesPerPart: 4, - RetryPolicy: "max_count", - SendInterval: "5s", - EncodingFormat: "s2s", - }, - } - pipelineConfig := enterpriseApi.PipelineConfigSpec{ - RemoteQueueRuleset: false, - RuleSet: true, - RemoteQueueTyping: false, - RemoteQueueOutput: false, - Typing: true, - IndexerPipe: true, - } - serviceAccountName := "index-ingest-sa" - + It("indingsep, smoke, indingsep: Splunk Operator can deploy Ingestors and Indexers", func() { // Create Service Account + testcaseEnvInst.Log.Info("Create Service Account") testcaseEnvInst.CreateServiceAccount(serviceAccountName) // Deploy Ingestor Cluster @@ -95,14 +82,6 @@ var _ = Describe("indingsep test", func() { // Deploy Cluster Manager testcaseEnvInst.Log.Info("Deploy Cluster Manager") - cmSpec := enterpriseApi.ClusterManagerSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - }, - } _, err = deployment.DeployClusterManagerWithGivenSpec(ctx, deployment.GetName(), cmSpec) Expect(err).To(Succeed(), "Unable to deploy Cluster Manager") @@ -112,44 +91,23 @@ var _ = Describe("indingsep test", func() { Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster") // Ensure that Ingestor Cluster is in Ready phase + testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster is in Ready phase") testenv.IngestorReady(ctx, deployment, testcaseEnvInst) // Ensure that Cluster Manager is in Ready phase + testcaseEnvInst.Log.Info("Ensure that Cluster Manager is in Ready phase") testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst) // Ensure that Indexer Cluster is in Ready phase + testcaseEnvInst.Log.Info("Ensure that Indexer Cluster is in Ready phase") testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) }) }) Context("Ingestor and Indexer deployment", func() { - It("indingsep, integration, indingsep: Splunk Operator can configure Ingestors and Indexers", func() { - bus := enterpriseApi.PushBusSpec{ - Type: "sqs_smartbus", - SQS: enterpriseApi.SQSSpec{ - QueueName: "test-queue", - AuthRegion: "us-west-2", - Endpoint: "https://sqs.us-west-2.amazonaws.com", - LargeMessageStoreEndpoint: "https://s3.us-west-2.amazonaws.com", - LargeMessageStorePath: "s3://test-bucket/smartbus-test", - DeadLetterQueueName: "test-dead-letter-queue", - MaxRetriesPerPart: 4, - RetryPolicy: "max_count", - SendInterval: "5s", - EncodingFormat: "s2s", - }, - } - pipelineConfig := enterpriseApi.PipelineConfigSpec{ - RemoteQueueRuleset: false, - RuleSet: true, - RemoteQueueTyping: false, - RemoteQueueOutput: false, - Typing: true, - IndexerPipe: true, - } - serviceAccountName := "index-ingest-sa" - + It("indingsep, integration, indingsep: Splunk Operator can deploy Ingestors and Indexers with correct setup", func() { // Create Service Account + testcaseEnvInst.Log.Info("Create Service Account") testcaseEnvInst.CreateServiceAccount(serviceAccountName) // Deploy Ingestor Cluster @@ -159,14 +117,6 @@ var _ = Describe("indingsep test", func() { // Deploy Cluster Manager testcaseEnvInst.Log.Info("Deploy Cluster Manager") - cmSpec := enterpriseApi.ClusterManagerSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - }, - } _, err = deployment.DeployClusterManagerWithGivenSpec(ctx, deployment.GetName(), cmSpec) Expect(err).To(Succeed(), "Unable to deploy Cluster Manager") @@ -176,90 +126,78 @@ var _ = Describe("indingsep test", func() { Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster") // Ensure that Ingestor Cluster is in Ready phase + testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster is in Ready phase") testenv.IngestorReady(ctx, deployment, testcaseEnvInst) // Ensure that Cluster Manager is in Ready phase + testcaseEnvInst.Log.Info("Ensure that Cluster Manager is in Ready phase") testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst) // Ensure that Indexer Cluster is in Ready phase + testcaseEnvInst.Log.Info("Ensure that Indexer Cluster is in Ready phase") testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) // Get instance of current Ingestor Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Ingestor Cluster CR with latest config") ingest := &enterpriseApi.IngestorCluster{} err = deployment.GetInstance(ctx, deployment.GetName()+"-ingest", ingest) Expect(err).To(Succeed(), "Failed to get instance of Ingestor Cluster") // Verify Ingestor Cluster Status + testcaseEnvInst.Log.Info("Verify Ingestor Cluster Status") Expect(ingest.Status.PushBus).To(Equal(bus), "Ingestor PushBus status is not the same as provided as input") Expect(ingest.Status.PipelineConfig).To(Equal(pipelineConfig), "Ingestor PipelineConfig status is not the same as provided as input") // Get instance of current Indexer Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Indexer Cluster CR with latest config") index := &enterpriseApi.IndexerCluster{} err = deployment.GetInstance(ctx, deployment.GetName()+"-idxc", index) Expect(err).To(Succeed(), "Failed to get instance of Indexer Cluster") // Verify Indexer Cluster Status + testcaseEnvInst.Log.Info("Verify Indexer Cluster Status") Expect(index.Status.PullBus).To(Equal(bus), "Indexer PullBus status is not the same as provided as input") Expect(index.Status.PipelineConfig).To(Equal(pipelineConfig), "Indexer PipelineConfig status is not the same as provided as input") // Verify conf files + testcaseEnvInst.Log.Info("Verify conf files") pods := testenv.DumpGetPods(deployment.GetName()) for _, pod := range pods { defaultsConf := "" if strings.Contains(pod, "ingest") || strings.Contains(pod, "idxc") { - // Get outputs.conf + // Verify outputs.conf + testcaseEnvInst.Log.Info("Verify outputs.conf") outputsPath := "opt/splunk/etc/system/local/outputs.conf" outputsConf, err := testenv.GetConfFile(pod, outputsPath, deployment.GetName()) Expect(err).To(Succeed(), "Failed to get outputs.conf from Ingestor Cluster pod") - Expect(outputsConf).To(ContainSubstring("[remote_queue:test-queue]"), "outputs.conf does not contain smartbus queue name configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.type = sqs_smartbus"), "outputs.conf does not contain smartbus type configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.auth_region = us-west-2"), "outputs.conf does not contain smartbus region configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.dead_letter_queue.name = test-dead-letter-queue"), "outputs.conf does not contain smartbus dead letter queue configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.encoding_format = s2s"), "outputs.conf does not contain smartbus encoding format configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.endpoint = https://sqs.us-west-2.amazonaws.com"), "outputs.conf does not contain smartbus endpoint configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.large_message_store.endpoint = https://s3.us-west-2.amazonaws.com"), "outputs.conf does not contain smartbus large message store endpoint configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.large_message_store.path = s3://test-bucket/smartbus-test"), "outputs.conf does not contain smartbus large message store path configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.retry_policy = max_count"), "outputs.conf does not contain smartbus retry policy configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.send_interval = 5s"), "outputs.conf does not contain smartbus send interval configuration") - Expect(outputsConf).To(ContainSubstring("remote_queue.max_count.sqs_smartbus.max_retries_per_part = 4"), "outputs.conf does not contain smartbus max retries per part configuration") - - // Get default-mode.conf + testenv.ValidateConfFileContent(outputsConf, outputs) + + // Verify default-mode.conf + testcaseEnvInst.Log.Info("Verify default-mode.conf") defaultsPath := "opt/splunk/etc/system/local/default-mode.conf" defaultsConf, err := testenv.GetConfFile(pod, defaultsPath, deployment.GetName()) Expect(err).To(Succeed(), "Failed to get default-mode.conf from Ingestor Cluster pod") - Expect(defaultsConf).To(ContainSubstring("[pipeline:remotequeueruleset]\ndisabled = false"), "default-mode.conf does not contain remote queue ruleset stanza") - Expect(defaultsConf).To(ContainSubstring("[pipeline:ruleset]\ndisabled = true"), "default-mode.conf does not contain ruleset stanza") - Expect(defaultsConf).To(ContainSubstring("[pipeline:remotequeuetyping]\ndisabled = false"), "default-mode.conf does not contain remote queue typing stanza") - Expect(defaultsConf).To(ContainSubstring("[pipeline:remotequeueoutput]\ndisabled = false"), "default-mode.conf does not contain remote queue output stanza") - Expect(defaultsConf).To(ContainSubstring("[pipeline:typing]\ndisabled = true"), "default-mode.conf does not contain typing stanza") + testenv.ValidateConfFileContent(defaultsConf, defaultsAll) - // Get AWS env variables + // Verify AWS env variables + testcaseEnvInst.Log.Info("Verify AWS env variables") envVars, err := testenv.GetAWSEnv(pod, deployment.GetName()) Expect(err).To(Succeed(), "Failed to get AWS env variables from Ingestor Cluster pod") - Expect(envVars).To(ContainSubstring("AWS_REGION=us-west-2"), "AWS env variables do not contain region") - Expect(envVars).To(ContainSubstring("AWS_DEFAULT_REGION=us-west-2"), "AWS env variables do not contain default region") - Expect(envVars).To(ContainSubstring("AWS_WEB_IDENTITY_TOKEN_FILE=/var/run/secrets/eks.amazonaws.com/serviceaccount/token"), "AWS env variables do not contain web identity token file") - Expect(envVars).To(ContainSubstring("AWS_ROLE_ARN=arn:aws:iam::"), "AWS env variables do not contain role arn") - Expect(envVars).To(ContainSubstring("AWS_STS_REGIONAL_ENDPOINTS=regional"), "AWS env variables do not contain STS regional endpoints") + testenv.ValidateConfFileContent(envVars, awsEnvVars) } if strings.Contains(pod, "ingest") { - Expect(defaultsConf).To(ContainSubstring("[pipeline:indexerPipe]\ndisabled = true"), "default-mode.conf does not contain indexer pipe stanza") + // Verify default-mode.conf + testcaseEnvInst.Log.Info("Verify default-mode.conf") + testenv.ValidateConfFileContent(defaultsConf, defaultsIngest) } else if strings.Contains(pod, "idxc") { - // Get inputs.conf + // Verify inputs.conf + testcaseEnvInst.Log.Info("Verify inputs.conf") inputsPath := "opt/splunk/etc/system/local/inputs.conf" inputsConf, err := testenv.GetConfFile(pod, inputsPath, deployment.GetName()) Expect(err).To(Succeed(), "Failed to get inputs.conf from Indexer Cluster pod") - Expect(inputsConf).To(ContainSubstring("[remote_queue:test-queue]"), "inputs.conf does not contain smartbus queue name configuration") - Expect(inputsConf).To(ContainSubstring("remote_queue.type = sqs_smartbus"), "inputs.conf does not contain smartbus type configuration") - Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.auth_region = us-west-2"), "inputs.conf does not contain smartbus region configuration") - Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.dead_letter_queue.name = test-dead-letter-queue"), "inputs.conf does not contain smartbus dead letter queue configuration") - Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.endpoint = https://sqs.us-west-2.amazonaws.com"), "inputs.conf does not contain smartbus endpoint configuration") - Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.large_message_store.endpoint = https://s3.us-west-2.amazonaws.com"), "inputs.conf does not contain smartbus large message store endpoint configuration") - Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.large_message_store.path = s3://test-bucket/smartbus-test"), "inputs.conf does not contain smartbus large message store path configuration") - Expect(inputsConf).To(ContainSubstring("remote_queue.sqs_smartbus.retry_policy = max_count"), "inputs.conf does not contain smartbus retry policy configuration") - Expect(inputsConf).To(ContainSubstring("remote_queue.max_count.sqs_smartbus.max_retries_per_part = 4"), "inputs.conf does not contain smartbus max retries per part configuration") + testenv.ValidateConfFileContent(inputsConf, inputs) } } }) diff --git a/test/testenv/util.go b/test/testenv/util.go index 64065af8d..571445941 100644 --- a/test/testenv/util.go +++ b/test/testenv/util.go @@ -30,6 +30,8 @@ import ( enterpriseApi "github.com/splunk/splunk-operator/api/v4" + . "github.com/onsi/gomega" + "github.com/onsi/ginkgo/v2" enterpriseApiV3 "github.com/splunk/splunk-operator/api/v3" splcommon "github.com/splunk/splunk-operator/pkg/splunk/common" @@ -1249,3 +1251,11 @@ func GetAWSEnv(podName, ns string) (string, error) { return string(output), err } + +func ValidateConfFileContent(confFileContent string, listOfStringsForValidation []string) { + for _, str := range listOfStringsForValidation { + if !strings.Contains(confFileContent, str) { + Expect(confFileContent).To(ContainSubstring(str), "Failed to find string "+str+" in conf file") + } + } +} From c35406265a08cd6e0a5bb491571fb6d3a2cf975a Mon Sep 17 00:00:00 2001 From: Kasia Koziol Date: Fri, 3 Oct 2025 10:00:36 +0200 Subject: [PATCH 4/6] CSPL-3558 Adding scenario for update and delete --- ...dex_and_ingestion_separation_suite_test.go | 52 ++++ .../index_and_ingestion_separation_test.go | 231 +++++++++++++++++- test/testenv/deployment.go | 9 + test/testenv/util.go | 12 +- 4 files changed, 296 insertions(+), 8 deletions(-) diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go index 235f85f79..0818d5725 100644 --- a/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_suite_test.go @@ -89,6 +89,58 @@ var ( "AWS_ROLE_ARN=arn:aws:iam::", "AWS_STS_REGIONAL_ENDPOINTS=regional", } + + updateBus = enterpriseApi.PushBusSpec{ + Type: "sqs_smartbus", + SQS: enterpriseApi.SQSSpec{ + QueueName: "test-queue-updated", + AuthRegion: "us-west-2", + Endpoint: "https://sqs.us-west-2.amazonaws.com", + LargeMessageStoreEndpoint: "https://s3.us-west-2.amazonaws.com", + LargeMessageStorePath: "s3://test-bucket-updated/smartbus-test", + DeadLetterQueueName: "test-dead-letter-queue-updated", + MaxRetriesPerPart: 5, + RetryPolicy: "max", + SendInterval: "4s", + EncodingFormat: "s2s", + }, + } + updatePipelineConfig = enterpriseApi.PipelineConfigSpec{ + RemoteQueueRuleset: false, + RuleSet: false, + RemoteQueueTyping: false, + RemoteQueueOutput: false, + Typing: true, + IndexerPipe: true, + } + + updatedInputs = []string{ + "[remote_queue:test-queue-updated]", + "remote_queue.type = sqs_smartbus", + "remote_queue.sqs_smartbus.auth_region = us-west-2", + "remote_queue.sqs_smartbus.dead_letter_queue.name = test-dead-letter-queue-updated", + "remote_queue.sqs_smartbus.endpoint = https://sqs.us-west-2.amazonaws.com", + "remote_queue.sqs_smartbus.large_message_store.endpoint = https://s3.us-west-2.amazonaws.com", + "remote_queue.sqs_smartbus.large_message_store.path = s3://test-bucket-updated/smartbus-test", + "remote_queue.sqs_smartbus.retry_policy = max", + "remote_queue.max.sqs_smartbus.max_retries_per_part = 5"} + updatedOutputs = append(updatedInputs, "remote_queue.sqs_smartbus.encoding_format = s2s", "remote_queue.sqs_smartbus.send_interval = 4s") + updatedDefaultsAll = []string{ + "[pipeline:remotequeueruleset]\ndisabled = false", + "[pipeline:ruleset]\ndisabled = false", + "[pipeline:remotequeuetyping]\ndisabled = false", + "[pipeline:remotequeueoutput]\ndisabled = false", + "[pipeline:typing]\ndisabled = true", + } + updatedDefaultsIngest = append(updatedDefaultsAll, "[pipeline:indexerPipe]\ndisabled = true") + + inputsShouldNotContain = []string{ + "[remote_queue:test-queue]", + "remote_queue.sqs_smartbus.dead_letter_queue.name = test-dead-letter-queue", + "remote_queue.sqs_smartbus.large_message_store.path = s3://test-bucket/smartbus-test", + "remote_queue.sqs_smartbus.retry_policy = max_count", + "remote_queue.max_count.sqs_smartbus.max_retries_per_part = 4"} + outputsShouldNotContain = append(inputs, "remote_queue.sqs_smartbus.send_interval = 5s") ) // TestBasic is the main entry point diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go index 5ee126899..103f8f35a 100644 --- a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go @@ -101,6 +101,20 @@ var _ = Describe("indingsep test", func() { // Ensure that Indexer Cluster is in Ready phase testcaseEnvInst.Log.Info("Ensure that Indexer Cluster is in Ready phase") testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) + + // Delete the Indexer Cluster + idxc := &enterpriseApi.IndexerCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-idxc", idxc) + Expect(err).To(Succeed(), "Unable to get Indexer Cluster instance", "Indexer Cluster Name", idxc) + err = deployment.DeleteCR(ctx, idxc) + Expect(err).To(Succeed(), "Unable to delete Indexer Cluster instance", "Indexer Cluster Name", idxc) + + // Delete the Ingestor Cluster + ingest := &enterpriseApi.IngestorCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-ingest", ingest) + Expect(err).To(Succeed(), "Unable to get Ingestor Cluster instance", "Ingestor Cluster Name", ingest) + err = deployment.DeleteCR(ctx, ingest) + Expect(err).To(Succeed(), "Unable to delete Ingestor Cluster instance", "Ingestor Cluster Name", ingest) }) }) @@ -171,33 +185,240 @@ var _ = Describe("indingsep test", func() { outputsPath := "opt/splunk/etc/system/local/outputs.conf" outputsConf, err := testenv.GetConfFile(pod, outputsPath, deployment.GetName()) Expect(err).To(Succeed(), "Failed to get outputs.conf from Ingestor Cluster pod") - testenv.ValidateConfFileContent(outputsConf, outputs) + testenv.ValidateContent(outputsConf, outputs, true) + + // Verify default-mode.conf + testcaseEnvInst.Log.Info("Verify default-mode.conf") + defaultsPath := "opt/splunk/etc/system/local/default-mode.conf" + defaultsConf, err := testenv.GetConfFile(pod, defaultsPath, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get default-mode.conf from Ingestor Cluster pod") + testenv.ValidateContent(defaultsConf, defaultsAll, true) + + // Verify AWS env variables + testcaseEnvInst.Log.Info("Verify AWS env variables") + envVars, err := testenv.GetAWSEnv(pod, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get AWS env variables from Ingestor Cluster pod") + testenv.ValidateContent(envVars, awsEnvVars, true) + } + + if strings.Contains(pod, "ingest") { + // Verify default-mode.conf + testcaseEnvInst.Log.Info("Verify default-mode.conf") + testenv.ValidateContent(defaultsConf, defaultsIngest, true) + } else if strings.Contains(pod, "idxc") { + // Verify inputs.conf + testcaseEnvInst.Log.Info("Verify inputs.conf") + inputsPath := "opt/splunk/etc/system/local/inputs.conf" + inputsConf, err := testenv.GetConfFile(pod, inputsPath, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get inputs.conf from Indexer Cluster pod") + testenv.ValidateContent(inputsConf, inputs, true) + } + } + }) + }) + + Context("Ingestor and Indexer deployment", func() { + It("indingsep, integration, indingsep: Splunk Operator can update Ingestors and Indexers with correct setup", func() { + // Create Service Account + testcaseEnvInst.Log.Info("Create Service Account") + testcaseEnvInst.CreateServiceAccount(serviceAccountName) + + // Deploy Ingestor Cluster + testcaseEnvInst.Log.Info("Deploy Ingestor Cluster") + _, err := deployment.DeployIngestorCluster(ctx, deployment.GetName()+"-ingest", 3, bus, pipelineConfig, serviceAccountName) + Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster") + + // Deploy Cluster Manager + testcaseEnvInst.Log.Info("Deploy Cluster Manager") + _, err = deployment.DeployClusterManagerWithGivenSpec(ctx, deployment.GetName(), cmSpec) + Expect(err).To(Succeed(), "Unable to deploy Cluster Manager") + + // Deploy Indexer Cluster + testcaseEnvInst.Log.Info("Deploy Indexer Cluster") + _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", 3, deployment.GetName(), "", bus, pipelineConfig, serviceAccountName) + Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster") + + // Ensure that Ingestor Cluster is in Ready phase + testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster is in Ready phase") + testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + + // Ensure that Cluster Manager is in Ready phase + testcaseEnvInst.Log.Info("Ensure that Cluster Manager is in Ready phase") + testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst) + + // Ensure that Indexer Cluster is in Ready phase + testcaseEnvInst.Log.Info("Ensure that Indexer Cluster is in Ready phase") + testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) + + // Get instance of current Ingestor Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Ingestor Cluster CR with latest config") + ingest := &enterpriseApi.IngestorCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-ingest", ingest) + Expect(err).To(Succeed(), "Failed to get instance of Ingestor Cluster") + + // Update instance of Ingestor Cluster CR with new pushbus config + testcaseEnvInst.Log.Info("Update instance of Ingestor Cluster CR with new pushbus config") + ingest.Spec.PushBus = updateBus + err = deployment.UpdateCR(ctx, ingest) + Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster with updated CR") + + // Verify Ingestor Cluster Status + testcaseEnvInst.Log.Info("Verify Ingestor Cluster Status") + Expect(ingest.Status.PushBus).To(Equal(updateBus), "Ingestor PushBus status is not the same as provided as input") + Expect(ingest.Status.PipelineConfig).To(Equal(pipelineConfig), "Ingestor PipelineConfig status is not the same as provided as input") + + // Ensure that Ingestor Cluster has not been restarted + testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster has not been restarted") + testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + + // Get instance of current Indexer Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Indexer Cluster CR with latest config") + index := &enterpriseApi.IndexerCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-idxc", index) + Expect(err).To(Succeed(), "Failed to get instance of Indexer Cluster") + + // Update instance of Indexer Cluster CR with new pullbus config + testcaseEnvInst.Log.Info("Update instance of Indexer Cluster CR with new pullbus config") + index.Spec.PullBus = updateBus + err = deployment.UpdateCR(ctx, index) + Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster with updated CR") + + // Verify Indexer Cluster Status + testcaseEnvInst.Log.Info("Verify Indexer Cluster Status") + Expect(index.Status.PullBus).To(Equal(updateBus), "Indexer PullBus status is not the same as provided as input") + Expect(index.Status.PipelineConfig).To(Equal(pipelineConfig), "Indexer PipelineConfig status is not the same as provided as input") + + // Ensure that Indexer Cluster has not been restarted + testcaseEnvInst.Log.Info("Ensure that Indexer Cluster has not been restarted") + testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) + + // Verify conf files + testcaseEnvInst.Log.Info("Verify conf files") + pods := testenv.DumpGetPods(deployment.GetName()) + for _, pod := range pods { + defaultsConf := "" + + if strings.Contains(pod, "ingest") || strings.Contains(pod, "idxc") { + // Verify outputs.conf + testcaseEnvInst.Log.Info("Verify outputs.conf") + outputsPath := "opt/splunk/etc/system/local/outputs.conf" + outputsConf, err := testenv.GetConfFile(pod, outputsPath, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get outputs.conf from Ingestor Cluster pod") + testenv.ValidateContent(outputsConf, updatedOutputs, true) + testenv.ValidateContent(outputsConf, outputsShouldNotContain, false) + + // Verify default-mode.conf + testcaseEnvInst.Log.Info("Verify default-mode.conf") + defaultsPath := "opt/splunk/etc/system/local/default-mode.conf" + defaultsConf, err := testenv.GetConfFile(pod, defaultsPath, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get default-mode.conf from Ingestor Cluster pod") + testenv.ValidateContent(defaultsConf, defaultsAll, true) + + // Verify AWS env variables + testcaseEnvInst.Log.Info("Verify AWS env variables") + envVars, err := testenv.GetAWSEnv(pod, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get AWS env variables from Ingestor Cluster pod") + testenv.ValidateContent(envVars, awsEnvVars, true) + } + + if strings.Contains(pod, "ingest") { + // Verify default-mode.conf + testcaseEnvInst.Log.Info("Verify default-mode.conf") + testenv.ValidateContent(defaultsConf, defaultsIngest, true) + } else if strings.Contains(pod, "idxc") { + // Verify inputs.conf + testcaseEnvInst.Log.Info("Verify inputs.conf") + inputsPath := "opt/splunk/etc/system/local/inputs.conf" + inputsConf, err := testenv.GetConfFile(pod, inputsPath, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get inputs.conf from Indexer Cluster pod") + testenv.ValidateContent(inputsConf, updatedInputs, true) + testenv.ValidateContent(inputsConf, inputsShouldNotContain, false) + } + } + + // Get instance of current Ingestor Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Ingestor Cluster CR with latest config") + ingest = &enterpriseApi.IngestorCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-ingest", ingest) + Expect(err).To(Succeed(), "Failed to get instance of Ingestor Cluster") + + // Update instance of Ingestor Cluster CR with new pipelineconfig config + testcaseEnvInst.Log.Info("Update instance of Ingestor Cluster CR with new pipelineconfig config") + ingest.Spec.PipelineConfig = updatePipelineConfig + err = deployment.UpdateCR(ctx, ingest) + Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster with updated CR") + + // Verify Ingestor Cluster Status + testcaseEnvInst.Log.Info("Verify Ingestor Cluster Status") + Expect(ingest.Status.PushBus).To(Equal(updateBus), "Ingestor PushBus status is not the same as provided as input") + Expect(ingest.Status.PipelineConfig).To(Equal(updatePipelineConfig), "Ingestor PipelineConfig status is not the same as provided as input") + + // Ensure that Ingestor Cluster has not been restarted + testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster has not been restarted") + testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + + // Get instance of current Indexer Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Indexer Cluster CR with latest config") + index = &enterpriseApi.IndexerCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-idxc", index) + Expect(err).To(Succeed(), "Failed to get instance of Indexer Cluster") + + // Update instance of Indexer Cluster CR with new pipelineconfig config + testcaseEnvInst.Log.Info("Update instance of Indexer Cluster CR with new pipelineconfig config") + index.Spec.PipelineConfig = updatePipelineConfig + err = deployment.UpdateCR(ctx, index) + Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster with updated CR") + + // Verify Indexer Cluster Status + testcaseEnvInst.Log.Info("Verify Indexer Cluster Status") + Expect(index.Status.PullBus).To(Equal(updateBus), "Indexer PullBus status is not the same as provided as input") + Expect(index.Status.PipelineConfig).To(Equal(updatePipelineConfig), "Indexer PipelineConfig status is not the same as provided as input") + + // Ensure that Indexer Cluster has not been restarted + testcaseEnvInst.Log.Info("Ensure that Indexer Cluster has not been restarted") + testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) + + // Verify conf files + testcaseEnvInst.Log.Info("Verify conf files") + pods = testenv.DumpGetPods(deployment.GetName()) + for _, pod := range pods { + defaultsConf := "" + + if strings.Contains(pod, "ingest") || strings.Contains(pod, "idxc") { + // Verify outputs.conf + testcaseEnvInst.Log.Info("Verify outputs.conf") + outputsPath := "opt/splunk/etc/system/local/outputs.conf" + outputsConf, err := testenv.GetConfFile(pod, outputsPath, deployment.GetName()) + Expect(err).To(Succeed(), "Failed to get outputs.conf from Ingestor Cluster pod") + testenv.ValidateContent(outputsConf, updatedOutputs, true) + testenv.ValidateContent(outputsConf, outputsShouldNotContain, false) // Verify default-mode.conf testcaseEnvInst.Log.Info("Verify default-mode.conf") defaultsPath := "opt/splunk/etc/system/local/default-mode.conf" defaultsConf, err := testenv.GetConfFile(pod, defaultsPath, deployment.GetName()) Expect(err).To(Succeed(), "Failed to get default-mode.conf from Ingestor Cluster pod") - testenv.ValidateConfFileContent(defaultsConf, defaultsAll) + testenv.ValidateContent(defaultsConf, updatedDefaultsAll, true) // Verify AWS env variables testcaseEnvInst.Log.Info("Verify AWS env variables") envVars, err := testenv.GetAWSEnv(pod, deployment.GetName()) Expect(err).To(Succeed(), "Failed to get AWS env variables from Ingestor Cluster pod") - testenv.ValidateConfFileContent(envVars, awsEnvVars) + testenv.ValidateContent(envVars, awsEnvVars, true) } if strings.Contains(pod, "ingest") { // Verify default-mode.conf testcaseEnvInst.Log.Info("Verify default-mode.conf") - testenv.ValidateConfFileContent(defaultsConf, defaultsIngest) + testenv.ValidateContent(defaultsConf, updatedDefaultsIngest, true) } else if strings.Contains(pod, "idxc") { // Verify inputs.conf testcaseEnvInst.Log.Info("Verify inputs.conf") inputsPath := "opt/splunk/etc/system/local/inputs.conf" inputsConf, err := testenv.GetConfFile(pod, inputsPath, deployment.GetName()) Expect(err).To(Succeed(), "Failed to get inputs.conf from Indexer Cluster pod") - testenv.ValidateConfFileContent(inputsConf, inputs) + testenv.ValidateContent(inputsConf, updatedInputs, true) + testenv.ValidateContent(inputsConf, inputsShouldNotContain, false) } } }) diff --git a/test/testenv/deployment.go b/test/testenv/deployment.go index 85ea4ada9..c24fd12f3 100644 --- a/test/testenv/deployment.go +++ b/test/testenv/deployment.go @@ -592,6 +592,15 @@ func (d *Deployment) UpdateCR(ctx context.Context, cr client.Object) error { ucr := cr.(*enterpriseApi.IndexerCluster) current.Spec = ucr.Spec cobject = current + case "IngestorCluster": + current := &enterpriseApi.IngestorCluster{} + err = d.testenv.GetKubeClient().Get(ctx, namespacedName, current) + if err != nil { + return err + } + ucr := cr.(*enterpriseApi.IngestorCluster) + current.Spec = ucr.Spec + cobject = current case "ClusterMaster": current := &enterpriseApiV3.ClusterMaster{} err = d.testenv.GetKubeClient().Get(ctx, namespacedName, current) diff --git a/test/testenv/util.go b/test/testenv/util.go index 571445941..757d6ce30 100644 --- a/test/testenv/util.go +++ b/test/testenv/util.go @@ -1252,10 +1252,16 @@ func GetAWSEnv(podName, ns string) (string, error) { return string(output), err } -func ValidateConfFileContent(confFileContent string, listOfStringsForValidation []string) { +func ValidateContent(confFileContent string, listOfStringsForValidation []string, shouldContain bool) { for _, str := range listOfStringsForValidation { - if !strings.Contains(confFileContent, str) { - Expect(confFileContent).To(ContainSubstring(str), "Failed to find string "+str+" in conf file") + if shouldContain { + if !strings.Contains(confFileContent, str) { + Expect(confFileContent).To(ContainSubstring(str), "Failed to find string "+str+" in conf file") + } + } else { + if strings.Contains(confFileContent, str) { + Expect(confFileContent).ToNot(ContainSubstring(str), "Found string "+str+" in conf file, but it should not be there") + } } } } From c204d5204031f50788be18f6c8110fde02bfb8af Mon Sep 17 00:00:00 2001 From: Kasia Koziol Date: Fri, 3 Oct 2025 10:53:01 +0200 Subject: [PATCH 5/6] CSPL-3558 Adding helm test --- .../00-assert.yaml | 9 + .../00-install-operator.yaml | 6 + .../01-assert.yaml | 156 ++++++++++++++++++ .../01-install-setup.yaml | 6 + .../02-assert.yaml | 59 +++++++ .../02-scaleup-ingestor.yaml | 5 + .../03-uninstall-setup.yaml | 5 + .../splunk_index_ingest_sep.yaml | 66 ++++++++ .../index_and_ingestion_separation_test.go | 56 +++++-- 9 files changed, 352 insertions(+), 16 deletions(-) create mode 100644 kuttl/tests/helm/index-and-ingest-separation/00-assert.yaml create mode 100644 kuttl/tests/helm/index-and-ingest-separation/00-install-operator.yaml create mode 100644 kuttl/tests/helm/index-and-ingest-separation/01-assert.yaml create mode 100644 kuttl/tests/helm/index-and-ingest-separation/01-install-setup.yaml create mode 100644 kuttl/tests/helm/index-and-ingest-separation/02-assert.yaml create mode 100644 kuttl/tests/helm/index-and-ingest-separation/02-scaleup-ingestor.yaml create mode 100644 kuttl/tests/helm/index-and-ingest-separation/03-uninstall-setup.yaml create mode 100644 kuttl/tests/helm/index-and-ingest-separation/splunk_index_ingest_sep.yaml diff --git a/kuttl/tests/helm/index-and-ingest-separation/00-assert.yaml b/kuttl/tests/helm/index-and-ingest-separation/00-assert.yaml new file mode 100644 index 000000000..84aa8c23a --- /dev/null +++ b/kuttl/tests/helm/index-and-ingest-separation/00-assert.yaml @@ -0,0 +1,9 @@ +--- +# assert for splunk operator deployment to be ready +apiVersion: apps/v1 +kind: Deployment +metadata: + name: splunk-operator-controller-manager +status: + readyReplicas: 1 + availableReplicas: 1 \ No newline at end of file diff --git a/kuttl/tests/helm/index-and-ingest-separation/00-install-operator.yaml b/kuttl/tests/helm/index-and-ingest-separation/00-install-operator.yaml new file mode 100644 index 000000000..602ebe0c1 --- /dev/null +++ b/kuttl/tests/helm/index-and-ingest-separation/00-install-operator.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: ../script/installoperator.sh + background: false \ No newline at end of file diff --git a/kuttl/tests/helm/index-and-ingest-separation/01-assert.yaml b/kuttl/tests/helm/index-and-ingest-separation/01-assert.yaml new file mode 100644 index 000000000..97f61aac7 --- /dev/null +++ b/kuttl/tests/helm/index-and-ingest-separation/01-assert.yaml @@ -0,0 +1,156 @@ +--- +# assert for cluster manager custom resource to be ready +apiVersion: enterprise.splunk.com/v4 +kind: ClusterManager +metadata: + name: cm +status: + phase: Ready + +--- +# check if stateful sets are created +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: splunk-cm-cluster-manager +status: + replicas: 1 + +--- +# check if secret object are created +apiVersion: v1 +kind: Secret +metadata: + name: splunk-cm-cluster-manager-secret-v1 + +--- +# assert for indexer cluster custom resource to be ready +apiVersion: enterprise.splunk.com/v4 +kind: IndexerCluster +metadata: + name: idxc + pipelineConfig: + remoteQueueRuleset: false + ruleSet: true + remoteQueueTyping: false + remoteQueueOutput: false + typing: true + indexerPipe: true + pullBus: + type: sqs_smartbus + sqs: + queueName: kkoziol-sqs-test + authRegion: us-west-2 + endpoint: https://sqs.us-west-2.amazonaws.com + largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com + largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol + deadLetterQueueName: kkoziol-sqs-dlq-test + maxRetriesPerPart: 4 + retryPolicy: max_count + sendInterval: 5s + encodingFormat: s2s +status: + phase: Ready + pipelineConfig: + remoteQueueRuleset: false + ruleSet: true + remoteQueueTyping: false + remoteQueueOutput: false + typing: true + indexerPipe: true + pullBus: + type: sqs_smartbus + sqs: + queueName: kkoziol-sqs-test + authRegion: us-west-2 + endpoint: https://sqs.us-west-2.amazonaws.com + largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com + largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol + deadLetterQueueName: kkoziol-sqs-dlq-test + maxRetriesPerPart: 4 + retryPolicy: max_count + sendInterval: 5s + encodingFormat: s2s + +--- +# check for stateful set and replicas as configured +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: splunk-idxc-indexer +status: + replicas: 3 + +--- +# check if secret object are created +apiVersion: v1 +kind: Secret +metadata: + name: splunk-idxc-indexer-secret-v1 + +--- +# assert for indexer cluster custom resource to be ready +apiVersion: enterprise.splunk.com/v4 +kind: IngestorCluster +metadata: + name: ingestor +spec: + replicas: 3 + pipelineConfig: + remoteQueueRuleset: false + ruleSet: true + remoteQueueTyping: false + remoteQueueOutput: false + typing: true + indexerPipe: true + pushBus: + type: sqs_smartbus + sqs: + queueName: kkoziol-sqs-test + authRegion: us-west-2 + endpoint: https://sqs.us-west-2.amazonaws.com + largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com + largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol + deadLetterQueueName: kkoziol-sqs-dlq-test + maxRetriesPerPart: 4 + retryPolicy: max_count + sendInterval: 5s + encodingFormat: s2s +status: + phase: Ready + pipelineConfig: + remoteQueueRuleset: false + ruleSet: true + remoteQueueTyping: false + remoteQueueOutput: false + typing: true + indexerPipe: true + pushBus: + type: sqs_smartbus + sqs: + queueName: kkoziol-sqs-test + authRegion: us-west-2 + endpoint: https://sqs.us-west-2.amazonaws.com + largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com + largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol + deadLetterQueueName: kkoziol-sqs-dlq-test + maxRetriesPerPart: 4 + retryPolicy: max_count + sendInterval: 5s + encodingFormat: s2s + +--- +# check for stateful set and replicas as configured +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: splunk-ingestor-ingestor +status: + replicas: 3 + +--- +# check if secret object are created +apiVersion: v1 +kind: Secret +metadata: + name: splunk-ingestor-ingestor-secret-v1 \ No newline at end of file diff --git a/kuttl/tests/helm/index-and-ingest-separation/01-install-setup.yaml b/kuttl/tests/helm/index-and-ingest-separation/01-install-setup.yaml new file mode 100644 index 000000000..0e9f5d58e --- /dev/null +++ b/kuttl/tests/helm/index-and-ingest-separation/01-install-setup.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: helm install splunk-index-ingest-sep $HELM_REPO_PATH/splunk-enterprise -f splunk_index_ingest_sep.yaml + namespaced: true \ No newline at end of file diff --git a/kuttl/tests/helm/index-and-ingest-separation/02-assert.yaml b/kuttl/tests/helm/index-and-ingest-separation/02-assert.yaml new file mode 100644 index 000000000..d00ddc153 --- /dev/null +++ b/kuttl/tests/helm/index-and-ingest-separation/02-assert.yaml @@ -0,0 +1,59 @@ +--- +# assert for ingestor cluster custom resource to be ready +apiVersion: enterprise.splunk.com/v4 +kind: IngestorCluster +metadata: + name: ingestor +spec: + replicas: 4 + pipelineConfig: + remoteQueueRuleset: false + ruleSet: true + remoteQueueTyping: false + remoteQueueOutput: false + typing: true + indexerPipe: true + pushBus: + type: sqs_smartbus + sqs: + queueName: kkoziol-sqs-test + authRegion: us-west-2 + endpoint: https://sqs.us-west-2.amazonaws.com + largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com + largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol + deadLetterQueueName: kkoziol-sqs-dlq-test + maxRetriesPerPart: 4 + retryPolicy: max_count + sendInterval: 5s + encodingFormat: s2s +status: + phase: Ready + pipelineConfig: + remoteQueueRuleset: false + ruleSet: true + remoteQueueTyping: false + remoteQueueOutput: false + typing: true + indexerPipe: true + pushBus: + type: sqs_smartbus + sqs: + queueName: kkoziol-sqs-test + authRegion: us-west-2 + endpoint: https://sqs.us-west-2.amazonaws.com + largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com + largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol + deadLetterQueueName: kkoziol-sqs-dlq-test + maxRetriesPerPart: 4 + retryPolicy: max_count + sendInterval: 5s + encodingFormat: s2s + +--- +# check for stateful sets and replicas updated +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: splunk-ingestor-ingestor +status: + replicas: 4 diff --git a/kuttl/tests/helm/index-and-ingest-separation/02-scaleup-ingestor.yaml b/kuttl/tests/helm/index-and-ingest-separation/02-scaleup-ingestor.yaml new file mode 100644 index 000000000..731faf145 --- /dev/null +++ b/kuttl/tests/helm/index-and-ingest-separation/02-scaleup-ingestor.yaml @@ -0,0 +1,5 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: helm upgrade splunk-index-ingest-sep $HELM_REPO_PATH/splunk-enterprise --reuse-values --set ingestorCluster.replicaCount=4 + namespaced: true diff --git a/kuttl/tests/helm/index-and-ingest-separation/03-uninstall-setup.yaml b/kuttl/tests/helm/index-and-ingest-separation/03-uninstall-setup.yaml new file mode 100644 index 000000000..85bf05dfe --- /dev/null +++ b/kuttl/tests/helm/index-and-ingest-separation/03-uninstall-setup.yaml @@ -0,0 +1,5 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: helm uninstall splunk-index-ingest-sep + namespaced: true diff --git a/kuttl/tests/helm/index-and-ingest-separation/splunk_index_ingest_sep.yaml b/kuttl/tests/helm/index-and-ingest-separation/splunk_index_ingest_sep.yaml new file mode 100644 index 000000000..c0ad7b05a --- /dev/null +++ b/kuttl/tests/helm/index-and-ingest-separation/splunk_index_ingest_sep.yaml @@ -0,0 +1,66 @@ +splunk-operator: + enabled: false + splunkOperator: + clusterWideAccess: false + persistentVolumeClaim: + storageClassName: gp2 + +ingestorCluster: + enabled: true + name: ingestor + replicaCount: 3 + # serviceAccount: ingestion-role-sa + pipelineConfig: + remoteQueueRuleset: false + ruleSet: true + remoteQueueTyping: false + remoteQueueOutput: false + typing: true + indexerPipe: true + pushBus: + type: sqs_smartbus + sqs: + queueName: kkoziol-sqs-test + authRegion: us-west-2 + endpoint: https://sqs.us-west-2.amazonaws.com + largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com + largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol + deadLetterQueueName: kkoziol-sqs-dlq-test + maxRetriesPerPart: 4 + retryPolicy: max_count + sendInterval: 5s + encodingFormat: s2s + +clusterManager: + enabled: true + name: cm + replicaCount: 1 + # serviceAccount: ingestion-role-sa + +indexerCluster: + enabled: true + name: indexer + replicaCount: 3 + # serviceAccount: ingestion-role-sa + clusterManagerRef: + name: cm + pipelineConfig: + remoteQueueRuleset: false + ruleSet: true + remoteQueueTyping: false + remoteQueueOutput: false + typing: true + indexerPipe: true + pullBus: + type: sqs_smartbus + sqs: + queueName: kkoziol-sqs-test + authRegion: us-west-2 + endpoint: https://sqs.us-west-2.amazonaws.com + largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com + largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol + deadLetterQueueName: kkoziol-sqs-dlq-test + maxRetriesPerPart: 4 + retryPolicy: max_count + sendInterval: 5s + encodingFormat: s2s diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go index 103f8f35a..63871bc2b 100644 --- a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go @@ -262,15 +262,21 @@ var _ = Describe("indingsep test", func() { err = deployment.UpdateCR(ctx, ingest) Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster with updated CR") + // Ensure that Ingestor Cluster has not been restarted + testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster has not been restarted") + testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + + // Get instance of current Ingestor Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Ingestor Cluster CR with latest config") + ingest = &enterpriseApi.IngestorCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-ingest", ingest) + Expect(err).To(Succeed(), "Failed to get instance of Ingestor Cluster") + // Verify Ingestor Cluster Status testcaseEnvInst.Log.Info("Verify Ingestor Cluster Status") Expect(ingest.Status.PushBus).To(Equal(updateBus), "Ingestor PushBus status is not the same as provided as input") Expect(ingest.Status.PipelineConfig).To(Equal(pipelineConfig), "Ingestor PipelineConfig status is not the same as provided as input") - // Ensure that Ingestor Cluster has not been restarted - testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster has not been restarted") - testenv.IngestorReady(ctx, deployment, testcaseEnvInst) - // Get instance of current Indexer Cluster CR with latest config testcaseEnvInst.Log.Info("Get instance of current Indexer Cluster CR with latest config") index := &enterpriseApi.IndexerCluster{} @@ -283,15 +289,21 @@ var _ = Describe("indingsep test", func() { err = deployment.UpdateCR(ctx, index) Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster with updated CR") + // Ensure that Indexer Cluster has not been restarted + testcaseEnvInst.Log.Info("Ensure that Indexer Cluster has not been restarted") + testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) + + // Get instance of current Indexer Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Indexer Cluster CR with latest config") + index = &enterpriseApi.IndexerCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-idxc", index) + Expect(err).To(Succeed(), "Failed to get instance of Indexer Cluster") + // Verify Indexer Cluster Status testcaseEnvInst.Log.Info("Verify Indexer Cluster Status") Expect(index.Status.PullBus).To(Equal(updateBus), "Indexer PullBus status is not the same as provided as input") Expect(index.Status.PipelineConfig).To(Equal(pipelineConfig), "Indexer PipelineConfig status is not the same as provided as input") - // Ensure that Indexer Cluster has not been restarted - testcaseEnvInst.Log.Info("Ensure that Indexer Cluster has not been restarted") - testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) - // Verify conf files testcaseEnvInst.Log.Info("Verify conf files") pods := testenv.DumpGetPods(deployment.GetName()) @@ -348,15 +360,21 @@ var _ = Describe("indingsep test", func() { err = deployment.UpdateCR(ctx, ingest) Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster with updated CR") + // Ensure that Ingestor Cluster has not been restarted + testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster has not been restarted") + testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + + // Get instance of current Ingestor Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Ingestor Cluster CR with latest config") + ingest = &enterpriseApi.IngestorCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-ingest", ingest) + Expect(err).To(Succeed(), "Failed to get instance of Ingestor Cluster") + // Verify Ingestor Cluster Status testcaseEnvInst.Log.Info("Verify Ingestor Cluster Status") Expect(ingest.Status.PushBus).To(Equal(updateBus), "Ingestor PushBus status is not the same as provided as input") Expect(ingest.Status.PipelineConfig).To(Equal(updatePipelineConfig), "Ingestor PipelineConfig status is not the same as provided as input") - // Ensure that Ingestor Cluster has not been restarted - testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster has not been restarted") - testenv.IngestorReady(ctx, deployment, testcaseEnvInst) - // Get instance of current Indexer Cluster CR with latest config testcaseEnvInst.Log.Info("Get instance of current Indexer Cluster CR with latest config") index = &enterpriseApi.IndexerCluster{} @@ -369,15 +387,21 @@ var _ = Describe("indingsep test", func() { err = deployment.UpdateCR(ctx, index) Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster with updated CR") + // Ensure that Indexer Cluster has not been restarted + testcaseEnvInst.Log.Info("Ensure that Indexer Cluster has not been restarted") + testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) + + // Get instance of current Indexer Cluster CR with latest config + testcaseEnvInst.Log.Info("Get instance of current Indexer Cluster CR with latest config") + index = &enterpriseApi.IndexerCluster{} + err = deployment.GetInstance(ctx, deployment.GetName()+"-idxc", index) + Expect(err).To(Succeed(), "Failed to get instance of Indexer Cluster") + // Verify Indexer Cluster Status testcaseEnvInst.Log.Info("Verify Indexer Cluster Status") Expect(index.Status.PullBus).To(Equal(updateBus), "Indexer PullBus status is not the same as provided as input") Expect(index.Status.PipelineConfig).To(Equal(updatePipelineConfig), "Indexer PipelineConfig status is not the same as provided as input") - // Ensure that Indexer Cluster has not been restarted - testcaseEnvInst.Log.Info("Ensure that Indexer Cluster has not been restarted") - testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) - // Verify conf files testcaseEnvInst.Log.Info("Verify conf files") pods = testenv.DumpGetPods(deployment.GetName()) From 8c9d0484e383a0303a3e1c4e59e150fa6299a3d7 Mon Sep 17 00:00:00 2001 From: Kasia Koziol Date: Fri, 3 Oct 2025 13:33:13 +0200 Subject: [PATCH 6/6] CSPL-3558 Update of k8s version --- .env | 4 +-- Makefile | 2 +- test/env.sh | 2 +- .../index_and_ingestion_separation_test.go | 36 +++++++++++++++++++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.env b/.env index b9275e277..64209df32 100644 --- a/.env +++ b/.env @@ -4,8 +4,8 @@ GO_VERSION=1.23.0 AWSCLI_URL=https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.8.6.zip KUBECTL_VERSION=v1.29.1 AZ_CLI_VERSION=2.30.0 -EKSCTL_VERSION=v0.191.0 -EKS_CLUSTER_K8_VERSION=1.31 +EKSCTL_VERSION=v0.211.0 +EKS_CLUSTER_K8_VERSION=1.32 EKS_INSTANCE_TYPE=m5.2xlarge EKS_INSTANCE_TYPE_ARM64=c6g.4xlarge SPLUNK_ENTERPRISE_RELEASE_IMAGE=splunk/splunk:9.4.3 \ No newline at end of file diff --git a/Makefile b/Makefile index 40d266a01..ee148a5f5 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ BUNDLE_IMG ?= ${IMAGE_TAG_BASE}-bundle:v${VERSION} # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.31.0 +ENVTEST_K8S_VERSION = 1.32.0 ignore-not-found ?= True diff --git a/test/env.sh b/test/env.sh index c171a075c..8495ef9b0 100644 --- a/test/env.sh +++ b/test/env.sh @@ -13,7 +13,7 @@ : "${EKS_INSTANCE_TYPE:=m5.2xlarge}" : "${VPC_PUBLIC_SUBNET_STRING:=}" : "${VPC_PRIVATE_SUBNET_STRING:=}" -: "${EKS_CLUSTER_K8_VERSION:=1.31}" +: "${EKS_CLUSTER_K8_VERSION:=1.32}" # Below env variables required to run license master test cases : "${ENTERPRISE_LICENSE_S3_PATH:=test_licenses/}" : "${TEST_S3_BUCKET:=splk-test-data-bucket}" diff --git a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go index 63871bc2b..e7c3da4f1 100644 --- a/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go +++ b/test/index_and_ingestion_separation/index_and_ingestion_separation_test.go @@ -118,6 +118,42 @@ var _ = Describe("indingsep test", func() { }) }) + // Context("Ingestor and Indexer deployment", func() { + // It("indingsep, smoke, indingsep: Splunk Operator can deploy Ingestors and Indexers with additional configurations", func() { + // // Create Service Account + // testcaseEnvInst.Log.Info("Create Service Account") + // testcaseEnvInst.CreateServiceAccount(serviceAccountName) + + // // Deploy Ingestor Cluster + // testcaseEnvInst.Log.Info("Deploy Ingestor Cluster") + // _, err := deployment.DeployIngestorCluster(ctx, deployment.GetName()+"-ingest", 3, bus, pipelineConfig, serviceAccountName) + // Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster") + + // // Deploy Cluster Manager + // testcaseEnvInst.Log.Info("Deploy Cluster Manager") + // _, err = deployment.DeployClusterManagerWithGivenSpec(ctx, deployment.GetName(), cmSpec) + // Expect(err).To(Succeed(), "Unable to deploy Cluster Manager") + + // // Deploy Indexer Cluster + // testcaseEnvInst.Log.Info("Deploy Indexer Cluster") + // _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", 3, deployment.GetName(), "", bus, pipelineConfig, serviceAccountName) + // Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster") + + // // Ensure that Ingestor Cluster is in Ready phase + // testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster is in Ready phase") + // testenv.IngestorReady(ctx, deployment, testcaseEnvInst) + + // // Ensure that Cluster Manager is in Ready phase + // testcaseEnvInst.Log.Info("Ensure that Cluster Manager is in Ready phase") + // testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst) + + // // Ensure that Indexer Cluster is in Ready phase + // testcaseEnvInst.Log.Info("Ensure that Indexer Cluster is in Ready phase") + // testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst) + + // }) + // }) + Context("Ingestor and Indexer deployment", func() { It("indingsep, integration, indingsep: Splunk Operator can deploy Ingestors and Indexers with correct setup", func() { // Create Service Account