Skip to content

Commit

Permalink
test: fixes for akse e2e tests (Azure#3874)
Browse files Browse the repository at this point in the history
  • Loading branch information
haofan-ms authored and penggu committed Oct 28, 2020
1 parent fe5d6eb commit 0f8f32b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test/e2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 0f8f32b

Please sign in to comment.