- // Wait until PullQueue and TrashQueue finish their work
- for {
- var done [2]bool
- for i := 0; i < 2; i++ {
- s := GetStatus(t, keepServers[i]+"/status.json")
- var pullQueueStatus interface{}
- pullQueueStatus = s.(map[string]interface{})["PullQueue"]
- var trashQueueStatus interface{}
- trashQueueStatus = s.(map[string]interface{})["TrashQueue"]
- if pullQueueStatus.(map[string]interface{})["Queued"] == float64(0) &&
- pullQueueStatus.(map[string]interface{})["InProgress"] == float64(0) &&
- trashQueueStatus.(map[string]interface{})["Queued"] == float64(0) &&
- trashQueueStatus.(map[string]interface{})["InProgress"] == float64(0) {
- done[i] = true
- }
+ // Get block indexes and verify that all backdated blocks except the first one are not included.
+ // The first block was also used in a collection that is not deleted and hence should remain.
+ var notExpected []string
+ notExpected = append(notExpected, oldBlockLocators[1:]...)
+
+ expected = expected[:0]
+ expected = append(expected, oldBlockLocators[0])
+ expected = append(expected, newBlockLocators...)
+ expected = append(expected, toBeDeletedCollectionLocator)
+ expected = append(expected, replicationCollectionLocator)
+ expected = append(expected, oneOfTwoWithSameDataLocator)
+ expected = append(expected, secondOfTwoWithSameDataLocator)
+
+ VerifyBlocks(t, notExpected, expected)
+
+ // Reduce replication on replicationCollectionUuid collection and verify that the overreplicated blocks are untouched.
+
+ // Default replication level is 2; first verify that the replicationCollectionLocator appears in both volumes
+ for i := 0; i < len(keepServers); i++ {
+ indexes := GetBlockIndexesForServer(t, i)
+ if !ValueInArray(replicationCollectionLocator, indexes) {
+ t.Fatalf("Not found block in index %s", replicationCollectionLocator)