mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Add unit test for staging path creation
This commit is contained in:
parent
8d5c65b8cd
commit
55ffd9d5fc
@ -1236,6 +1236,18 @@ func TestAttacherMountDevice(t *testing.T) {
|
||||
t.Errorf("expected mount options: %v, got: %v", tc.spec.PersistentVolume.Spec.MountOptions, vol.MountFlags)
|
||||
}
|
||||
}
|
||||
|
||||
// Verify the deviceMountPath was created by the plugin
|
||||
if tc.stageUnstageSet {
|
||||
s, err := os.Stat(tc.deviceMountPath)
|
||||
if err != nil {
|
||||
t.Errorf("expected staging directory %s to be created and be a directory, got error: %s", tc.deviceMountPath, err)
|
||||
} else {
|
||||
if !s.IsDir() {
|
||||
t.Errorf("expected staging directory %s to be directory, got something else", tc.deviceMountPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user