Add test case for getPodVolumeSubpathsDir

This commit is contained in:
zhangxiaoyang 2022-04-27 16:33:28 +08:00
parent 537941765f
commit 0b1fb2b394

View File

@ -90,4 +90,12 @@ func TestKubeletDirs(t *testing.T) {
got = kubelet.getPodResourcesDir()
exp = filepath.Join(root, "pod-resources")
assert.Equal(t, exp, got)
got = kubelet.GetHostname()
exp = "127.0.0.1"
assert.Equal(t, exp, got)
got = kubelet.getPodVolumeSubpathsDir("abc123")
exp = filepath.Join(root, "pods/abc123/volume-subpaths")
assert.Equal(t, exp, got)
}