Skip to content

Commit

Permalink
test: Skip Istio test if Ginkgo runs on unsupported runtime.
Browse files Browse the repository at this point in the history
Skip Istio test if running cilium-istioctl is not supported for the
current Go runtime.

Support running Istio test from OSX by downloading the osx version of
cilium-istioctl if the test suite is running in OSX. This allows
running the Istio test on a remote cluster (e.g., GKE) when Ginkgo is
running on OSX.

On Windows the test is skipped, even though the cilium-istioctl binary
is released also for Windows, but this has not been tested yet.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
  • Loading branch information
jrajahalme authored and borkmann committed Jun 5, 2020
1 parent c1b3e32 commit 471fe63
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/k8sT/istio.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package k8sTest
import (
"context"
"fmt"
"runtime"
"time"

. "github.com/cilium/cilium/test/ginkgo-ext"
Expand Down Expand Up @@ -51,7 +52,13 @@ var _ = Describe("K8sIstioTest", func() {
// "global.proxy.sidecarImageRegex": "jrajahalme/istio_proxy",
}

ciliumIstioctlURL = "https://github.com/cilium/istio/releases/download/" + istioVersion + prerelease + "/cilium-istioctl-" + istioVersion + "-linux.tar.gz"
// Map of tested runtimes for cilium-istioctl
ciliumIstioctlOSes = map[string]string{
"darwin": "osx",
"linux": "linux",
}

ciliumIstioctlURL = "https://github.com/cilium/istio/releases/download/" + istioVersion + prerelease + "/cilium-istioctl-" + istioVersion + "-" + ciliumIstioctlOSes[runtime.GOOS] + ".tar.gz"
// istioServiceNames is the set of Istio services needed for the tests
istioServiceNames = []string{
"istio-ingressgateway",
Expand Down Expand Up @@ -92,7 +99,7 @@ var _ = Describe("K8sIstioTest", func() {
res = kubectl.NamespaceLabel(helpers.DefaultNamespace, "istio-injection=enabled")
res.ExpectSuccess("unable to label namespace %q", helpers.DefaultNamespace)

By("Deplying Istio")
By("Deploying Istio")
res = kubectl.Exec("./cilium-istioctl manifest apply -y" + istioctlParams)
res.ExpectSuccess("unable to deploy Istio")
})
Expand Down Expand Up @@ -167,7 +174,7 @@ var _ = Describe("K8sIstioTest", func() {

// This is a subset of Services's "Bookinfo Demo" test suite, with the pods
// injected with Istio sidecar proxies and Istio mTLS enabled.
Context("Istio Bookinfo Demo", func() {
SkipContextIf(func() bool { return ciliumIstioctlOSes[runtime.GOOS] == "" }, "Istio Bookinfo Demo", func() {

var (
resourceYAMLPaths []string
Expand Down

0 comments on commit 471fe63

Please sign in to comment.