summaryrefslogtreecommitdiff
path: root/tests/plugins/informer/informer_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-25 13:10:06 +0300
committerValery Piashchynski <[email protected]>2021-01-25 13:10:06 +0300
commit2a0e7d37d825da6bb0538599ce0e2edaaa59403b (patch)
tree89c00a43333246bb6c6815c923548eecd7d4e717 /tests/plugins/informer/informer_test.go
parentb18a3578b6d299aac5dfcc016c2a3a0f6905aa0d (diff)
resolve #415
Diffstat (limited to 'tests/plugins/informer/informer_test.go')
-rw-r--r--tests/plugins/informer/informer_test.go17
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])
+}