File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ func checkMaxMemory(newMem strongunits.MiB) error {
249
249
return err
250
250
}
251
251
if total := strongunits .B (memStat .Total ); strongunits .B (memStat .Total ) < newMem .ToBytes () {
252
- return fmt .Errorf ("requested amount of memory (%d MB) greater than total system memory (%d MB)" , newMem , total )
252
+ return fmt .Errorf ("requested amount of memory (%d MB) greater than total system memory (%d MB)" , newMem , strongunits . ToMib ( total ) )
253
253
}
254
254
return nil
255
255
}
Original file line number Diff line number Diff line change @@ -71,11 +71,12 @@ var _ = Describe("podman machine init", func() {
71
71
// this comes in bytes
72
72
memStat , err := mem .VirtualMemory ()
73
73
Expect (err ).ToNot (HaveOccurred ())
74
- total := strongunits .ToMib (strongunits .B (memStat .Total )) + 1024
74
+ systemMem := strongunits .ToMib (strongunits .B (memStat .Total ))
75
75
76
76
badMem := initMachine {}
77
- badMemSession , err := mb .setCmd (badMem .withMemory (uint (total ))).run ()
77
+ badMemSession , err := mb .setCmd (badMem .withMemory (uint (systemMem + 1024 ))).run ()
78
78
Expect (err ).ToNot (HaveOccurred ())
79
+ Expect (badMemSession .errorToString ()).To (ContainSubstring (fmt .Sprintf ("greater than total system memory (%d MB)" , systemMem )))
79
80
Expect (badMemSession ).To (Exit (125 ))
80
81
})
81
82
You can’t perform that action at this time.
0 commit comments