aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-05 14:49:24 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-05 14:49:24 -0700
commit1a5d29520c3f587558dbd68262a0f6aef8e06946 (patch)
treea6db86073e35a740da7c09132127aed283fd48c6
parent6b743dbbf96f863e70ee80e4b32c0928f594891a (diff)
downloadseaweedfs-1a5d29520c3f587558dbd68262a0f6aef8e06946.tar.xz
seaweedfs-1a5d29520c3f587558dbd68262a0f6aef8e06946.zip
add tests
-rw-r--r--weed/shell/command_volume_balance_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/weed/shell/command_volume_balance_test.go b/weed/shell/command_volume_balance_test.go
index b77811f51..d6624bbcc 100644
--- a/weed/shell/command_volume_balance_test.go
+++ b/weed/shell/command_volume_balance_test.go
@@ -1,6 +1,8 @@
package shell
import (
+ "github.com/chrislusf/seaweedfs/weed/storage/types"
+ "github.com/stretchr/testify/assert"
"testing"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
@@ -181,3 +183,14 @@ func TestBalance(t *testing.T) {
}
}
+
+func TestVolumeSelection(t *testing.T) {
+ topologyInfo := parseOutput(topoData)
+
+ vids, err := collectVolumeIdsForTierChange(nil, topologyInfo, 1000, types.ToDiskType("hdd"), "", 20.0, 0);
+ if err != nil {
+ t.Errorf("collectVolumeIdsForTierChange: %v", err)
+ }
+ assert.Equal(t, 378, len(vids))
+
+}