Skip to content

Commit 134d5d5

Browse files
committed
test: add start/stop grpc server UT
To increase test coverage a bit more... Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent 7e94246 commit 134d5d5

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

agent_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,19 @@ func TestGetProcessFromSandbox(t *testing.T) {
252252
"Process structures should be identical: got %+v, expecting %+v",
253253
proc, p)
254254
}
255+
256+
func TestStartStopGRPCServer(t *testing.T) {
257+
_, out, err := os.Pipe()
258+
assert.Nil(t, err, "%v", err)
259+
260+
s := &sandbox{
261+
containers: make(map[string]*container),
262+
channel: &serialChannel{serialConn: out},
263+
}
264+
265+
s.startGRPC()
266+
assert.NotNil(t, s.server, "failed starting grpc server")
267+
268+
s.stopGRPC()
269+
assert.Nil(t, s.server, "failed stopping grpc server")
270+
}

0 commit comments

Comments
 (0)