Skip to content
This repository was archived by the owner on Mar 26, 2020. It is now read-only.

Commit 2e16cd9

Browse files
authored
Merge branch 'master' into rebalance
2 parents 6f60a76 + 2039f6f commit 2e16cd9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3082
-654
lines changed

doc/endpoints.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/bitrot_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ func TestBitrot(t *testing.T) {
1414

1515
r := require.New(t)
1616

17-
gds, err = setupCluster("./config/1.toml", "./config/2.toml")
17+
tc, err := setupCluster("./config/1.toml", "./config/2.toml")
1818
r.Nil(err)
19-
defer teardownCluster(gds)
19+
defer teardownCluster(tc)
2020

21-
client = initRestclient(gds[0])
21+
client = initRestclient(tc.gds[0])
2222

2323
// test Bitrot on dist-rep volume
24-
t.Run("Replica-volume", testBitrotOnReplicaVolume)
24+
t.Run("Replica-volume", tc.wrap(testBitrotOnReplicaVolume))
2525
// test Bitrot on pure distribute volume
26-
t.Run("Dist-volume", testBitrotOnDistVolume)
26+
t.Run("Dist-volume", tc.wrap(testBitrotOnDistVolume))
2727

2828
}
2929

30-
func testBitrotOnReplicaVolume(t *testing.T) {
30+
func testBitrotOnReplicaVolume(t *testing.T, tc *testCluster) {
3131
r := require.New(t)
3232
volumeName := formatVolName(t.Name())
3333
var brickPaths []string
@@ -45,16 +45,16 @@ func testBitrotOnReplicaVolume(t *testing.T) {
4545
ReplicaCount: 2,
4646
Type: "replicate",
4747
Bricks: []api.BrickReq{
48-
{PeerID: gds[0].PeerID(), Path: brickPaths[0]},
49-
{PeerID: gds[1].PeerID(), Path: brickPaths[1]},
48+
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[0]},
49+
{PeerID: tc.gds[1].PeerID(), Path: brickPaths[1]},
5050
},
5151
},
5252
{
5353
Type: "replicate",
5454
ReplicaCount: 2,
5555
Bricks: []api.BrickReq{
56-
{PeerID: gds[0].PeerID(), Path: brickPaths[2]},
57-
{PeerID: gds[1].PeerID(), Path: brickPaths[3]},
56+
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[2]},
57+
{PeerID: tc.gds[1].PeerID(), Path: brickPaths[3]},
5858
},
5959
},
6060
},
@@ -69,7 +69,7 @@ func testBitrotOnReplicaVolume(t *testing.T) {
6969
r.Nil(client.VolumeDelete(volumeName))
7070
}
7171

72-
func testBitrotOnDistVolume(t *testing.T) {
72+
func testBitrotOnDistVolume(t *testing.T, tc *testCluster) {
7373
r := require.New(t)
7474
volumeName := formatVolName(t.Name())
7575
var brickPaths []string
@@ -85,15 +85,15 @@ func testBitrotOnDistVolume(t *testing.T) {
8585
{
8686
Type: "distribute",
8787
Bricks: []api.BrickReq{
88-
{PeerID: gds[0].PeerID(), Path: brickPaths[0]},
89-
{PeerID: gds[1].PeerID(), Path: brickPaths[1]},
88+
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[0]},
89+
{PeerID: tc.gds[1].PeerID(), Path: brickPaths[1]},
9090
},
9191
},
9292
{
9393
Type: "distribute",
9494
Bricks: []api.BrickReq{
95-
{PeerID: gds[0].PeerID(), Path: brickPaths[2]},
96-
{PeerID: gds[1].PeerID(), Path: brickPaths[3]},
95+
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[2]},
96+
{PeerID: tc.gds[1].PeerID(), Path: brickPaths[3]},
9797
},
9898
},
9999
},

e2e/georep_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
func TestGeorepCreateDelete(t *testing.T) {
1414
r := require.New(t)
1515

16-
gds, err := setupCluster("./config/1.toml", "./config/2.toml")
16+
tc, err := setupCluster("./config/1.toml", "./config/2.toml")
1717
r.Nil(err)
18-
defer teardownCluster(gds)
18+
defer teardownCluster(tc)
1919

2020
brickDir, err := ioutil.TempDir(baseLocalStateDir, t.Name())
2121
r.Nil(err)
@@ -28,7 +28,7 @@ func TestGeorepCreateDelete(t *testing.T) {
2828
brickPaths = append(brickPaths, brickPath)
2929
}
3030

31-
client := initRestclient(gds[0])
31+
client := initRestclient(tc.gds[0])
3232

3333
volname := formatVolName(t.Name())
3434
reqVol := api.VolCreateReq{
@@ -37,8 +37,8 @@ func TestGeorepCreateDelete(t *testing.T) {
3737
{
3838
Type: "distribute",
3939
Bricks: []api.BrickReq{
40-
{PeerID: gds[0].PeerID(), Path: brickPaths[0]},
41-
{PeerID: gds[0].PeerID(), Path: brickPaths[1]},
40+
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[0]},
41+
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[1]},
4242
},
4343
},
4444
},
@@ -54,8 +54,8 @@ func TestGeorepCreateDelete(t *testing.T) {
5454
{
5555
Type: "distribute",
5656
Bricks: []api.BrickReq{
57-
{PeerID: gds[1].PeerID(), Path: brickPaths[2]},
58-
{PeerID: gds[1].PeerID(), Path: brickPaths[3]},
57+
{PeerID: tc.gds[1].PeerID(), Path: brickPaths[2]},
58+
{PeerID: tc.gds[1].PeerID(), Path: brickPaths[3]},
5959
},
6060
},
6161
},
@@ -68,7 +68,7 @@ func TestGeorepCreateDelete(t *testing.T) {
6868
MasterVol: volname,
6969
RemoteVol: volname2,
7070
RemoteHosts: []georepapi.GeorepRemoteHostReq{
71-
{PeerID: gds[1].PeerID(), Hostname: gds[1].PeerAddress},
71+
{PeerID: tc.gds[1].PeerID(), Hostname: tc.gds[1].PeerAddress},
7272
},
7373
}
7474

e2e/glustershd_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
func TestSelfHeal(t *testing.T) {
1313
r := require.New(t)
1414

15-
gds, err := setupCluster("./config/1.toml")
15+
tc, err := setupCluster("./config/1.toml")
1616
r.Nil(err)
17-
defer teardownCluster(gds)
17+
defer teardownCluster(tc)
1818

1919
brickDir, err := ioutil.TempDir(baseLocalStateDir, t.Name())
2020
r.Nil(err)
@@ -27,7 +27,7 @@ func TestSelfHeal(t *testing.T) {
2727
brickPaths[i-1] = brickPath
2828
}
2929

30-
client := initRestclient(gds[0])
30+
client := initRestclient(tc.gds[0])
3131
volname := formatVolName(t.Name())
3232
reqVol := api.VolCreateReq{
3333
Name: volname,
@@ -36,8 +36,8 @@ func TestSelfHeal(t *testing.T) {
3636
ReplicaCount: 2,
3737
Type: "replicate",
3838
Bricks: []api.BrickReq{
39-
{PeerID: gds[0].PeerID(), Path: brickPaths[0]},
40-
{PeerID: gds[0].PeerID(), Path: brickPaths[1]},
39+
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[0]},
40+
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[1]},
4141
},
4242
},
4343
},

0 commit comments

Comments
 (0)