@@ -54,7 +54,7 @@ var _ = Describe("podman machine init", func() {
5454
5555 bi := new (initMachine )
5656 want := fmt .Sprintf ("system connection \" %s\" already exists" , badName )
57- badInit , berr := mb .setName (badName ).setCmd (bi .withImage (mb . imagePath )).run ()
57+ badInit , berr := mb .setName (badName ).setCmd (bi .withFakeImage (mb )).run ()
5858 Expect (berr ).ToNot (HaveOccurred ())
5959 Expect (badInit ).To (Exit (125 ))
6060 Expect (badInit .errorToString ()).To (ContainSubstring (want ))
@@ -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 ])))
@@ -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
@@ -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
@@ -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