From 803a2b04d17165a57b31d135368a08eace370e5b Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 24 Jun 2019 14:56:41 -0400 Subject: Change Marshal -> Unmarshal in generate kube tests We need to verify that valid YAML was produced - Marshal will just pack the generated YAML even further. Signed-off-by: Matthew Heon --- test/e2e/generate_kube_test.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'test/e2e') diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index 760ba6851..4a14bddfa 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -58,7 +58,8 @@ var _ = Describe("Podman generate kube", func() { kube.WaitWithDefaultTimeout() Expect(kube.ExitCode()).To(Equal(0)) - _, err := yaml.Marshal(kube.OutputToString()) + pod := new(v1.Pod) + err := yaml.Unmarshal(kube.OutputToString(), pod) Expect(err).To(BeNil()) }) @@ -71,7 +72,8 @@ var _ = Describe("Podman generate kube", func() { kube.WaitWithDefaultTimeout() Expect(kube.ExitCode()).To(Equal(0)) - _, err := yaml.Marshal(kube.OutputToString()) + pod := new(v1.Pod) + err := yaml.Unmarshal(kube.OutputToString(), pod) Expect(err).To(BeNil()) }) @@ -87,7 +89,8 @@ var _ = Describe("Podman generate kube", func() { kube.WaitWithDefaultTimeout() Expect(kube.ExitCode()).To(Equal(0)) - _, err := yaml.Marshal(kube.OutputToString()) + pod := new(v1.Pod) + err := yaml.Unmarshal(kube.OutputToString(), pod) Expect(err).To(BeNil()) }) @@ -103,8 +106,10 @@ var _ = Describe("Podman generate kube", func() { kube.WaitWithDefaultTimeout() Expect(kube.ExitCode()).To(Equal(0)) - _, err := yaml.Marshal(kube.OutputToString()) - Expect(err).To(BeNil()) + // TODO: How do we test unmarshal with a service? We have two + // structs that need to be unmarshalled... + // _, err := yaml.Marshal(kube.OutputToString()) + // Expect(err).To(BeNil()) }) It("podman generate kube on pod with ports", func() { -- cgit v1.2.3-54-g00ecf