Skip to content

Commit

Permalink
e2e tests for validating Ambient deployment
Browse files Browse the repository at this point in the history
This PR implements e2e tests for control plane and dataplane validation
of Ambient profile in the Sail Operator.

Related to: istio-ecosystem#500
Signed-off-by: Sridhar Gaddam <[email protected]>
  • Loading branch information
sridhargaddam committed Dec 24, 2024
1 parent a37a6d3 commit e281e30
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 0 deletions.
67 changes: 67 additions & 0 deletions tests/e2e/ambient/ambient_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//go:build e2e

// Copyright Istio Authors
//
// 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 ambient

import (
"testing"

k8sclient "github.com/istio-ecosystem/sail-operator/tests/e2e/util/client"
"github.com/istio-ecosystem/sail-operator/tests/e2e/util/common"
"github.com/istio-ecosystem/sail-operator/tests/e2e/util/env"
"github.com/istio-ecosystem/sail-operator/tests/e2e/util/kubectl"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"sigs.k8s.io/controller-runtime/pkg/client"
)

var (
cl client.Client
err error
ocp = env.GetBool("OCP", false)
operatorNamespace = common.OperatorNamespace
deploymentName = env.Get("DEPLOYMENT_NAME", "sail-operator")
controlPlaneNamespace = env.Get("CONTROL_PLANE_NS", "istio-system")
istioName = env.Get("ISTIO_NAME", "default")
istioCniNamespace = env.Get("ISTIOCNI_NAMESPACE", "istio-cni")
ztunnelNamespace = env.Get("ZTUNNEL_NAMESPACE", "ztunnel")
istioCniName = env.Get("ISTIOCNI_NAME", "default")
skipDeploy = env.GetBool("SKIP_DEPLOY", false)
expectedRegistry = env.Get("EXPECTED_REGISTRY", "^docker\\.io|^gcr\\.io")
multicluster = env.GetBool("MULTICLUSTER", false)

k kubectl.Kubectl
)

func TestAmbient(t *testing.T) {
if multicluster {
t.Skip("Skipping the Ambient tests")
}

RegisterFailHandler(Fail)
setup()
RunSpecs(t, "Ambient Test Suite")
}

func setup() {
GinkgoWriter.Println("************ Running Setup ************")

GinkgoWriter.Println("Initializing k8s client")
cl, err = k8sclient.InitK8sClient("")
Expect(err).NotTo(HaveOccurred())

k = kubectl.New("clAmbient")
}
Loading

0 comments on commit e281e30

Please sign in to comment.