command/keyring: clean up tests

This commit is contained in:
Ryan Uber 2014-10-05 13:15:59 -07:00
parent 0b8fe6cc83
commit e60c909276
3 changed files with 4 additions and 22 deletions

View File

@ -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 { func listKeys(t *testing.T, addr string) string {
ui := new(cli.MockUi) ui := new(cli.MockUi)
c := &KeyringCommand{Ui: ui} c := &KeyringCommand{Ui: ui}

View File

@ -64,8 +64,9 @@ func (m *Internal) EventFire(args *structs.EventFireRequest,
return m.srv.UserEvent(args.Name, args.Payload) return m.srv.UserEvent(args.Name, args.Payload)
} }
// ListKeys will query the WAN and LAN gossip keyrings of all nodes, adding // KeyringOperation will query the WAN and LAN gossip keyrings of all nodes,
// results into a collective response as we go. // adding results into a collective response as we go. It can describe requests
// for all keyring-related operations.
func (m *Internal) KeyringOperation( func (m *Internal) KeyringOperation(
args *structs.KeyringRequest, args *structs.KeyringRequest,
reply *structs.KeyringResponses) error { reply *structs.KeyringResponses) error {

View File

@ -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. // 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 // 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{}, func (s *Server) globalRPC(method string, args interface{},
reply structs.CompoundResponse) error { reply structs.CompoundResponse) error {