-
Notifications
You must be signed in to change notification settings - Fork 554
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
Add e2e test for mounting different paths on same volume on same node #173
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wongma7 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
841b93d
to
416d786
Compare
718905b
to
21de65d
Compare
/test pull-aws-efs-csi-driver-e2e https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_aws-efs-csi-driver/173/pull-aws-efs-csi-driver-e2e/1268220967159599105 looks like an instance of #141. Saw similar 'mount.nfs4...blocked for more than 120 seconds.' messages in dmesg with no mounts of fs-286c882d on node ip-172-20-119-122.us-west-2.compute.internal ever succeeding |
/assign @leakingtapan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Some minor questions.
defer func() { _ = f.ClientSet.CoreV1().PersistentVolumes().Delete(pvRoot.Name, &metav1.DeleteOptions{}) }() | ||
|
||
ginkgo.By(fmt.Sprintf("Creating pod to make subpaths /a and /b")) | ||
pod := e2epod.MakePod(f.Namespace.Name, nil, []*v1.PersistentVolumeClaim{pvcRoot}, false, "mkdir /mnt/volume1/a && mkdir /mnt/volume1/b") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where "/mnt/volume1" is defined:
volumeMounts[index] = v1.VolumeMount{Name: volumename, MountPath: "/mnt/" + volumename}
framework.ExpectNoError(e2epod.WaitForPodSuccessInNamespace(f.ClientSet, pod.Name, f.Namespace.Name), "waiting for pod success") | ||
|
||
ginkgo.By(fmt.Sprintf("Creating efs pvc & pv with subpath /a")) | ||
pvcA, pvA, err := createEFSPVCPV(f.ClientSet, f.Namespace.Name, f.Namespace.Name+"-a", "/a") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wish Golang support keywords argument like Python does. It's not easy to tell what those parameters really represent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree lol. a pattern I have seen is to add /* */ after every arg but thats gets tiring and verbose fast. IDE can help here.
defer func() { _ = f.ClientSet.CoreV1().PersistentVolumes().Delete(pvRoot.Name, &metav1.DeleteOptions{}) }() | ||
|
||
ginkgo.By(fmt.Sprintf("Creating pod to make subpaths /a and /b")) | ||
pod := e2epod.MakePod(f.Namespace.Name, nil, []*v1.PersistentVolumeClaim{pvcRoot}, false, "mkdir /mnt/volume1/a && mkdir /mnt/volume1/b") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface of MakePod
func MakePod(ns string, nodeSelector map[string]string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string) *v1.Pod {
pod = e2epod.MakePod(f.Namespace.Name, nil, []*v1.PersistentVolumeClaim{pvcA, pvcB}, false, "") | ||
pod, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(pod) | ||
framework.ExpectNoError(err, "creating pod") | ||
framework.ExpectNoError(e2epod.WaitForPodNameRunningInNamespace(f.ClientSet, pod.Name, f.Namespace.Name), "waiting for pod running") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is an additional check on whether the mount is accessible necessary, i.e. kubectl exec ... ls /mnt/volume1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, the pod from the initial step "ginkgo.By(fmt.Sprintf("Creating pod to make subpaths /a and /b"))" would have failed if somehow mnt is not accessible
ginkgo.By(fmt.Sprintf("Creating efs pvc & pv with no subpath")) | ||
pvcRoot, pvRoot, err := createEFSPVCPV(f.ClientSet, f.Namespace.Name, f.Namespace.Name+"-root", "/") | ||
framework.ExpectNoError(err, "creating efs pvc & pv with no subpath") | ||
defer func() { _ = f.ClientSet.CoreV1().PersistentVolumes().Delete(pvRoot.Name, &metav1.DeleteOptions{}) }() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are PVC and Pods getting cleaned up automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, since namespaces gets cleaned up automatically
@jqmichael: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
/test pull-aws-efs-csi-driver-verify |
Is this a bug fix or adding new feature? fix #105
What is this PR about? / Why do we need it? #100 was fixed but we need an e2e test for it.
What testing is done?
Testing on my EKS cluster:
Testing on CI's kops cluster (https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_aws-efs-csi-driver/173/pull-aws-efs-csi-driver-e2e/1268250579340103680):