diff options
Diffstat (limited to 'tests/plugins/informer/informer_test.go')
-rw-r--r-- | tests/plugins/informer/informer_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/plugins/informer/informer_test.go b/tests/plugins/informer/informer_test.go index 41f1e21a..31e14ff4 100644 --- a/tests/plugins/informer/informer_test.go +++ b/tests/plugins/informer/informer_test.go @@ -86,13 +86,14 @@ func TestInformerInit(t *testing.T) { }() time.Sleep(time.Second) - t.Run("InformerRpcTest", informerRPCTest) + t.Run("InformerWorkersRpcTest", informerWorkersRPCTest) + t.Run("InformerListRpcTest", informerListRPCTest) stopCh <- struct{}{} wg.Wait() } -func informerRPCTest(t *testing.T) { +func informerWorkersRPCTest(t *testing.T) { conn, err := net.Dial("tcp", "127.0.0.1:6001") assert.NoError(t, err) client := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) @@ -106,3 +107,15 @@ func informerRPCTest(t *testing.T) { assert.NoError(t, err) assert.Len(t, list.Workers, 10) } + +func informerListRPCTest(t *testing.T) { + conn, err := net.Dial("tcp", "127.0.0.1:6001") + assert.NoError(t, err) + client := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) + // WorkerList contains list of workers. + list := make([]string, 0, 0) + + err = client.Call("informer.List", true, &list) + assert.NoError(t, err) + assert.Equal(t, "informer.plugin1", list[0]) +} |