From bfb02b5bfae1bf06ecbaca06f2c55e3abdb9aeef Mon Sep 17 00:00:00 2001 From: haofan-ms Date: Fri, 25 Sep 2020 18:10:10 -0700 Subject: [PATCH] test: fixes for akse e2e tests --- test/e2e/config/config.go | 12 ++++++------ test/e2e/kubernetes/kubernetes_test.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/e2e/config/config.go b/test/e2e/config/config.go index 66bba58653..53908c5c29 100644 --- a/test/e2e/config/config.go +++ b/test/e2e/config/config.go @@ -191,16 +191,16 @@ func (ccc *CustomCloudConfig) SetEnvironment() error { azsSelfSignedCaPath := "/aks-engine/Certificates.pem" if _, err = os.Stat(azsSelfSignedCaPath); err == nil { // latest dev_image has an azure-cli version that requires python3 - devImagePython := "python3" + cert_command := fmt.Sprintf(`VER=$(python3 -V | grep -o [0-9].[0-9]*. | grep -o [0-9].[0-9]*); + CA=/usr/local/lib/python${VER}/dist-packages/certifi/cacert.pem; + if [ -f ${CA} ]; then cat %s >> ${CA}; fi;`, azsSelfSignedCaPath) // include cacert.pem from python2.7 path for upgrade scenario if _, err := os.Stat("/usr/local/lib/python2.7/dist-packages/certifi/cacert.pem"); err == nil { - devImagePython = "python" + cert_command = fmt.Sprintf(`CA=/usr/local/lib/python2.7/dist-packages/certifi/cacert.pem; + if [ -f ${CA} ]; then cat %s >> ${CA}; fi;`, azsSelfSignedCaPath) } - cmd := exec.Command("/bin/bash", "-c", - fmt.Sprintf(`VER=$(%s -V | grep -o [0-9].[0-9]*. | grep -o [0-9].[0-9]*); - CA=/usr/local/lib/python${VER}/dist-packages/certifi/cacert.pem; - if [ -f ${CA} ]; then cat %s >> ${CA}; fi;`, devImagePython, azsSelfSignedCaPath)) + cmd := exec.Command("/bin/bash", "-c", cert_command) if out, err := cmd.CombinedOutput(); err != nil { log.Printf("output:%s\n", out) diff --git a/test/e2e/kubernetes/kubernetes_test.go b/test/e2e/kubernetes/kubernetes_test.go index db916beb1b..f3768e364e 100644 --- a/test/e2e/kubernetes/kubernetes_test.go +++ b/test/e2e/kubernetes/kubernetes_test.go @@ -803,7 +803,7 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu log.Printf("Image: %s", ds.Spec.Template.TemplateSpec.Containers[0].Image) log.Printf("OrchestratorVersion: %s", eng.ExpandedDefinition.Properties.OrchestratorProfile.OrchestratorVersion) version := eng.ExpandedDefinition.Properties.OrchestratorProfile.OrchestratorVersion - Expect(strings.HasSuffix(ds.Spec.Template.TemplateSpec.Containers[0].Image, version)).To(Equal(true)) + Expect(strings.Contains(ds.Spec.Template.TemplateSpec.Containers[0].Image, version)).To(Equal(true)) } else { Skip("Skipping as testing custom kube-proxy image") }