(t *testing.T)
| 30 | const testStorePath2 = "./test2.keystore" |
| 31 | |
| 32 | func TestSaveDHT(t *testing.T) { |
| 33 | kms.Unittest = true |
| 34 | utils.RemoveAll(testStorePath1 + "*") |
| 35 | utils.RemoveAll(testStorePath2 + "*") |
| 36 | //kms.ResetBucket() |
| 37 | |
| 38 | Convey("save DHT", t, func() { |
| 39 | x, _ := InitConsistent(testStorePath1, new(KMSStorage), false) |
| 40 | x.Add(NewNodeFromString("111111")) |
| 41 | x.Add(NewNodeFromString(("3333"))) |
| 42 | So(len(x.circle), ShouldEqual, x.NumberOfReplicas*2) |
| 43 | So(len(x.sortedHashes), ShouldEqual, x.NumberOfReplicas*2) |
| 44 | So(sort.IsSorted(x.sortedHashes), ShouldBeTrue) |
| 45 | kms.ClosePublicKeyStore() |
| 46 | utils.CopyFile(testStorePath1, testStorePath2) |
| 47 | }) |
| 48 | } |
| 49 | |
| 50 | func TestLoadDHT(t *testing.T) { |
| 51 | Convey("load existing DHT", t, func() { |
nothing calls this directly
no test coverage detected