allow support for parity '0', '1' enabling support for 2,3 drive setups (#15171)

allows for further granular setups

- 2 drives (1 parity, 1 data)
- 3 drives (1 parity, 2 data)

Bonus: allows '0' parity as well.
This commit is contained in:
Harshavardhana
2022-06-27 20:22:18 -07:00
committed by GitHub
parent b7c7e59dac
commit 9c605ad153
17 changed files with 82 additions and 76 deletions

View File

@@ -201,18 +201,6 @@ func TestGetSetIndexes(t *testing.T) {
success bool
}{
// Invalid inputs.
{
[]string{"data{1...3}"},
[]uint64{3},
nil,
false,
},
{
[]string{"data/controller1/export{1...2}, data/controller2/export{1...4}, data/controller3/export{1...8}"},
[]uint64{2, 4, 8},
nil,
false,
},
{
[]string{"data{1...17}/export{1...52}"},
[]uint64{14144},
@@ -220,6 +208,18 @@ func TestGetSetIndexes(t *testing.T) {
false,
},
// Valid inputs.
{
[]string{"data{1...3}"},
[]uint64{3},
[][]uint64{{3}},
true,
},
{
[]string{"data/controller1/export{1...2}, data/controller2/export{1...4}, data/controller3/export{1...8}"},
[]uint64{2, 4, 8},
[][]uint64{{2}, {2, 2}, {2, 2, 2, 2}},
true,
},
{
[]string{"data{1...27}"},
[]uint64{27},