Skip to content

Commit

Permalink
test: e2e tests download of larger files (Azure#3412)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadarsie authored and penggu committed Oct 28, 2020
1 parent 1400f55 commit d6a4b60
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/e2e/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,7 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
By("Ensuring we can create a curl pod to connect to the service")
ilbCurlPod, err := pod.RunLinuxWithRetry("byrnedo/alpine-curl", "curl-to-ilb", "default", fmt.Sprintf("curl %s", sILB.Status.LoadBalancer.Ingress[0]["ip"]), false, 1*time.Minute, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())

By("Ensuring we can create an ELB service attachment")
sELB, err := service.CreateServiceFromFileDeleteIfExist(filepath.Join(WorkloadDir, "ingress-nginx-elb.yaml"), serviceName+"-elb", "default")
Expect(err).NotTo(HaveOccurred())
Expand All @@ -1433,9 +1434,21 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
By("Ensuring we can connect to the ELB service on the service IP")
err = sELB.ValidateWithRetry("(Welcome to nginx)", 30*time.Second, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())

By("Ensuring we can connect to the ELB service from another pod")
elbCurlPod, err := pod.RunLinuxWithRetry("byrnedo/alpine-curl", "curl-to-elb", "default", fmt.Sprintf("curl %s", sELB.Status.LoadBalancer.Ingress[0]["ip"]), false, 1*time.Minute, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())

By("Ensuring we can donwnload files through the ELB")
pods, err := pod.GetAllByPrefixWithRetry(deploymentPrefix, "default", 3*time.Second, cfg.Timeout)
for _, p := range pods {
out, err := p.Exec("--", "/bin/bash", "-c", "base64 /dev/urandom | head -c 500000 | tee -a /usr/share/nginx/html/index.html > /dev/null")
log.Printf("%s\n", string(out))
Expect(err).NotTo(HaveOccurred())
}
err = sELB.ValidateWithRetry("(Welcome to nginx)", 30*time.Second, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())

err = sILB.Delete(util.DefaultDeleteRetries)
Expect(err).NotTo(HaveOccurred())
err = sELB.Delete(util.DefaultDeleteRetries)
Expand Down Expand Up @@ -1897,6 +1910,16 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
Expect(pass).To(BeTrue())
}

By("Ensuring we can donwnload files through the ELB")
for _, iisPod := range iisPods {
fileGenCmd := "(1..(500kb/34)).foreach({-join ('4489bfc5648d4ab58c7129a1d5f2f061') }) | Add-Content C:\\inetpub\\wwwroot\\iisstart.htm"
out, err := iisPod.Exec("--", "powershell", "-command", fileGenCmd)
log.Printf("%s\n", string(out))
Expect(err).NotTo(HaveOccurred())
}
err = iisService.ValidateWithRetry("(IIS Windows Server)", 30*time.Second, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())

By("Verifying pods & services can be deleted")
err = iisDeploy.Delete(util.DefaultDeleteRetries)
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit d6a4b60

Please sign in to comment.