-
Notifications
You must be signed in to change notification settings - Fork 813
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
New volume snapshot e2e tests #235
Conversation
|
/retest |
f60cc5f
to
7668516
Compare
/retest |
f9ee18e
to
4c2e6ec
Compare
tests/e2e/testsuites/testsuites.go
Outdated
} | ||
} | ||
|
||
func (t *TestPersistentVolumeClaim) Snapshot() { |
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.
Not needed?
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.
Removed
tests/e2e/testsuites/specs.go
Outdated
@@ -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()) { |
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.
Why is CreateVolumeSnapshotClass
returning a slice of clean up function? The only resource needs to be cleaned up is the CreateVolumeSnapshotClass
itself?
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
// 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 |
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.
Should mention this is testing delete snapshot as well
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
|
||
func (t *TestVolumeSnapshotClass) Cleanup() { | ||
framework.Logf("deleting VolumeSnapshotClass %s", t.volumeSnapshotClass.Name) | ||
err := snapshotclientset.New(t.client).VolumesnapshotV1alpha1().VolumeSnapshotClasses().Delete(t.volumeSnapshotClass.Name, nil) |
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 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?
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.
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() { |
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.
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.
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.
Moved it.
4c2e6ec
to
9fc59ec
Compare
9fc59ec
to
c4fe59e
Compare
/lgtm |
[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 |
…ency-openshift-4.15-ose-aws-ebs-csi-driver OCPBUGS-19101: Updating ose-aws-ebs-csi-driver images to be consistent with ART
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.
What testing is done?
Locally ran the e2e test about 10 times.