You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
646 B

  1. package storage
  2. import (
  3. "io/ioutil"
  4. "testing"
  5. "github.com/chrislusf/seaweedfs/weed/glog"
  6. )
  7. func TestLoadingEcShards(t *testing.T) {
  8. dl := NewDiskLocation("./erasure_coding", 100)
  9. err := dl.loadAllEcShards()
  10. if err != nil {
  11. t.Errorf("load all ec shards: %v", err)
  12. }
  13. if len(dl.ecVolumes) != 1 {
  14. t.Errorf("loading err")
  15. }
  16. fileInfos, err := ioutil.ReadDir(dl.Directory)
  17. if err != nil {
  18. t.Errorf("listing all ec shards in dir %s: %v", dl.Directory, err)
  19. }
  20. glog.V(0).Infof("FileCount %d", len(fileInfos))
  21. for i, fileInfo := range fileInfos {
  22. glog.V(0).Infof("file:%d %s size:%d", i, fileInfo.Name(), fileInfo.Size())
  23. }
  24. }