@@ -88,7 +88,7 @@ var _ = Describe("podman machine init", func() {
8888 // Check that mounting to certain target directories like /tmp at the / level is NOT ok
8989 tmpVol := initMachine {}
9090 targetMount := "/tmp"
91- tmpVolSession , err := mb .setCmd (tmpVol .withImage (mb . imagePath ).withVolume (fmt .Sprintf ("/whatever:%s" , targetMount ))).run ()
91+ tmpVolSession , err := mb .setCmd (tmpVol .withFakeImage (mb ).withVolume (fmt .Sprintf ("/whatever:%s" , targetMount ))).run ()
9292 Expect (err ).ToNot (HaveOccurred ())
9393 Expect (tmpVolSession ).To (Exit (125 ))
9494 Expect (tmpVolSession .errorToString ()).To (ContainSubstring (fmt .Sprintf ("Error: machine mount destination cannot be %q: consider another location or a subdirectory of an existing location" , targetMount )))
@@ -102,7 +102,7 @@ var _ = Describe("podman machine init", func() {
102102
103103 It ("simple init" , func () {
104104 i := new (initMachine )
105- session , err := mb .setCmd (i .withImage (mb . imagePath )).run ()
105+ session , err := mb .setCmd (i .withFakeImage (mb )).run ()
106106 Expect (err ).ToNot (HaveOccurred ())
107107 Expect (session ).To (Exit (0 ))
108108
@@ -118,7 +118,7 @@ var _ = Describe("podman machine init", func() {
118118 Expect (testMachine .Resources .Memory ).To (BeEquivalentTo (uint64 (2048 )))
119119 }
120120 // creating a new VM with the same name must fail
121- repeatSession , err := mb .setCmd (i .withImage (mb . imagePath )).run ()
121+ repeatSession , err := mb .setCmd (i .withFakeImage (mb )).run ()
122122 Expect (err ).ToNot (HaveOccurred ())
123123 Expect (repeatSession ).To (Exit (125 ))
124124 Expect (repeatSession .errorToString ()).To (ContainSubstring (fmt .Sprintf ("Error: machine %q already exists" , mb .names [0 ])))
@@ -193,7 +193,7 @@ var _ = Describe("podman machine init", func() {
193193
194194 It ("simple init with start" , func () {
195195 i := initMachine {}
196- session , err := mb .setCmd (i .withImage (mb . imagePath )).run ()
196+ session , err := mb .setCmd (i .withFakeImage (mb )).run ()
197197 Expect (err ).ToNot (HaveOccurred ())
198198 Expect (session ).To (Exit (0 ))
199199
@@ -230,7 +230,7 @@ var _ = Describe("podman machine init", func() {
230230 It ("simple init with username" , func () {
231231 i := new (initMachine )
232232 remoteUsername := "remoteuser"
233- session , err := mb .setCmd (i .withImage (mb . imagePath ).withUsername (remoteUsername )).run ()
233+ session , err := mb .setCmd (i .withFakeImage (mb ).withUsername (remoteUsername )).run ()
234234 Expect (err ).ToNot (HaveOccurred ())
235235 Expect (session ).To (Exit (0 ))
236236
@@ -263,7 +263,7 @@ var _ = Describe("podman machine init", func() {
263263 skipIfWSL ("setting hardware resource numbers and timezone are not supported on WSL" )
264264 name := randomString ()
265265 i := new (initMachine )
266- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath ).withCPUs (2 ).withDiskSize (102 ).withMemory (4096 ).withTimezone ("Pacific/Honolulu" )).run ()
266+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb ).withCPUs (2 ).withDiskSize (102 ).withMemory (4096 ).withTimezone ("Pacific/Honolulu" )).run ()
267267 Expect (err ).ToNot (HaveOccurred ())
268268 Expect (session ).To (Exit (0 ))
269269
@@ -310,7 +310,7 @@ var _ = Describe("podman machine init", func() {
310310 skipIfWSL ("Configuring swap is not supported on WSL" )
311311 name := randomString ()
312312 i := new (initMachine )
313- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath ).withSwap (2048 ).withNow ()).run ()
313+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb ).withSwap (2048 ).withNow ()).run ()
314314 Expect (err ).ToNot (HaveOccurred ())
315315 Expect (session ).To (Exit (0 ))
316316
@@ -343,7 +343,7 @@ var _ = Describe("podman machine init", func() {
343343
344344 name := randomString ()
345345 i := new (initMachine )
346- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath ).withVolume (mount ).withVolume (mountWithSpaces ).withNow ()).run ()
346+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb ).withVolume (mount ).withVolume (mountWithSpaces ).withNow ()).run ()
347347 Expect (err ).ToNot (HaveOccurred ())
348348 Expect (session ).To (Exit (0 ))
349349
@@ -379,7 +379,7 @@ var _ = Describe("podman machine init", func() {
379379
380380 name := randomString ()
381381 i := new (initMachine )
382- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath ).withIgnitionPath (tmpFile .Name ())).run ()
382+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb ).withIgnitionPath (tmpFile .Name ())).run ()
383383 Expect (err ).ToNot (HaveOccurred ())
384384 Expect (session ).To (Exit (0 ))
385385
@@ -406,7 +406,7 @@ var _ = Describe("podman machine init", func() {
406406 It ("machine init rootless docker.sock check" , func () {
407407 i := initMachine {}
408408 name := randomString ()
409- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath )).run ()
409+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb )).run ()
410410 Expect (err ).ToNot (HaveOccurred ())
411411 Expect (session ).To (Exit (0 ))
412412
@@ -428,7 +428,7 @@ var _ = Describe("podman machine init", func() {
428428 It ("machine init rootful with docker.sock check" , func () {
429429 i := initMachine {}
430430 name := randomString ()
431- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath ).withRootful (true )).run ()
431+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb ).withRootful (true )).run ()
432432 Expect (err ).ToNot (HaveOccurred ())
433433 Expect (session ).To (Exit (0 ))
434434
@@ -455,7 +455,7 @@ var _ = Describe("podman machine init", func() {
455455 It ("init should cleanup on failure" , func () {
456456 i := new (initMachine )
457457 name := randomString ()
458- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath )).run ()
458+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb )).run ()
459459
460460 Expect (err ).ToNot (HaveOccurred ())
461461 Expect (session ).To (Exit (0 ))
@@ -482,7 +482,7 @@ var _ = Describe("podman machine init", func() {
482482 // Bad ignition path - init fails
483483 i = new (initMachine )
484484 i .ignitionPath = "/bad/path"
485- session , err = mb .setName (name ).setCmd (i .withImage (mb . imagePath )).run ()
485+ session , err = mb .setName (name ).setCmd (i .withFakeImage (mb )).run ()
486486 Expect (err ).ToNot (HaveOccurred ())
487487 Expect (session ).To (Exit (125 ))
488488
@@ -534,7 +534,7 @@ var _ = Describe("podman machine init", func() {
534534 // We should be able to init with a bad config present
535535 i := new (initMachine )
536536 name := randomString ()
537- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath )).run ()
537+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb )).run ()
538538 Expect (err ).ToNot (HaveOccurred ())
539539 Expect (session ).To (Exit (0 ))
540540
@@ -561,7 +561,7 @@ var _ = Describe("podman machine init", func() {
561561
562562 i := initMachine {}
563563 name := randomString ()
564- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath )).run ()
564+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb )).run ()
565565 Expect (err ).ToNot (HaveOccurred ())
566566 Expect (session ).To (Exit (0 ))
567567
@@ -612,7 +612,7 @@ var _ = Describe("podman machine init", func() {
612612
613613 i := initMachine {}
614614 name := randomString ()
615- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath )).run ()
615+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb )).run ()
616616 Expect (err ).ToNot (HaveOccurred ())
617617 Expect (session ).To (Exit (0 ))
618618
@@ -657,7 +657,7 @@ var _ = Describe("podman machine init", func() {
657657
658658 i := initMachine {}
659659 machineName := randomString ()
660- session , err := mb .setName (machineName ).setCmd (i .withImage (mb . imagePath ).withProvider (providerOverride )).run ()
660+ session , err := mb .setName (machineName ).setCmd (i .withFakeImage (mb ).withProvider (providerOverride )).run ()
661661 Expect (err ).ToNot (HaveOccurred ())
662662 Expect (session .errorToString ()).To (ContainSubstring (fmt .Sprintf ("unsupported provider %q" , providerOverride )))
663663 })
@@ -678,7 +678,7 @@ var _ = Describe("podman machine init", func() {
678678 // --provider
679679 for name , p := range verify {
680680 i := initMachine {}
681- session , err := mb .setName (name ).setCmd (i .withImage (mb . imagePath ).withProvider (p )).run ()
681+ session , err := mb .setName (name ).setCmd (i .withFakeImage (mb ).withProvider (p )).run ()
682682 Expect (err ).ToNot (HaveOccurred ())
683683 Expect (session .ExitCode ()).To (Equal (0 ))
684684 }
0 commit comments