diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-06-24 14:56:41 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-06-24 14:56:41 -0400 |
commit | 803a2b04d17165a57b31d135368a08eace370e5b (patch) | |
tree | 3c719942784b811ca1cef3d19cba974330e107f3 | |
parent | 567e7c60fa696d3332159fc9641d54f242c42804 (diff) | |
download | podman-803a2b04d17165a57b31d135368a08eace370e5b.tar.gz podman-803a2b04d17165a57b31d135368a08eace370e5b.tar.bz2 podman-803a2b04d17165a57b31d135368a08eace370e5b.zip |
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 <matthew.heon@pm.me>
-rw-r--r-- | test/e2e/generate_kube_test.go | 15 |
1 files changed, 10 insertions, 5 deletions
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() { |