@@ -17,7 +17,6 @@ import (
17
17
"bytes"
18
18
"context"
19
19
"fmt"
20
- "io"
21
20
"io/ioutil"
22
21
"os"
23
22
"os/exec"
@@ -245,35 +244,7 @@ func createTapDevice(ctx context.Context, tapName string) error {
245
244
return nil
246
245
}
247
246
248
- type testMultipleVMsRunner struct {
249
- containers []containerd.Container
250
- }
251
-
252
- func (runner * testMultipleVMsRunner ) ImportPath () string { return "" }
253
- func (runner * testMultipleVMsRunner ) MatchString (pat , str string ) (bool , error ) {
254
- return pat == str , nil
255
- }
256
- func (runner * testMultipleVMsRunner ) StartCPUProfile (w io.Writer ) error { return nil }
257
- func (runner * testMultipleVMsRunner ) StopCPUProfile () {}
258
- func (runner * testMultipleVMsRunner ) StartTestLog (w io.Writer ) {}
259
- func (runner * testMultipleVMsRunner ) StopTestLog () error { return nil }
260
- func (runner * testMultipleVMsRunner ) WriteProfileTo (str string , w io.Writer , n int ) error { return nil }
261
-
262
247
func TestMultipleVMs_Isolated (t * testing.T ) {
263
- runner := & testMultipleVMsRunner {}
264
- tests := []testing.InternalTest {
265
- {
266
- Name : "TestMultipleVMs_Isolated" ,
267
- F : runner .TestMultipleVMs ,
268
- },
269
- }
270
- m := testing .MainStart (runner , tests , nil , nil )
271
- code := m .Run ()
272
-
273
- os .Exit (code )
274
- }
275
-
276
- func (runner * testMultipleVMsRunner ) TestMultipleVMs (t * testing.T ) {
277
248
prepareIntegTest (t )
278
249
279
250
netns , err := ns .GetCurrentNS ()
@@ -373,7 +344,7 @@ func (runner *testMultipleVMsRunner) TestMultipleVMs(t *testing.T) {
373
344
containerWg .Add (1 )
374
345
go func (containerID int ) {
375
346
defer containerWg .Done ()
376
- runner . testMultipleExecs (
347
+ testMultipleExecs (
377
348
ctx ,
378
349
t ,
379
350
vmID ,
@@ -418,7 +389,7 @@ func (runner *testMultipleVMsRunner) TestMultipleVMs(t *testing.T) {
418
389
vmWg .Wait ()
419
390
}
420
391
421
- func ( runner * testMultipleVMsRunner ) testMultipleExecs (
392
+ func testMultipleExecs (
422
393
ctx context.Context ,
423
394
t * testing.T ,
424
395
vmID int ,
@@ -450,10 +421,8 @@ func (runner *testMultipleVMsRunner) testMultipleExecs(
450
421
firecrackeroci .WithVMID (vmIDStr ),
451
422
),
452
423
)
453
- defer newContainer .Delete (ctx )
454
-
455
424
require .NoError (t , err , "failed to create container %s" , containerName )
456
- runner . containers = append ( runner . containers , newContainer )
425
+ defer newContainer . Delete ( ctx )
457
426
458
427
var taskStdout bytes.Buffer
459
428
var taskStderr bytes.Buffer
0 commit comments