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

Fix volumes e2e test to check fsType #70823

Merged
merged 6 commits into from Jan 29, 2019

Conversation

mkimuram
Copy link
Contributor

@mkimuram mkimuram commented Nov 8, 2018

What type of PR is this?
/kind bug

What this PR does / why we need it:
Volumes test doesn't check fsType, as a result, e2e test which requires particular fsType could pass even when driver doesn't provide the right fsType. Also, current gcePDCSIDriver.GetDynamicProvisionStorageClass in e2e test code is broken, so this PR will also fix it.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #70822

Special notes for your reviewer:
/sig storage

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 8, 2018
@k8s-ci-robot
Copy link
Contributor

Hi @mkimuram. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the sig/testing Categorizes an issue or PR as relevant to SIG Testing. label Nov 8, 2018
@mkimuram
Copy link
Contributor Author

mkimuram commented Nov 8, 2018

@msau42 @davidz627 @pohly

This PR will make fsType check as below:

STEP: Checking fsType is correct.
Nov  8 20:46:32.670: INFO: Running '/root/go/src/k8s.io/kubernetes/_output/bin/kubectl --server=https://localhost:6443/ --kubeconfig=/var/run/kubernetes/admin.
kubeconfig exec iscsi-client --namespace=e2e-tests-volumes-r8ljx -- grep  /opt/0 ext4 /proc/mounts'
Nov  8 20:46:33.002: INFO: stderr: ""
Nov  8 20:46:33.002: INFO: stdout: "/dev/sda /opt/0 ext4 rw,seclabel,relatime,block_validity,delalloc,barrier,user_xattr,acl 0 0\n"

I'm not sure csi gce actually works well, so I think that it would better to test [Testpattern: Dynamic PV (ext4)] volumes should be mountable with csi gce driver, before merging this PR.

@davidz627
Copy link
Contributor

/assign
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 8, 2018
@@ -91,7 +91,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
}

// Must match content of test/images/volumes-tester/nfs/index.html
framework.TestVolumeClient(c, config, nil, tests)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, add comment a la framework.TestVolumeClient(c, config, nil, "" /* fsType */, tests) for unnamed variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comment. I will fix all of them as suggested.

@@ -186,6 +186,9 @@ func (g *gcePDCSIDriver) GetDynamicProvisionStorageClass(fsType string) *storage
suffix := fmt.Sprintf("%s-sc", g.driverInfo.Name)

