Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove mvPodUidDir test #45325

Merged
merged 1 commit into from
May 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 0 additions & 35 deletions test/e2e/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,6 @@ func createPodUsingNfs(f *framework.Framework, c clientset.Interface, ns, nfsIP,
return rtnPod
}

// move the passed-in pod's UID directory to /tmp.
func movePodUidDir(c clientset.Interface, pod *v1.Pod) {
dest := "/tmp"
podDir := filepath.Join("/var/lib/kubelet/pods", string(pod.UID))
cmd := fmt.Sprintf("sudo mv %v %v", podDir, dest)
// use ip rather than hostname in GCE
nodeIP, err := framework.GetHostExternalAddress(c, pod)
Expect(err).NotTo(HaveOccurred())

// excute cmd over ssh
result, _ := nodeExec(nodeIP, cmd)
framework.LogSSHResult(result)
Expect(result.Code).To(BeZero())
Expect(len(result.Stderr)).To(BeZero())
}

// Checks for a lingering nfs mount and/or uid directory on the pod's host. The host IP is used
// so that this test runs in GCE, where it appears that SSH cannot resolve the hostname.
// If expectClean is true then we expect the node to be cleaned up and thus commands like
Expand Down Expand Up @@ -483,25 +467,6 @@ var _ = framework.KubeDescribe("kubelet", func() {
checkPodCleanup(c, pod, true)
})
}

// Move a pod's uid dir to /tmp and delete the pod.
// Addresses issue #37657.
// Note: the pod's vol mount (as a side effect) ends up being moved to /tmp
// and can be unmounted via `umount -f`.
It("move NFS client pod's UID directory then delete pod", func() {
pod = createPodUsingNfs(f, c, ns, nfsIP, "sleep 6000")

By("Move pod's uid dir to /tmp")
movePodUidDir(c, pod)

By("Delete the pod mounted to the NFS volume")
framework.DeletePodWithWait(f, c, pod)
// pod object is now stale, but is intentionally not nil
// Note: the pod's nfs mount, now in /tmp, will not be unmounted

By("Verify host running the deleted pod is cleaned up")
checkPodCleanup(c, pod, true)
})
})
})
})