mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #93723 from ynqa/add-testcases-kubelet-getters
add testcases for kubelet getters
This commit is contained in:
commit
69d5d620a4
@ -39,6 +39,10 @@ func TestKubeletDirs(t *testing.T) {
|
||||
exp = filepath.Join(root, "plugins")
|
||||
assert.Equal(t, exp, got)
|
||||
|
||||
got = kubelet.getPluginsRegistrationDir()
|
||||
exp = filepath.Join(root, "plugins_registry")
|
||||
assert.Equal(t, exp, got)
|
||||
|
||||
got = kubelet.getPluginDir("foobar")
|
||||
exp = filepath.Join(root, "plugins/foobar")
|
||||
assert.Equal(t, exp, got)
|
||||
@ -55,6 +59,14 @@ func TestKubeletDirs(t *testing.T) {
|
||||
exp = filepath.Join(root, "pods/abc123/volumes/plugin/foobar")
|
||||
assert.Equal(t, exp, got)
|
||||
|
||||
got = kubelet.getPodVolumeDevicesDir("abc123")
|
||||
exp = filepath.Join(root, "pods/abc123/volumeDevices")
|
||||
assert.Equal(t, exp, got)
|
||||
|
||||
got = kubelet.getPodVolumeDeviceDir("abc123", "plugin")
|
||||
exp = filepath.Join(root, "pods/abc123/volumeDevices/plugin")
|
||||
assert.Equal(t, exp, got)
|
||||
|
||||
got = kubelet.getPodPluginsDir("abc123")
|
||||
exp = filepath.Join(root, "pods/abc123/plugins")
|
||||
assert.Equal(t, exp, got)
|
||||
@ -63,7 +75,19 @@ func TestKubeletDirs(t *testing.T) {
|
||||
exp = filepath.Join(root, "pods/abc123/plugins/foobar")
|
||||
assert.Equal(t, exp, got)
|
||||
|
||||
got = kubelet.getVolumeDevicePluginsDir()
|
||||
exp = filepath.Join(root, "plugins")
|
||||
assert.Equal(t, exp, got)
|
||||
|
||||
got = kubelet.getVolumeDevicePluginDir("foobar")
|
||||
exp = filepath.Join(root, "plugins", "foobar", "volumeDevices")
|
||||
assert.Equal(t, exp, got)
|
||||
|
||||
got = kubelet.getPodContainerDir("abc123", "def456")
|
||||
exp = filepath.Join(root, "pods/abc123/containers/def456")
|
||||
assert.Equal(t, exp, got)
|
||||
|
||||
got = kubelet.getPodResourcesDir()
|
||||
exp = filepath.Join(root, "pod-resources")
|
||||
assert.Equal(t, exp, got)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user