diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-11-02 23:36:43 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-11-02 23:36:43 -0700 |
| commit | 18bfbf62fcc64be380293ce797ab23f785c01760 (patch) | |
| tree | e26b4264e4582187b4e724a61e4651c4579c99e9 /weed/shell/command_volume_fix_replication_test.go | |
| parent | e1ab8b01d06b8f1d2606651a8035a0565c9cfd30 (diff) | |
| download | seaweedfs-18bfbf62fcc64be380293ce797ab23f785c01760.tar.xz seaweedfs-18bfbf62fcc64be380293ce797ab23f785c01760.zip | |
add one unit test
Diffstat (limited to 'weed/shell/command_volume_fix_replication_test.go')
| -rw-r--r-- | weed/shell/command_volume_fix_replication_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/weed/shell/command_volume_fix_replication_test.go b/weed/shell/command_volume_fix_replication_test.go index bb61be1ef..4d9cd8188 100644 --- a/weed/shell/command_volume_fix_replication_test.go +++ b/weed/shell/command_volume_fix_replication_test.go @@ -261,6 +261,29 @@ func TestSatisfyReplicaPlacement00x(t *testing.T) { } +func TestSatisfyReplicaPlacement100(t *testing.T) { + + var tests = []testcase{ + { + name: "test 100", + replication: "100", + replicas: []*VolumeReplica{ + { + location: &location{"dc1", "r1", &master_pb.DataNodeInfo{Id: "dn1"}}, + }, + { + location: &location{"dc1", "r2", &master_pb.DataNodeInfo{Id: "dn2"}}, + }, + }, + possibleLocation: location{"dc2", "r3", &master_pb.DataNodeInfo{Id: "dn3"}}, + expected: true, + }, + } + + runTests(tests, t) + +} + func runTests(tests []testcase, t *testing.T) { for _, tt := range tests { replicaPlacement, _ := super_block.NewReplicaPlacementFromString(tt.replication) |
