@@ -2062,12 +2062,12 @@ func TestLoadSnapshot(t *testing.T) {
2062
2062
2063
2063
cases := []struct {
2064
2064
name string
2065
- createSnapshot func (ctx context.Context , machineLogger * logrus.Logger , socketPath , memPath , snapPath string )
2066
- loadSnapshot func (ctx context.Context , machineLogger * logrus.Logger , socketPath , memPath , snapPath string )
2065
+ createSnapshot func (ctx context.Context , t * testing. T , machineLogger * logrus.Logger , socketPath , memPath , snapPath string )
2066
+ loadSnapshot func (ctx context.Context , t * testing. T , machineLogger * logrus.Logger , socketPath , memPath , snapPath string )
2067
2067
}{
2068
2068
{
2069
2069
name : "TestLoadSnapshot" ,
2070
- createSnapshot : func (ctx context.Context , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2070
+ createSnapshot : func (ctx context.Context , t * testing. T , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2071
2071
// Create a snapshot
2072
2072
cfg := createValidConfig (t , socketPath + ".create" )
2073
2073
m , err := NewMachine (ctx , cfg , func (m * Machine ) {
@@ -2091,7 +2091,7 @@ func TestLoadSnapshot(t *testing.T) {
2091
2091
require .NoError (t , err )
2092
2092
},
2093
2093
2094
- loadSnapshot : func (ctx context.Context , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2094
+ loadSnapshot : func (ctx context.Context , t * testing. T , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2095
2095
// Note that many fields are not necessary when loading a snapshot
2096
2096
cfg := Config {
2097
2097
SocketPath : socketPath + ".load" ,
@@ -2127,11 +2127,11 @@ func TestLoadSnapshot(t *testing.T) {
2127
2127
},
2128
2128
{
2129
2129
name : "TestLoadSnapshot without create" ,
2130
- createSnapshot : func (ctx context.Context , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2130
+ createSnapshot : func (ctx context.Context , t * testing. T , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2131
2131
2132
2132
},
2133
2133
2134
- loadSnapshot : func (ctx context.Context , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2134
+ loadSnapshot : func (ctx context.Context , t * testing. T , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2135
2135
cfg := createValidConfig (t , socketPath + ".load" )
2136
2136
m , err := NewMachine (ctx , cfg , func (m * Machine ) {
2137
2137
// Rewriting m.cmd partially wouldn't work since Cmd has
@@ -2147,7 +2147,7 @@ func TestLoadSnapshot(t *testing.T) {
2147
2147
},
2148
2148
{
2149
2149
name : "TestLoadSnapshot and check contents (via ssh)" ,
2150
- createSnapshot : func (ctx context.Context , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2150
+ createSnapshot : func (ctx context.Context , t * testing. T , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2151
2151
cniConfPath := fmt .Sprintf ("%s/%s.conflist" , cniConfDir , networkName )
2152
2152
err := writeCNIConfWithHostLocalSubnet (cniConfPath , networkName , subnet )
2153
2153
require .NoError (t , err )
@@ -2209,7 +2209,7 @@ func TestLoadSnapshot(t *testing.T) {
2209
2209
require .NoError (t , err )
2210
2210
},
2211
2211
2212
- loadSnapshot : func (ctx context.Context , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2212
+ loadSnapshot : func (ctx context.Context , t * testing. T , machineLogger * logrus.Logger , socketPath , memPath , snapPath string ) {
2213
2213
var ipFreed bool = false
2214
2214
var err error
2215
2215
@@ -2316,8 +2316,8 @@ func TestLoadSnapshot(t *testing.T) {
2316
2316
machineLogger := logrus .New ()
2317
2317
machineLogger .Out = io .MultiWriter (os .Stderr , & logBuffer )
2318
2318
2319
- c .createSnapshot (ctx , machineLogger , socketPath , snapPath , memPath )
2320
- c .loadSnapshot (ctx , machineLogger , socketPath , snapPath , memPath )
2319
+ c .createSnapshot (ctx , t , machineLogger , socketPath , snapPath , memPath )
2320
+ c .loadSnapshot (ctx , t , machineLogger , socketPath , snapPath , memPath )
2321
2321
})
2322
2322
}
2323
2323
0 commit comments