summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-02 21:11:23 +0300
committerValery Piashchynski <[email protected]>2021-06-02 21:11:23 +0300
commite7215c942926188c56aaad261ad47fe26ba7d05c (patch)
tree1db16535272cea701ba62616ec1d9bb3d123e83d /tests
parent6ccc3bb5e90073f579794c2d306ec01590afea05 (diff)
- Additional Informer tests
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/plugins/informer/informer_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/plugins/informer/informer_test.go b/tests/plugins/informer/informer_test.go
index d40d7093..61be85a1 100644
--- a/tests/plugins/informer/informer_test.go
+++ b/tests/plugins/informer/informer_test.go
@@ -85,11 +85,27 @@ func TestInformerInit(t *testing.T) {
time.Sleep(time.Second)
t.Run("InformerWorkersRpcTest", informerWorkersRPCTest)
t.Run("InformerListRpcTest", informerListRPCTest)
+ t.Run("InformerPluginWithoutWorkersRpcTest", informerPluginWOWorkersRPCTest)
stopCh <- struct{}{}
wg.Wait()
}
+func informerPluginWOWorkersRPCTest(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 := struct {
+ // Workers is list of workers.
+ Workers []process.State `json:"workers"`
+ }{}
+
+ err = client.Call("informer.Workers", "informer.config", &list)
+ assert.NoError(t, err)
+ assert.Len(t, list.Workers, 0)
+}
+
func informerWorkersRPCTest(t *testing.T) {
conn, err := net.Dial("tcp", "127.0.0.1:6001")
assert.NoError(t, err)