2798: Started adding tests that ShuffledServiceRoots behavior is consistent
[arvados.git] / sdk / go / src / arvados.org / keepclient / keepclient_test.go
index 95f6c3cc65d44545292d9697f1b79f00a646cd75..4152eb357622e9e7c398a3c4f76987d225beb004 100644 (file)
@@ -13,11 +13,19 @@ type MySuite struct{}
 var _ = Suite(&MySuite{})
 
 func (s *MySuite) TestGetKeepDisks(c *C) {
-       k, err := KeepDisks()
+       sr, err := KeepDisks()
        c.Assert(err, Equals, nil)
-       c.Assert(len(k), Equals, 2)
-       c.Assert(k[0].Hostname, Equals, "localhost")
-       c.Assert(k[0].Port, Equals, 25108)
-       c.Assert(k[1].Hostname, Equals, "localhost")
-       c.Assert(k[1].Port, Equals, 25107)
+       c.Assert(len(sr), Equals, 2)
+       c.Assert(sr[0], Equals, "http://localhost:25107")
+       c.Assert(sr[1], Equals, "http://localhost:25108")
+
+       service_roots := []string{"http://localhost:25107", "http://localhost:25108", "http://localhost:25109", "http://localhost:25110", "http://localhost:25111", "http://localhost:25112", "http://localhost:25113", "http://localhost:25114", "http://localhost:25115", "http://localhost:25116", "http://localhost:25117", "http://localhost:25118", "http://localhost:25119", "http://localhost:25120", "http://localhost:25121", "http://localhost:25122", "http://localhost:25123"}
+
+       // "foo" acbd18db4cc2f85cedef654fccc4a4d8
+       //foo_shuffle := []string{"http://localhost:25116", "http://localhost:25120", "http://localhost:25119", "http://localhost:25122", "http://localhost:25108", "http://localhost:25114", "http://localhost:25112", "http://localhost:25107", "http://localhost:25118", "http://localhost:25111", "http://localhost:25113", "http://localhost:25121", "http://localhost:25110", "http://localhost:25117", "http://localhost:25109", "http://localhost:25115", "http://localhost:25123"}
+       ShuffledServiceRoots(service_roots, "acbd18db4cc2f85cedef654fccc4a4d8")
+
+       // "bar" 37b51d194a7513e45b56f6524f2d51f2
+       //bar_shuffle := []string{"http://localhost:25108", "http://localhost:25112", "http://localhost:25119", "http://localhost:25107", "http://localhost:25110", "http://localhost:25116", "http://localhost:25122", "http://localhost:25120", "http://localhost:25121", "http://localhost:25117", "http://localhost:25111", "http://localhost:25123", "http://localhost:25118", "http://localhost:25113", "http://localhost:25114", "http://localhost:25115", "http://localhost:25109"}
+
 }