@@ -1939,7 +1939,19 @@ func TestLoadSnapshot(t *testing.T) {
1939
1939
},
1940
1940
1941
1941
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
+
1943
1955
m , err := NewMachine (ctx , cfg , func (m * Machine ) {
1944
1956
// Rewriting m.cmd partially wouldn't work since Cmd has
1945
1957
// some unexported members
@@ -2078,10 +2090,21 @@ func TestLoadSnapshot(t *testing.T) {
2078
2090
VMIfName : "eth0" ,
2079
2091
},
2080
2092
}
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
+ }
2085
2108
2086
2109
cmd := VMCommandBuilder {}.WithSocketPath (fmt .Sprintf ("%s.load" , socketPath )).WithBin (getFirecrackerBinaryPath ()).Build (ctx )
2087
2110
0 commit comments