@@ -1939,7 +1939,19 @@ func TestLoadSnapshot(t *testing.T) {
19391939 },
19401940
19411941 loadSnapshot : func (ctx context.Context , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
1942- cfg := createValidConfig (t , socketPath + ".load" )
1942+ // Note that many fields are not necessary when loading a snapshot
1943+ cfg := Config {
1944+ SocketPath : socketPath + ".load" ,
1945+ Drives : []models.Drive {
1946+ {
1947+ DriveID : String ("root" ),
1948+ IsRootDevice : Bool (true ),
1949+ IsReadOnly : Bool (true ),
1950+ PathOnHost : String (testRootfs ),
1951+ },
1952+ },
1953+ }
1954+
19431955 m , err := NewMachine (ctx , cfg , func (m * Machine ) {
19441956 // Rewriting m.cmd partially wouldn't work since Cmd has
19451957 // some unexported members
@@ -2078,10 +2090,21 @@ func TestLoadSnapshot(t *testing.T) {
20782090 VMIfName : "eth0" ,
20792091 },
20802092 }
2081- cfg := createValidConfig (t , fmt .Sprintf ("%s.load" , socketPath ),
2082- withRootDrive (rootfsPath ),
2083- withNetworkInterface (networkInterface ),
2084- )
2093+
2094+ cfg := Config {
2095+ SocketPath : socketPath + ".load" ,
2096+ Drives : []models.Drive {
2097+ {
2098+ DriveID : String ("root" ),
2099+ IsRootDevice : Bool (true ),
2100+ IsReadOnly : Bool (true ),
2101+ PathOnHost : String (rootfsPath ),
2102+ },
2103+ },
2104+ NetworkInterfaces : []NetworkInterface {
2105+ networkInterface ,
2106+ },
2107+ }
20852108
20862109 cmd := VMCommandBuilder {}.WithSocketPath (fmt .Sprintf ("%s.load" , socketPath )).WithBin (getFirecrackerBinaryPath ()).Build (ctx )
20872110
0 commit comments