Fix tests

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon 2019-06-24 15:23:38 -04:00
parent 803a2b04d1
commit 79d835457d

View file

@ -59,7 +59,7 @@ var _ = Describe("Podman generate kube", func() {
Expect(kube.ExitCode()).To(Equal(0)) Expect(kube.ExitCode()).To(Equal(0))
pod := new(v1.Pod) pod := new(v1.Pod)
err := yaml.Unmarshal(kube.OutputToString(), pod) err := yaml.Unmarshal([]byte(kube.OutputToString()), pod)
Expect(err).To(BeNil()) Expect(err).To(BeNil())
}) })
@ -73,7 +73,7 @@ var _ = Describe("Podman generate kube", func() {
Expect(kube.ExitCode()).To(Equal(0)) Expect(kube.ExitCode()).To(Equal(0))
pod := new(v1.Pod) pod := new(v1.Pod)
err := yaml.Unmarshal(kube.OutputToString(), pod) err := yaml.Unmarshal([]byte(kube.OutputToString()), pod)
Expect(err).To(BeNil()) Expect(err).To(BeNil())
}) })
@ -90,7 +90,7 @@ var _ = Describe("Podman generate kube", func() {
Expect(kube.ExitCode()).To(Equal(0)) Expect(kube.ExitCode()).To(Equal(0))
pod := new(v1.Pod) pod := new(v1.Pod)
err := yaml.Unmarshal(kube.OutputToString(), pod) err := yaml.Unmarshal([]byte(kube.OutputToString()), pod)
Expect(err).To(BeNil()) Expect(err).To(BeNil())
}) })
@ -114,17 +114,17 @@ var _ = Describe("Podman generate kube", func() {
It("podman generate kube on pod with ports", func() { It("podman generate kube on pod with ports", func() {
podName := "test" podName := "test"
podSession := podmanTest.Podman("pod", "create", "--name", podName, "-p", "4000:4000", "-p", "5000:5000") podSession := podmanTest.Podman([]string{"pod", "create", "--name", podName, "-p", "4000:4000", "-p", "5000:5000"})
podSession.WaitWithDefaultTimeout() podSession.WaitWithDefaultTimeout()
Expect(podSession.ExitCode()).To(Equal(0)) Expect(podSession.ExitCode()).To(Equal(0))
ctr1Name := "ctr1" ctr1Name := "ctr1"
ctr1Session := podmanTest.Podman("create", "--name", ctr1Name, "--pod", podName, ALPINE, "top") ctr1Session := podmanTest.Podman([]string{"create", "--name", ctr1Name, "--pod", podName, ALPINE, "top"})
ctr1Session.WaitWithDefaultTimeout() ctr1Session.WaitWithDefaultTimeout()
Expect(ctr1Session.ExitCode()).To(Equal(0)) Expect(ctr1Session.ExitCode()).To(Equal(0))
ctr2Name := "ctr2" ctr2Name := "ctr2"
ctr2Session := podmanTest.Podman("create", "--name", ctr2Name, "--pod", podName, ALPINE, "top") ctr2Session := podmanTest.Podman([]string{"create", "--name", ctr2Name, "--pod", podName, ALPINE, "top"})
ctr2Session.WaitWithDefaultTimeout() ctr2Session.WaitWithDefaultTimeout()
Expect(ctr2Session.ExitCode()).To(Equal(0)) Expect(ctr2Session.ExitCode()).To(Equal(0))
@ -133,7 +133,7 @@ var _ = Describe("Podman generate kube", func() {
Expect(kube.ExitCode()).To(Equal(0)) Expect(kube.ExitCode()).To(Equal(0))
pod := new(v1.Pod) pod := new(v1.Pod)
err := yaml.Unmarshal(kube.OutputToString(), pod) err := yaml.Unmarshal([]byte(kube.OutputToString()), pod)
Expect(err).To(BeNil()) Expect(err).To(BeNil())
foundPort4000 := 0 foundPort4000 := 0