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

ValidateVolumeCapabilities Fails Because It Calls Non-existing Volume #148

Closed
mattsmithdatera opened this issue Dec 5, 2018 · 2 comments

Comments

@mattsmithdatera
Copy link
Contributor

Reproduction:
v1.1.0 branch

func TestDriver(t *testing.T) {
	go func() {
		d := getDriver(t)
		if err := d.Run(); err != nil {
			t.Fatal(err)
		}
	}()
	sc := &sanity.Config{
		TargetPath:  "/mnt/my-publish",
		StagingPath: "/mnt/my-staging",
		Address:     Endpoint,
	}
	sanity.Test(t, sc)
}

All tests pass except ValidateVolumeCapabilities which fails for the below reason.

STEP: reusing connection to CSI driver at unix:///tmp/test-csi.sock
STEP: creating mount and staging directories
STEP: creating a single node writer volume
STEP: validating volume capabilities
cleanup: deleting sanity-controller-validate-053C02BC-18C78554 = CSI-sanity-controller-validate-053C02BC-18C78554

------------------------------
• Failure [2.087 seconds]
Controller Service
/home/ubuntu/go/src/github.com/kubernetes-csi/csi-test/pkg/sanity/tests.go:44
  ValidateVolumeCapabilities
  /home/ubuntu/go/src/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:591
    should return appropriate values (no optional values added) [It]
    /home/ubuntu/go/src/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:618

    Expected
        <[]*csi.VolumeCapability | len:0, cap:0>: nil
    not to be empty

    /home/ubuntu/go/src/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:671
------------------------------
2018-12-05T18:12:46Z INFO GRPC -- request: /csi.v1.Controller/ValidateVolumeCapabilities -- volume_id:"some-vol-id" volume_capabilities:<mount:<> access_mode:<mode:SINGLE_NODE_WRITER > > 

You can see that the volume created for this test was sanity-controller-validate-053C02BC-18C78554, but the volume called for the test in the ValidateVolumeCapabilities step is some-vol-id.

For some reason, the original volume-id isn't being used during subsequent steps of the test. My ValidateVolumeCapabilities function is returning an error because the volume_id is invalid.

@pohly
Copy link
Contributor

pohly commented Dec 6, 2018

Just to clarify, this happens because your ValidateVolumeCapabilities checks for a valid volume ID?

I agree, the test should be using a valid volume. Care to submit a PR which fixes that? If so, please do it against master, it can and will be backported.

@mattsmithdatera
Copy link
Contributor Author

ValidateVolumeCapabilities checks for a non-existing volume ID. The create volume call in the test creates CSI volume: sanity-controller-validate-053C02BC-18C78554, but the validate volume call isn't looking for that volume, instead it's looking for volume: some-vol-id which was never created.

dobsonj added a commit to dobsonj/csi-test that referenced this issue May 13, 2021
7b96bea Merge pull request kubernetes-csi#148 from dobsonj/add-checkpathcmd-to-prow
2d2e03b prow.sh: enable -csi.checkpathcmd option in csi-sanity
09d4151 Merge pull request kubernetes-csi#147 from pohly/mock-testing
74cfbc9 prow.sh: support mock tests
4a3f110 prow.sh: remove obsolete test suppression

git-subtree-dir: release-tools
git-subtree-split: 7b96bea
stmcginnis pushed a commit to stmcginnis/csi-test that referenced this issue Oct 9, 2024
…o-prow

prow.sh: enable -csi.checkpathcmd option in csi-sanity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants