2798: Started adding tests that ShuffledServiceRoots behavior is consistent
[arvados.git] / sdk / go / src / arvados.org / keepclient / keepclient_test.go
1 package keepclient
2
3 import (
4         . "gopkg.in/check.v1"
5         "testing"
6 )
7
8 // Hook up gocheck into the "go test" runner.
9 func Test(t *testing.T) { TestingT(t) }
10
11 type MySuite struct{}
12
13 var _ = Suite(&MySuite{})
14
15 func (s *MySuite) TestGetKeepDisks(c *C) {
16         sr, err := KeepDisks()
17         c.Assert(err, Equals, nil)
18         c.Assert(len(sr), Equals, 2)
19         c.Assert(sr[0], Equals, "http://localhost:25107")
20         c.Assert(sr[1], Equals, "http://localhost:25108")
21
22         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"}
23
24         // "foo" acbd18db4cc2f85cedef654fccc4a4d8
25         //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"}
26         ShuffledServiceRoots(service_roots, "acbd18db4cc2f85cedef654fccc4a4d8")
27
28         // "bar" 37b51d194a7513e45b56f6524f2d51f2
29         //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"}
30
31 }