aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_balance_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/shell/command_volume_balance_test.go')
-rw-r--r--weed/shell/command_volume_balance_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/weed/shell/command_volume_balance_test.go b/weed/shell/command_volume_balance_test.go
index 7919d60c0..4f46648c0 100644
--- a/weed/shell/command_volume_balance_test.go
+++ b/weed/shell/command_volume_balance_test.go
@@ -19,6 +19,24 @@ type testMoveCase struct {
func TestIsGoodMove(t *testing.T) {
var tests = []testMoveCase{
+
+
+ {
+ name: "test 100 move to spread into proper data centers",
+ replication: "100",
+ replicas: []*VolumeReplica{
+ {
+ location: &location{"dc1", "r1", &master_pb.DataNodeInfo{Id: "dn1"}},
+ },
+ {
+ location: &location{"dc1", "r2", &master_pb.DataNodeInfo{Id: "dn2"}},
+ },
+ },
+ sourceLocation: location{"dc1", "r2", &master_pb.DataNodeInfo{Id: "dn2"}},
+ targetLocation: location{"dc2", "r2", &master_pb.DataNodeInfo{Id: "dn3"}},
+ expected: true,
+ },
+
{
name: "test move to the same node",
replication: "001",