parameters := map[string]string{"type": "pd-standard"}
if fsType != "" {
parameters["fsType"] = fsType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we specify fsType in the storage class for GCE PD, it's actually passed in on NodeStageVolume through the VolumeCapability field that comes from the PVSource.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, CSI provisioner will add fsType to PVC if fsType is set in StorageClass on provision. So, fsType should also be passed to PV, as a result, it will be passed as a VolumeCapability on NodeStageVolume when attach is requested.

Copy link
Contributor

@davidz627 davidz627 Nov 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh cool, I didn't know that, thanks for the explanation!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidz627 this will still cause pd csi driver to fail right? Should we be using the new namespaced fstype parameter?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold
My understanding is PD csi tests in serial will start failing as is

@davidz627
Copy link
Contributor

@mkimuram I am testing this on the GCE PD CSI Driver now

@oomichi
Copy link
Member

oomichi commented Nov 15, 2018

/test pull-kubernetes-e2e-kops-aws

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 29, 2018
@mkimuram
Copy link
Contributor Author

@davidz627

Update this PR with two commits:

  1. Improve debug message to debug failure for aws with ext3
  2. Skip XFS test for csi gce pd on COS

I will check 1 to see what is happening.
Meanwhile, I would like you to check if this PR works well for csi gce pd as well, for it is still tagged with [Serial] and is not tested in CI automatically triggered on every commit.

@@ -348,6 +354,9 @@ func (g *gcePDExternalCSIDriver) GetDriverInfo() *DriverInfo {
func (g *gcePDExternalCSIDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
framework.SkipUnlessProviderIs("gce", "gke")
framework.SkipIfMultizone(g.driverInfo.Framework.ClientSet)
if pattern.FsType == "xfs" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to put this check in the "testsuite" skip checks instead of the driver skip tests? This skip "holds" for any driver that runs this test suite.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidz627

is there a way to put this check in the "testsuite" skip checks instead of the driver skip tests? This skip "holds" for any driver that runs this test suite.

I think that moving this logic to skipUnsupportedTest will make xfs tests skip for any drivers and any testsuites. However, to do so, we should blacklist unsupported distros instead of whitelisting just "ubuntu" and "custom", because we are not sure which distro will be passed here. (In current code, it assumes that this code path in gce driver's SkipUnsupportedTest reaches by only gce tests, so just whitelisting them is working fine.)

So, could you let me know which distro to blacklist?
(I guess that "gci" is needed here and how about "debian" and "coreos"?)

Copy link
Contributor Author

@mkimuram mkimuram Nov 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidz627

commit 07a456d will do above, assuming that only "gci" should be blacklisted. If this isn't true, please point it out.
(Currently, xfs test seems running only on gce CI, so we can go ahead once we confirm that it is true in gce CI, and add blacklist when we need to add some more latter.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msau42 @lookuptable do either of you know the answer to this? I am only aware of gci not having xfs support but there could be more

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For gce CI, blacklisting "gci" is fine, although we need to find a way to deal with "custom", which can be both ubuntu or gci. Can we check for the presence of xfs tools on the node?

@mkimuram
Copy link
Contributor Author

  1. Improve debug message to debug failure for aws with ext3

Below log indicates that in-tree aws driver seems to fail in formatting or mounting ext3.

test/e2e/storage/testsuites/volumes.go:153
failed: getting the right fsType ext3
Expected error:
    <*errors.errorString | 0xc00021c250>: {
        s: "Failed to find \"ext3\", last result: \"/dev/xvdbu /opt/0 ext4 rw,relatime,data=ordered 0 0\n\"",
    }
    Failed to find "ext3", last result: "/dev/xvdbu /opt/0 ext4 rw,relatime,data=ordered 0 0
    "
not to have occurred
test/e2e/framework/volume_util.go:483

In-tree gce driver passes for both dynamic provisioning and pre-provisioned PV cases, so I suspect that this is in-tree aws driver issue. Note that in-tree aws driver doesn't run pre-provisioned PV case, because it doesn't define necessary methods like GetPersistentVolumeSource for this driver.

(I believe that #67195 has fixed aws drivers to at least not to fail when fsType is specified in provisioining, so this issue should happen after it.)

@davidz627
Copy link
Contributor

GCE PD CSI driver will fail because fstype parameter is not supported on CreateVolume.

This is part of a larger problem, I have a PR out here to fix. @mkimuram please keep an eye on it :)

kubernetes-csi/external-provisioner#178

@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 23, 2019
@mkimuram
Copy link
Contributor Author

/retest

@mkimuram
Copy link
Contributor Author

@davidz627

I rebased the commits and updated fsType parameter for csi to csi.storage.k8s.io/fstype.
PTAL

@davidz627
Copy link
Contributor

tested and working with GCE PD CSI Driver now! Thanks @mkimuram
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 24, 2019
@davidz627
Copy link
Contributor

/assign @saad-ali
for final approval

@davidz627
Copy link
Contributor

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 25, 2019
Copy link
Member

@saad-ali saad-ali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@saad-ali saad-ali added the kind/bug Categorizes issue or PR as related to a bug. label Jan 28, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Jan 28, 2019
@saad-ali saad-ali added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Jan 28, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jan 28, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, mkimuram, saad-ali

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 28, 2019
@mkimuram
Copy link
Contributor Author

/retest

2 similar comments
@mkimuram
Copy link
Contributor Author

/retest

@mkimuram
Copy link
Contributor Author

/retest

@k8s-ci-robot
Copy link
Contributor

@mkimuram: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kops-aws b152d43 link /test pull-kubernetes-e2e-kops-aws

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Volumes e2e test should check fsType
7 participants