-
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
e2e: add a test case for rbd-nbd mounter #1839
Conversation
You may want to have a look at #1840 for an idea how to test it in the CI before the minikube PR is merged+released. |
@nixpanic I hope the CI picks the modifications to minikube iso URL as part of this PR testing, is that right? |
The CI uses |
Oh, note that #1831 contains a modification to the |
The PR#1831 seems to be in open state now, when it gets merged I shall rebase this, hope that looks like a good plan. Thanks! |
Thanks @Madhu-1, now I understand why @nixpanic was warning in the comments above. |
With #1811 the |
3938ced
to
c18459a
Compare
6e8a43b
to
728e5df
Compare
e2e/pod.go
Outdated
cmd := []string{"/bin/sh", "-c", c} | ||
podList, err := f.PodClientNS(ns).List(context.TODO(), *opt) | ||
framework.ExpectNoError(err) | ||
if len(podList.Items) == 0 { | ||
return framework.ExecOptions{}, errors.New("podlist is empty") | ||
} | ||
found := false |
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.
find Container Name in the pod can be wrapped into a new function .
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.
Done now!
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.
Thanks @pkalever 👍
e2e/pod.go
Outdated
} | ||
|
||
func execCommandInContainer(f *framework.Framework, c, ns string, cn string, opt *metav1.ListOptions) (string, string, error) { | ||
podPot, err := getCommandInPodOpts(f, c, ns, cn, opt) |
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.
eventhough its not introduced here, Is above (podPot
) a weird name ? may be we have to rename it as podOpt
?
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.
addressed this one too. Thanks!
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.
Cool. thanks !
81706a7
to
9299867
Compare
77bf75d
to
1009c06
Compare
e2e/pod.go
Outdated
@@ -305,7 +305,7 @@ func deletePod(name, ns string, c kubernetes.Interface, t int) error { | |||
}) | |||
} | |||
|
|||
func deletePodWithLabel(label, ns string, skipNotFound bool) error { | |||
func deletePodWithLabel(label, ns string, skipNotFound bool) error { //nolint:unparam |
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.
@nixpanic this should fix the golint warnings!
1972041
to
0175b5c
Compare
@pkalever one quick check: Have we tested this scenario when the actual node reboot or move to |
When a node is rebooted, the application pod might be migrated to a new node or might be scheduled on the same node, in any case, a new NodeStageVolume call is expected to take care of mapping the device. These tests are mainly focusing on the restart of the node plugin, where there is no NodeStageVolume call for now. We are working on implementing the missing gaps in parallel, where a new init container or a sidecar is supposed to get the list of volume attachments on a node (upon the restart of the node plugin) and make new NodeStageVolume grpc Calls per device for reattaching (remapping) rbd-nbd processes/devices. Thanks! |
There are some ( corner ) cases, like network error, kubelet goes wrong, node completely goes out..etc which are bit different from volume pov. We have also seen issues popping up with some race conditions from CO to detect and issues RPC calls in between..etc. The reason for asking node |
Thanks Humble, Got you. These test cases are less focused on the corner case. But I will make sure to test these corner cases with the logic we are implementing to address node plugin restart 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.
It is good to have this tested regularly, so let's get it in.
In case a manual rebase is needed, please correct the formatting of the // nolint:
comments.
@@ -204,7 +204,7 @@ func execCommandInPod(f *framework.Framework, c, ns string, opt *metav1.ListOpti | |||
return stdOut, stdErr, err | |||
} | |||
|
|||
func execCommandInContainer(f *framework.Framework, c, ns, cn string, opt *metav1.ListOptions) (string, string, error) { | |||
func execCommandInContainer(f *framework.Framework, c, ns, cn string, opt *metav1.ListOptions) (string, string, error) { //nolint:unparam,lll // cn can be used with different inputs later |
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.
We usually put these comments above the line that is affected, not after the line (this line becomes really long now).
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.
I thought putting it above the line will affect the whole function block not just that line in this case?
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.
Probably, but that is not really an issue.
In general, all nolint
issues need to be addressed at one point. That means, either the argument is not needed and can be dropped, or the function gets used with other arguments somewhere.
The recommendation was not to have space in between the slash and |
@Mergifyio rebase |
Command
|
To validate the basic working of rbd-nbd Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This is a negative testcase to showcase as per current design the IO will fail because of the missing mappings Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Bringup the rbd-nbd map/attach process on the rbd node plugin and expect the IO to continue uninterrupted. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This testcase tests journaling/exclusive-lock image-features with rbd-nbd mounter Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Ignoring below warnings: e2e/pod.go:207:60: `execCommandInContainer` - `cn` always receives `"csi-rbdplugin"` (unparam) func execCommandInContainer(f *framework.Framework, c, ns, cn string, opt *metav1.ListOptions) (string, string, error) { ^ e2e/pod.go:308:43: `deletePodWithLabel` - `skipNotFound` always receives `false` (unparam) func deletePodWithLabel(label, ns string, skipNotFound bool) error { Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Describe what this PR does
Validate the basic working of rbd-nbd
Test cases:
Dependencies
ceph/ceph:pacific
which is not yet releasednbd.ko
in minikube, see iso: enable Network Block Device support kubernetes/minikube#10217Updates: #667