Export contains access mode helper method
Will be used during validation of PVs and PVCs
This commit is contained in:
@@ -87,23 +87,23 @@ func TestIsStandardContainerResource(t *testing.T) {
|
||||
|
||||
func TestGetAccessModesFromString(t *testing.T) {
|
||||
modes := GetAccessModesFromString("ROX")
|
||||
if !containsAccessMode(modes, core.ReadOnlyMany) {
|
||||
if !ContainsAccessMode(modes, core.ReadOnlyMany) {
|
||||
t.Errorf("Expected mode %s, but got %+v", core.ReadOnlyMany, modes)
|
||||
}
|
||||
|
||||
modes = GetAccessModesFromString("ROX,RWX")
|
||||
if !containsAccessMode(modes, core.ReadOnlyMany) {
|
||||
if !ContainsAccessMode(modes, core.ReadOnlyMany) {
|
||||
t.Errorf("Expected mode %s, but got %+v", core.ReadOnlyMany, modes)
|
||||
}
|
||||
if !containsAccessMode(modes, core.ReadWriteMany) {
|
||||
if !ContainsAccessMode(modes, core.ReadWriteMany) {
|
||||
t.Errorf("Expected mode %s, but got %+v", core.ReadWriteMany, modes)
|
||||
}
|
||||
|
||||
modes = GetAccessModesFromString("RWO,ROX,RWX")
|
||||
if !containsAccessMode(modes, core.ReadOnlyMany) {
|
||||
if !ContainsAccessMode(modes, core.ReadOnlyMany) {
|
||||
t.Errorf("Expected mode %s, but got %+v", core.ReadOnlyMany, modes)
|
||||
}
|
||||
if !containsAccessMode(modes, core.ReadWriteMany) {
|
||||
if !ContainsAccessMode(modes, core.ReadWriteMany) {
|
||||
t.Errorf("Expected mode %s, but got %+v", core.ReadWriteMany, modes)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user