mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 00:58:51 +08:00
add tests
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package shell
|
package shell
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/storage/types"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
|
"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))
|
||||||
|
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user