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

New volume snapshot e2e tests #235

Merged

Conversation

dkoshkin
Copy link
Contributor

@dkoshkin dkoshkin commented Mar 6, 2019

Is this a bug fix or adding new feature?
Fixes #228

What is this PR about? / Why do we need it?
Add a new e2e test to provision a pod, write to a volume, take a snapshot, provision a new pod with a volume source as the snapshot, and then validate the data is as expected.

• [SLOW TEST:175.757 seconds]
[ebs-csi-e2e] [single-az] Dynamic Provisioning
/Users/dkoshkin/src/github.com/kubernetes-sigs/aws-ebs-csi-driver/tests/e2e/dynamic_provisioning.go:39
  should create a pod, write and read to it, take a volume snapshot, and create another pod from the snapshot
  /Users/dkoshkin/src/github.com/kubernetes-sigs/aws-ebs-csi-driver/tests/e2e/dynamic_provisioning.go:411
------------------------------
SSSSSSSSSSSS
Ran 1 of 33 Specs in 175.758 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 32 Skipped
PASS

Ginkgo ran 1 suite in 3m4.633563865s
Test Suite Passed

What testing is done?
Locally ran the e2e test about 10 times.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 6, 2019
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 6, 2019
@dkoshkin
Copy link
Contributor Author

dkoshkin commented Mar 6, 2019

• Failure in Spec Setup (BeforeEach) [22.792 seconds]
[ebs-csi-e2e] [single-az] Pre-Provisioned
/home/prow/go/src/github.com/kubernetes-sigs/aws-ebs-csi-driver/tests/e2e/pre_provsioning.go:66
[env] should use a pre-provisioned volume and delete PV with reclaimPolicy "Delete" [BeforeEach]
/home/prow/go/src/github.com/kubernetes-sigs/aws-ebs-csi-driver/tests/e2e/pre_provsioning.go:191
could not provision a volume: failed to get an available volume in EC2: RequestLimitExceeded: Request limit exceeded.
status code: 503, request id: 1a89d9af-a527-440a-a147-756c43307116

@dkoshkin
Copy link
Contributor Author

dkoshkin commented Mar 6, 2019

/retest

@dkoshkin
Copy link
Contributor Author

dkoshkin commented Mar 6, 2019

/retest

@coveralls
Copy link

coveralls commented Mar 7, 2019

Pull Request Test Coverage Report for Build 514

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 66.689%

Totals Coverage Status
Change from base Build 512: 0.0%
Covered Lines: 997
Relevant Lines: 1495

💛 - Coveralls

}
}

func (t *TestPersistentVolumeClaim) Snapshot() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

@@ -154,3 +181,14 @@ func (volume *VolumeDetails) SetupPreProvisionedPersistentVolumeClaim(client cli

return tpvc, cleanupFuncs
}

func CreateVolumeSnapshotClass(client restclientset.Interface, namespace *v1.Namespace, csiDriver driver.VolumeSnapshotTestDriver) (*TestVolumeSnapshotClass, []func()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is CreateVolumeSnapshotClass returning a slice of clean up function? The only resource needs to be cleaned up is the CreateVolumeSnapshotClass itself?

Copy link
Contributor Author

@dkoshkin dkoshkin Mar 11, 2019

Choose a reason for hiding this comment

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

Done

// DynamicallyProvisionedVolumeSnapshotTest will provision required StorageClass(es),VolumeSnapshotClass(es), PVC(s) and Pod(s)
// Waiting for the PV provisioner to create a new PV
// Testing if the Pod(s) can write and read to mounted volumes
// Create a snapshot, validate the data is still on the disk, and then write and read to it again
Copy link
Contributor

Choose a reason for hiding this comment

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

Should mention this is testing delete snapshot as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


func (t *TestVolumeSnapshotClass) Cleanup() {
framework.Logf("deleting VolumeSnapshotClass %s", t.volumeSnapshotClass.Name)
err := snapshotclientset.New(t.client).VolumesnapshotV1alpha1().VolumeSnapshotClasses().Delete(t.volumeSnapshotClass.Name, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel we have too many clients here, and it sometimes is confusing. Could we create the snapshotclientset at the very beginning inside BeforeEach instead of creating restclient there and passing it all the way down here? How do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After putting it in its own Describe it feels cleaner since all of these tests would require the client.

@@ -30,19 +31,28 @@ import (

awscloud "github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/cloud"
ebscsidriver "github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/driver"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
)

var _ = Describe("[ebs-csi-e2e] [single-az] Dynamic Provisioning", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you create the snapshot tests in a separate Describe like Describe("[ebs-csi-e2e] [single-az] Snapshot"). So that we could add more snapshot related tests there (eg. snapshot with pre-provisioned, nvme, block volume) if needed without mixing too much in in existing tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved it.

@leakingtapan
Copy link
Contributor

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dkoshkin, leakingtapan

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 Mar 11, 2019
@k8s-ci-robot k8s-ci-robot merged commit 65941b6 into kubernetes-sigs:master Mar 11, 2019
dobsonj pushed a commit to dobsonj/aws-ebs-csi-driver that referenced this pull request Oct 14, 2023
…ency-openshift-4.15-ose-aws-ebs-csi-driver

OCPBUGS-19101: Updating ose-aws-ebs-csi-driver images to be consistent with ART
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add snapshot e2e test
4 participants