Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4222 from openservicemesh/mergify/bp/release-v0.1…
Browse files Browse the repository at this point in the history
…1/pr-4218

fix(UpgradeTest) : Fix the upgrade e2e test (backport #4218)
  • Loading branch information
snehachhabria authored Oct 6, 2021
2 parents a94ed01 + c59ce41 commit 625ff97
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions tests/e2e/e2e_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package e2e

import (
"context"
"fmt"
"os/exec"
"path/filepath"
"time"
Expand Down Expand Up @@ -104,30 +105,22 @@ var _ = OSMDescribe("Upgrade from latest",
Expect(Td.AddNsToMesh(true, ns)).To(Succeed())

// Get simple pod definitions for the HTTP server
serverSvcAccDef, serverPodDef, serverSvcDef, err := Td.SimplePodApp(
SimplePodAppDef{
PodName: "server",
Namespace: ns,
Image: "kennethreitz/httpbin",
Ports: []int{80},
OS: Td.ClusterOS,
})
serverSvcAccDef, serverPodDef, serverSvcDef, err := Td.GetOSSpecificHTTPBinPod("server", ns)
Expect(err).NotTo(HaveOccurred())

_, err = Td.CreateServiceAccount(ns, &serverSvcAccDef)
Expect(err).NotTo(HaveOccurred())
dstPod, err := Td.CreatePod(ns, serverPodDef)
_, err = Td.CreatePod(ns, serverPodDef)
Expect(err).NotTo(HaveOccurred())
_, err = Td.CreateService(ns, serverSvcDef)
dstSvc, err := Td.CreateService(ns, serverSvcDef)
Expect(err).NotTo(HaveOccurred())

// Get simple Pod definitions for the client
svcAccDef, srcPodDef, svcDef, err := Td.SimplePodApp(SimplePodAppDef{
PodName: "client",
Namespace: ns,
Command: []string{"/bin/bash", "-c", "--"},
Args: []string{"while true; do sleep 30; done;"},
Image: "songrgg/alpine-debug",
Command: []string{"sleep", "365d"},
Image: "curlimages/curl",
Ports: []int{80},
OS: Td.ClusterOS,
})
Expand Down Expand Up @@ -169,7 +162,7 @@ var _ = OSMDescribe("Upgrade from latest",
SourceNs: srcPod.Namespace,
SourcePod: srcPod.Name,
SourceContainer: srcPod.Name,
Destination: dstPod.Name + "/status/200",
Destination: fmt.Sprintf("%s.%s.svc.cluster.local", dstSvc.Name, dstSvc.Namespace) + "/status/200",
})

if result.Err != nil || result.StatusCode != 200 {
Expand Down Expand Up @@ -225,7 +218,7 @@ var _ = OSMDescribe("Upgrade from latest",
// Verify that all the CRD's required by OSM are present in the cluster post an upgrade
// TODO: Find a decent way to do this without relying on the kubectl binary
// TODO: In the future when we bump the version on a CRD, we need to update this check to ensure that the version is the latest required version
stdout, stderr, err = Td.RunLocal("kubectl", "get", "-f", filepath.FromSlash("../../charts/osm/crds"))
stdout, stderr, err = Td.RunLocal("kubectl", "get", "-f", filepath.FromSlash("../../cmd/osm-bootstrap/crds"))
Td.T.Log(stdout.String())
if err != nil {
Td.T.Log("stderr:\n" + stderr.String())
Expand Down

0 comments on commit 625ff97

Please sign in to comment.