Added unit-tests for treeWalkPool (#1969)

* Added unit-tests for treeWalkPool
* Added unit tests for tree-walk-fs
* Added period at the end of all comments.
* FS/XL: Unified tree walk tests for both backends
* Added disk failure related tests for treewalk

Replaced removeRandomDisks with removeDiskN. There is no need to
randomize disks that fail while the distribution of chunks in XL during
erasure coding data is random.
This commit is contained in:
Krishnan Parthasarathi
2016-06-28 22:32:00 -07:00
committed by Harshavardhana
parent 59366d8f4c
commit b6b9e88e47
4 changed files with 385 additions and 8 deletions
+7 -5
View File
@@ -546,11 +546,13 @@ func removeRoots(roots []string) {
}
}
// removeRandomDisk - removes a count of random disks from a disk slice.
func removeRandomDisk(disks []string, removeCount int) {
ints := randInts(len(disks))
for _, i := range ints[:removeCount] {
removeAll(disks[i-1])
//removeDiskN - removes N disks from supplied disk slice.
func removeDiskN(disks []string, n int) {
if n > len(disks) {
n = len(disks)
}
for _, disk := range disks[:n] {
removeAll(disk)
}
}