Skip to content

Commit b8ecac4

Browse files
committed
Don't use testMultipleVMsRunner
Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent ccb6a94 commit b8ecac4

File tree

1 file changed

+3
-34
lines changed

1 file changed

+3
-34
lines changed

runtime/service_integ_test.go

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"bytes"
1818
"context"
1919
"fmt"
20-
"io"
2120
"io/ioutil"
2221
"os"
2322
"os/exec"
@@ -245,35 +244,7 @@ func createTapDevice(ctx context.Context, tapName string) error {
245244
return nil
246245
}
247246

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-
262247
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) {
277248
prepareIntegTest(t)
278249

279250
netns, err := ns.GetCurrentNS()
@@ -373,7 +344,7 @@ func (runner *testMultipleVMsRunner) TestMultipleVMs(t *testing.T) {
373344
containerWg.Add(1)
374345
go func(containerID int) {
375346
defer containerWg.Done()
376-
runner.testMultipleExecs(
347+
testMultipleExecs(
377348
ctx,
378349
t,
379350
vmID,
@@ -418,7 +389,7 @@ func (runner *testMultipleVMsRunner) TestMultipleVMs(t *testing.T) {
418389
vmWg.Wait()
419390
}
420391

421-
func (runner *testMultipleVMsRunner) testMultipleExecs(
392+
func testMultipleExecs(
422393
ctx context.Context,
423394
t *testing.T,
424395
vmID int,
@@ -450,10 +421,8 @@ func (runner *testMultipleVMsRunner) testMultipleExecs(
450421
firecrackeroci.WithVMID(vmIDStr),
451422
),
452423
)
453-
defer newContainer.Delete(ctx)
454-
455424
require.NoError(t, err, "failed to create container %s", containerName)
456-
runner.containers = append(runner.containers, newContainer)
425+
defer newContainer.Delete(ctx)
457426

458427
var taskStdout bytes.Buffer
459428
var taskStderr bytes.Buffer

0 commit comments

Comments
 (0)