mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
glusterfs: unit-test the gidMin:gidMax parsing from the storage class
Signed-off-by: Michael Adam <obnox@redhat.com>
This commit is contained in:
parent
c84cba0440
commit
bead60db0d
@ -350,6 +350,130 @@ func TestParseClassParameters(t *testing.T) {
|
|||||||
true, // expect error
|
true, // expect error
|
||||||
nil,
|
nil,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"invalid gidMin #1",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMin": "0",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
true, // expect error
|
||||||
|
nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"invalid gidMin #2",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMin": "1999",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
true, // expect error
|
||||||
|
nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"invalid gidMin #3",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMin": "1999",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
true, // expect error
|
||||||
|
nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"invalid gidMax #1",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMax": "0",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
true, // expect error
|
||||||
|
nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"invalid gidMax #2",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMax": "1999",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
true, // expect error
|
||||||
|
nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"invalid gidMax #3",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMax": "1999",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
true, // expect error
|
||||||
|
nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"invalid gidMin:gidMax",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMin": "5001",
|
||||||
|
"gidMax": "5000",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
true, // expect error
|
||||||
|
nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"valid gidMin",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMin": "4000",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
false, // expect error
|
||||||
|
&provisioningConfig{
|
||||||
|
url: "https://localhost:8080",
|
||||||
|
gidMin: 4000,
|
||||||
|
gidMax: 2147483647,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"valid gidMax",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMax": "5000",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
false, // expect error
|
||||||
|
&provisioningConfig{
|
||||||
|
url: "https://localhost:8080",
|
||||||
|
gidMin: 2000,
|
||||||
|
gidMax: 5000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"valid gidMin:gidMax",
|
||||||
|
map[string]string{
|
||||||
|
"resturl": "https://localhost:8080",
|
||||||
|
"restauthenabled": "false",
|
||||||
|
"gidMin": "4000",
|
||||||
|
"gidMax": "5000",
|
||||||
|
},
|
||||||
|
&secret,
|
||||||
|
false, // expect error
|
||||||
|
&provisioningConfig{
|
||||||
|
url: "https://localhost:8080",
|
||||||
|
gidMin: 4000,
|
||||||
|
gidMax: 5000,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
Loading…
Reference in New Issue
Block a user