Browse Source

add tests

pull/2241/head
Chris Lu 3 years ago
parent
commit
1a5d29520c
  1. 13
      weed/shell/command_volume_balance_test.go

13
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))
}
Loading…
Cancel
Save