Move to URL based syntax formatting. (#3092)

For command line arguments we are currently following

- <node-1>:/path ... <node-n>:/path

This patch changes this to

- http://<node-1>/path ... http://<node-n>/path
This commit is contained in:
Harshavardhana
2016-10-27 03:30:52 -07:00
committed by GitHub
parent 30dc11a931
commit 9e2d0ac50b
36 changed files with 560 additions and 474 deletions

View File

@@ -23,6 +23,7 @@ import (
"io"
"net"
"net/rpc"
"net/url"
"runtime"
"testing"
)
@@ -144,17 +145,26 @@ func (s *TestRPCStorageSuite) SetUpSuite(c *testing.T) {
s.testServer = StartTestStorageRPCServer(c, s.serverType, 1)
listenAddress := s.testServer.Server.Listener.Addr().String()
for _, disk := range s.testServer.Disks {
remoteEndPoint, err := parseStorageEndPoint(listenAddress+":"+disk.path, 0)
if err != nil {
c.Fatalf("Unexpected error %s", err)
}
storageDisk, err := newRPCClient(remoteEndPoint)
for _, ep := range s.testServer.Disks {
ep.Host = listenAddress
storageDisk, err := newStorageRPC(ep)
if err != nil {
c.Fatal("Unable to initialize RPC client", err)
}
s.remoteDisks = append(s.remoteDisks, storageDisk)
}
_, err := newStorageRPC(nil)
if err != errInvalidArgument {
c.Fatalf("Unexpected error %s, expecting %s", err, errInvalidArgument)
}
u, err := url.Parse("http://abcd:abcd123@localhost/mnt/disk")
if err != nil {
c.Fatal("Unexpected error", err)
}
_, err = newStorageRPC(u)
if err != nil {
c.Fatal("Unexpected error", err)
}
}
// No longer used with gocheck, but used in explicit teardown code in