aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/disk_location_ec_test.go
blob: c231ac0a99411758c917150f3d69200937400290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package storage

import (
	"io/ioutil"
	"testing"

	"github.com/chrislusf/seaweedfs/weed/glog"
)

func TestLoadingEcShards(t *testing.T) {
	dl := NewDiskLocation("./erasure_coding", 100)
	err := dl.loadAllEcShards()
	if err != nil {
		t.Errorf("load all ec shards: %v", err)
	}

	if len(dl.ecVolumes) != 1 {
		t.Errorf("loading err")
	}

	fileInfos, err := ioutil.ReadDir(dl.Directory)
	if err != nil {
		t.Errorf("listing all ec shards in dir %s: %v", dl.Directory, err)
	}

	glog.V(0).Infof("FileCount %d", len(fileInfos))
	for i, fileInfo := range fileInfos {
		glog.V(0).Infof("file:%d %s size:%d", i, fileInfo.Name(), fileInfo.Size())
	}

}