From e60c90927620b0e0542e5f141c510150f3382b96 Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Sun, 5 Oct 2014 13:15:59 -0700 Subject: [PATCH] command/keyring: clean up tests --- command/keyring_test.go | 19 ------------------- consul/internal_endpoint.go | 5 +++-- consul/rpc.go | 2 +- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/command/keyring_test.go b/command/keyring_test.go index 7f2d4c0748..25e20599cc 100644 --- a/command/keyring_test.go +++ b/command/keyring_test.go @@ -88,25 +88,6 @@ func TestKeyringCommandRun_failedConnection(t *testing.T) { } } -func TestKeyringCommandRun_initKeyringFail(t *testing.T) { - ui := new(cli.MockUi) - c := &KeyringCommand{Ui: ui} - - // Should error if no data-dir given - args := []string{"-init=HS5lJ+XuTlYKWaeGYyG+/A=="} - code := c.Run(args) - if code != 1 { - t.Fatalf("bad: %d. %#v", code, ui.ErrorWriter.String()) - } - - // Errors on invalid key - args = []string{"-init=xyz", "-data-dir=/tmp"} - code = c.Run(args) - if code != 1 { - t.Fatalf("should have errored") - } -} - func listKeys(t *testing.T, addr string) string { ui := new(cli.MockUi) c := &KeyringCommand{Ui: ui} diff --git a/consul/internal_endpoint.go b/consul/internal_endpoint.go index 055e450c71..fe3c68162f 100644 --- a/consul/internal_endpoint.go +++ b/consul/internal_endpoint.go @@ -64,8 +64,9 @@ func (m *Internal) EventFire(args *structs.EventFireRequest, return m.srv.UserEvent(args.Name, args.Payload) } -// ListKeys will query the WAN and LAN gossip keyrings of all nodes, adding -// results into a collective response as we go. +// KeyringOperation will query the WAN and LAN gossip keyrings of all nodes, +// adding results into a collective response as we go. It can describe requests +// for all keyring-related operations. func (m *Internal) KeyringOperation( args *structs.KeyringRequest, reply *structs.KeyringResponses) error { diff --git a/consul/rpc.go b/consul/rpc.go index f400b2be95..fbb73ce7b3 100644 --- a/consul/rpc.go +++ b/consul/rpc.go @@ -225,7 +225,7 @@ func (s *Server) forwardDC(method, dc string, args interface{}, reply interface{ // globalRPC is used to forward an RPC request to one server in each datacenter. // This will only error for RPC-related errors. Otherwise, application-level -// errors are returned inside of the inner response objects. +// errors can be sent in the response objects. func (s *Server) globalRPC(method string, args interface{}, reply structs.CompoundResponse) error {