summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-01 13:27:17 -0400
committerGitHub <noreply@github.com>2021-10-01 13:27:17 -0400
commit1b88b678cf14946c4392bccfd9db2ff8510066ee (patch)
tree2b83b71166121cf0a85b3a8869627a481bd0a5de /test
parentc6a896b0c705415a9115dff354b0a19a2c08ce50 (diff)
parent641f0ccc4eb999af3c2a01d709769287ba45451c (diff)
downloadpodman-1b88b678cf14946c4392bccfd9db2ff8510066ee.tar.gz
podman-1b88b678cf14946c4392bccfd9db2ff8510066ee.tar.bz2
podman-1b88b678cf14946c4392bccfd9db2ff8510066ee.zip
Merge pull request #11707 from rhatdan/play
Add podman play kube --no-hosts options
Diffstat (limited to 'test')
-rw-r--r--test/e2e/play_kube_test.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 83ce751e6..a29d0ad46 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -1137,6 +1137,49 @@ var _ = Describe("Podman play kube", func() {
Expect(infraContainerImage).To(Equal(config.DefaultInfraImage))
})
+ It("podman play kube --no-host", func() {
+ err := writeYaml(checkInfraImagePodYaml, kubeYaml)
+ Expect(err).To(BeNil())
+
+ kube := podmanTest.Podman([]string{"play", "kube", "--no-hosts", kubeYaml})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube).Should(Exit(0))
+
+ podInspect := podmanTest.Podman([]string{"pod", "inspect", "check-infra-image"})
+ podInspect.WaitWithDefaultTimeout()
+ Expect(podInspect).Should(Exit(0))
+
+ data := podInspect.InspectPodToJSON()
+ for _, ctr := range data.Containers {
+ if strings.HasSuffix(ctr.Name, "-infra") {
+ continue
+ }
+ exec := podmanTest.Podman([]string{"exec", ctr.ID, "cat", "/etc/hosts"})
+ exec.WaitWithDefaultTimeout()
+ Expect(exec).Should(Exit(0))
+ Expect(exec.OutputToString()).To(Not(ContainSubstring("check-infra-image")))
+ }
+ })
+
+ It("podman play kube test HostAliases with --no-hosts", func() {
+ pod := getPod(withHostAliases("192.168.1.2", []string{
+ "test1.podman.io",
+ "test2.podman.io",
+ }),
+ withHostAliases("192.168.1.3", []string{
+ "test3.podman.io",
+ "test4.podman.io",
+ }),
+ )
+ err := generateKubeYaml("pod", pod, kubeYaml)
+ Expect(err).To(BeNil())
+
+ kube := podmanTest.Podman([]string{"play", "kube", "--no-hosts", kubeYaml})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube).Should(Exit(125))
+ Expect(kube.ErrorToString()).To(ContainSubstring("HostAliases in yaml file will not work with --no-hosts"))
+ })
+
It("podman play kube should use customized infra_image", func() {
conffile := filepath.Join(podmanTest.TempDir, "container.conf")