Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
test: add start/stop grpc server UT
Browse files Browse the repository at this point in the history
To increase test coverage a bit more...

Signed-off-by: Peng Tao <[email protected]>
  • Loading branch information
bergwolf committed Apr 13, 2018
1 parent 7e94246 commit 134d5d5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,19 @@ func TestGetProcessFromSandbox(t *testing.T) {
"Process structures should be identical: got %+v, expecting %+v",
proc, p)
}

func TestStartStopGRPCServer(t *testing.T) {
_, out, err := os.Pipe()
assert.Nil(t, err, "%v", err)

s := &sandbox{
containers: make(map[string]*container),
channel: &serialChannel{serialConn: out},
}

s.startGRPC()
assert.NotNil(t, s.server, "failed starting grpc server")

s.stopGRPC()
assert.Nil(t, s.server, "failed stopping grpc server")
}

0 comments on commit 134d5d5

Please sign in to comment.