func TestGetAccessModes(t *testing.T) { plugMgr := volume.VolumePluginMgr{} plugMgr.InitPlugins(ProbeVolumePlugins(volume.VolumeConfig{}), volume.NewFakeVolumeHost("/tmp/fake", nil, nil)) plug, err := plugMgr.FindPersistentPluginByName("kubernetes.io/host-path") if err != nil { t.Errorf("Can't find the plugin by name") } if len(plug.GetAccessModes()) != 1 || plug.GetAccessModes()[0] != api.ReadWriteOnce { t.Errorf("Expected %s PersistentVolumeAccessMode", api.ReadWriteOnce) } }
func TestGetAccessModes(t *testing.T) { plugMgr := volume.VolumePluginMgr{} plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost("/tmp/fake", nil, nil)) plug, err := plugMgr.FindPersistentPluginByName("kubernetes.io/fc") if err != nil { t.Errorf("Can't find the plugin by name") } if !contains(plug.GetAccessModes(), api.ReadWriteOnce) || !contains(plug.GetAccessModes(), api.ReadOnlyMany) { t.Errorf("Expected two AccessModeTypes: %s and %s", api.ReadWriteOnce, api.ReadOnlyMany) } }
func TestGetAccessModes(t *testing.T) { plugMgr := volume.VolumePluginMgr{} plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost("/tmp/fake", nil, nil)) plug, err := plugMgr.FindPersistentPluginByName("kubernetes.io/aws-ebs") if err != nil { t.Errorf("Can't find the plugin by name") } if !contains(plug.GetAccessModes(), api.ReadWriteOnce) { t.Errorf("Expected to find AccessMode: %s", api.ReadWriteOnce) } if len(plug.GetAccessModes()) != 1 { t.Errorf("Expected to find exactly one AccessMode") } }