summaryrefslogtreecommitdiff
path: root/pkg/machine/e2e/init_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/machine/e2e/init_test.go')
-rw-r--r--pkg/machine/e2e/init_test.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/pkg/machine/e2e/init_test.go b/pkg/machine/e2e/init_test.go
index 6949eb0af..40f140cae 100644
--- a/pkg/machine/e2e/init_test.go
+++ b/pkg/machine/e2e/init_test.go
@@ -3,6 +3,7 @@ package e2e
import (
"io/ioutil"
"os"
+ "runtime"
"time"
"github.com/containers/podman/v4/pkg/machine"
@@ -44,9 +45,9 @@ var _ = Describe("podman machine init", func() {
Expect(len(inspectBefore)).To(BeNumerically(">", 0))
testMachine := inspectBefore[0]
- Expect(testMachine.VM.Name).To(Equal(mb.names[0]))
- Expect(testMachine.VM.CPUs).To(Equal(uint64(1)))
- Expect(testMachine.VM.Memory).To(Equal(uint64(2048)))
+ Expect(testMachine.Name).To(Equal(mb.names[0]))
+ Expect(testMachine.Resources.CPUs).To(Equal(uint64(1)))
+ Expect(testMachine.Resources.Memory).To(Equal(uint64(2048)))
})
@@ -61,7 +62,7 @@ var _ = Describe("podman machine init", func() {
Expect(len(inspectBefore)).To(BeNumerically(">", 0))
Expect(err).To(BeNil())
Expect(len(inspectBefore)).To(BeNumerically(">", 0))
- Expect(inspectBefore[0].VM.Name).To(Equal(mb.names[0]))
+ Expect(inspectBefore[0].Name).To(Equal(mb.names[0]))
s := startMachine{}
ssession, err := mb.setCmd(s).setTimeout(time.Minute * 10).run()
@@ -104,7 +105,15 @@ var _ = Describe("podman machine init", func() {
memorySession, err := mb.setName(name).setCmd(sshMemory.withSSHComand([]string{"cat", "/proc/meminfo", "|", "numfmt", "--field", "2", "--from-unit=Ki", "--to-unit=Mi", "|", "sed", "'s/ kB/M/g'", "|", "grep", "MemTotal"})).run()
Expect(err).To(BeNil())
Expect(memorySession).To(Exit(0))
- Expect(memorySession.outputToString()).To(ContainSubstring("3824"))
+ switch runtime.GOOS {
+ // os's handle memory differently
+ case "linux":
+ Expect(memorySession.outputToString()).To(ContainSubstring("3821"))
+ case "darwin":
+ Expect(memorySession.outputToString()).To(ContainSubstring("3824"))
+ default:
+ // add windows when testing on that platform
+ }
sshTimezone := sshMachine{}
timezoneSession, err := mb.setName(name).setCmd(sshTimezone.withSSHComand([]string{"date"})).run()