From cbeb40f0ba0553e953c30dff0aea8e8d9db49c75 Mon Sep 17 00:00:00 2001 From: Gavin Inglis Date: Tue, 8 Aug 2023 13:43:43 -0700 Subject: [PATCH] fix: vm e2e tests nerdctl v1.5 nerdctl v1.5 introduced a change to output of container list operation where container names are returned as a list/slice object rather than string. Signed-off-by: Gavin Inglis --- e2e/vm/additional_disk_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e/vm/additional_disk_test.go b/e2e/vm/additional_disk_test.go index 56dc777b5..1b7a39688 100644 --- a/e2e/vm/additional_disk_test.go +++ b/e2e/vm/additional_disk_test.go @@ -20,9 +20,11 @@ const ( ) var testAdditionalDisk = func(o *option.Option) { + ginkgo.BeforeEach(func() { + command.RemoveAll(o) + }) ginkgo.Describe("Additional disk", ginkgo.Serial, func() { ginkgo.It("Retains container user data after the VM is deleted", func() { - command.Run(o, "volume", "create", volumeName) ginkgo.DeferCleanup(command.Run, o, "volume", "rm", volumeName) command.Run(o, "network", "create", networkName) ginkgo.DeferCleanup(command.Run, o, "network", "rm", networkName) @@ -42,8 +44,9 @@ var testAdditionalDisk = func(o *option.Option) { imageOutput := command.StdoutAsLines(o, "images", "--format", "{{.Name}}") gomega.Expect(imageOutput).Should(gomega.ContainElement(savedImage)) + // Changed in nerdctl v1.5 to [] https://github.com/containerd/nerdctl/commit/11d80f274257c064924f40bd007756110d863a16 psOutput := command.StdoutAsLines(o, "ps", "--all", "--format", "{{.Names}}") - gomega.Expect(psOutput).Should(gomega.ContainElement(containerName)) + gomega.Expect(psOutput).Should(gomega.ContainElement("[" + containerName + "]")) volumeOutput := command.StdoutAsLines(o, "volume", "ls", "--format", "{{.Name}}") gomega.Expect(volumeOutput).Should(gomega.ContainElement(volumeName))