client: testing RPC

This commit is contained in:
Armon Dadgar 2015-08-20 16:13:05 -07:00
parent 0f2fe6a425
commit a6c4d2a63f
1 changed files with 19 additions and 0 deletions

View File

@ -93,3 +93,22 @@ func TestClient_RPC(t *testing.T) {
t.Fatalf("err: %v", err)
})
}
func TestClient_RPC_Passthrough(t *testing.T) {
s1, _ := testServer(t, nil)
defer s1.Shutdown()
c1 := testClient(t, func(c *Config) {
c.RPCHandler = s1
})
defer c1.Shutdown()
// RPC should succeed
testutil.WaitForResult(func() (bool, error) {
var out struct{}
err := c1.RPC("Status.Ping", struct{}{}, &out)
return err == nil, err
}, func(err error) {
t.Fatalf("err: %v", err)
})
}