e2e SecurityContext tests wrong volume dir

The volume directory is not guaranteed to be /var/lib/kubelet
for a conforming implementation of Kubernetes.  Add --volume-dir
and an internal shim
This commit is contained in:
Clayton Coleman
2016-02-07 15:20:32 -05:00
parent c26087db45
commit e8cbb762e2
4 changed files with 5 additions and 2 deletions

View File

@@ -154,8 +154,8 @@ func testPodSELinuxLabeling(framework *Framework, hostIPC bool, hostPID bool) {
// Confirm that the file can be accessed from a second
// pod using host_path with the same MCS label
volumeHostPath := fmt.Sprintf("/var/lib/kubelet/pods/%s/volumes/kubernetes.io~empty-dir/%s", foundPod.UID, volumeName)
By("confirming a container with the same label can read the file")
volumeHostPath := fmt.Sprintf("%s/pods/%s/volumes/kubernetes.io~empty-dir/%s", testContext.KubeVolumeDir, foundPod.UID, volumeName)
By(fmt.Sprintf("confirming a container with the same label can read the file under --volume-dir=%s", testContext.KubeVolumeDir))
pod = scTestPod(hostIPC, hostPID)
pod.Spec.NodeName = foundPod.Spec.NodeName
volumeMounts := []api.VolumeMount{