Use Fatalf instead of Errorf when mounter/unmounter if nil in volume tests

This commit is contained in:
xiangpengzhao
2016-12-19 02:42:14 -05:00
parent 2b08d1e5a1
commit 35b45d60b2
12 changed files with 38 additions and 11 deletions

View File

@@ -362,6 +362,9 @@ func TestPersistentClaimReadOnlyFlag(t *testing.T) {
spec := volume.NewSpecFromPersistentVolume(pv, true)
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
mounter, _ := plug.NewMounter(spec, pod, volume.VolumeOptions{})
if mounter == nil {
t.Fatalf("Got a nil Mounter")
}
if !mounter.GetAttributes().ReadOnly {
t.Errorf("Expected true for mounter.IsReadOnly")