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

Add backup deletion e2e test #4401

Merged

Conversation

danfengliu
Copy link
Contributor

@danfengliu danfengliu commented Nov 26, 2021

Fixed issue : #4348

Signed-off-by: danfengl danfengl@vmware.com

Thank you for contributing to Velero!

Please add a summary of your change

Does your change fix a particular issue?

Fixes #(issue)

Please indicate you've done the following:

@github-actions github-actions bot added Dependencies Pull requests that update a dependency file has-e2e-tests labels Nov 26, 2021
@danfengliu danfengliu force-pushed the add-backup-deletion-e2e-test-to-main branch 2 times, most recently from 015e721 to f8be092 Compare November 29, 2021 11:13
@danfengliu danfengliu force-pushed the add-backup-deletion-e2e-test-to-main branch 4 times, most recently from 01a0f15 to 62ad0ba Compare November 30, 2021 00:36
@danfengliu danfengliu changed the title Add backup deletion e2e test Add backup deletion e2e test - backup with restic Nov 30, 2021
@danfengliu danfengliu force-pushed the add-backup-deletion-e2e-test-to-main branch 2 times, most recently from 6bada56 to f465ae1 Compare December 1, 2021 06:56
Copy link
Contributor

@qiuming-best qiuming-best left a comment

Choose a reason for hiding this comment

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

Some detail maybe should be modified.

test/e2e/backup-resource/deletion.go Outdated Show resolved Hide resolved
test/e2e/backup-resource/deletion.go Outdated Show resolved Hide resolved
test/e2e/e2e_suite_test.go Outdated Show resolved Hide resolved
test/e2e/util/providers/azure_utils.go Outdated Show resolved Hide resolved
if serr, ok := err.(azblob.StorageError); ok { // This error is a Service-specific
switch serr.ServiceCode() { // Compare serviceCode to ServiceCodeXxx constants
case azblob.ServiceCodeContainerAlreadyExists:
//fmt.Println("Received 409. Container already exists")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be removed or print it

@danfengliu danfengliu force-pushed the add-backup-deletion-e2e-test-to-main branch 2 times, most recently from b30eaaa to d07c689 Compare December 1, 2021 07:48
qiuming-best
qiuming-best previously approved these changes Dec 1, 2021
See the License for the specific language governing permissions and
limitations under the License.
*/
package backupresource
Copy link
Contributor

Choose a reason for hiding this comment

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

There is already a package called backup here, so what's different between the backup and backupresource? It's confusing.

return err
}
backupName = "backup-1-" + UUIDgen.String()
if err := VeleroBackupNamespace(oneHourTimeout, veleroCLI, veleroNamespace, backupName, deletionTest, backupLocation, useVolumeSnapshots); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to backup again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the 1st backup was deleted locally for verification that backup can be deleted from object store right after local deletion.

func Backup_deletion_with_restic() {
backup_deletion_test(false)
}
func backup_deletion_test(useVolumeSnapshots bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this case check the snapshots or restic data? If it doesn't, why we need to back up the volumes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Snapshot verification will be provide in a new PR. Way of verifying Restic repo changes is under investigation.

})

When("kibishii is the sample workload", func() {
It("should be successfully backed up and restored to the default BackupStorageLocation", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct the case description?

@@ -76,6 +77,8 @@ var _ = Describe("[Upgrade][Restic] Velero upgrade tests on cluster using the pl

var _ = Describe("[Upgrade][Snapshot] Velero upgrade tests on cluster using the plugin provider for object storage and snapshots for volume backups", BackupUpgradeRestoreWithSnapshots)

var _ = Describe("[backup-resource][deletion][restic] Velero tests on cluster using the plugin provider for object storage and Restic for volume backups", Backup_deletion_with_restic)
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct the case description

Copy link
Contributor

Choose a reason for hiding this comment

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

Changing [backup-resource][deletion] to [backup-deletion] is more reasonable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There will be more tests under backup-resource, the resource does not mean as k8s resources, it is the resource caused by backup action, it's the object of velero.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use unified naming conventions like [BackupResource][Deletion][Restic]?

@danfengliu danfengliu force-pushed the add-backup-deletion-e2e-test-to-main branch 2 times, most recently from e0c0105 to 4e2df0a Compare December 14, 2021 07:15
@danfengliu danfengliu force-pushed the add-backup-deletion-e2e-test-to-main branch 8 times, most recently from c409c81 to 6a24e03 Compare December 17, 2021 08:03
@danfengliu danfengliu changed the title Add backup deletion e2e test - backup with restic Add backup deletion e2e test Dec 17, 2021
@danfengliu danfengliu force-pushed the add-backup-deletion-e2e-test-to-main branch 4 times, most recently from 2447128 to 7561e17 Compare December 20, 2021 07:48
@danfengliu danfengliu linked an issue Dec 20, 2021 that may be closed by this pull request
qiuming-best
qiuming-best previously approved these changes Dec 21, 2021
@danfengliu danfengliu force-pushed the add-backup-deletion-e2e-test-to-main branch 6 times, most recently from efe809c to 9f898df Compare December 23, 2021 12:29
Test case description is "Deleted backups are deleted from object storage and backups deleted from object storage can be deleted locally",
in this test, only resource backup objects are target for verifition, restic repo verification is not included in this PR, and snapshot verification will be in later PR

Signed-off-by: danfengl <danfengl@vmware.com>
@danfengliu danfengliu force-pushed the add-backup-deletion-e2e-test-to-main branch from 9f898df to 29b2cd1 Compare December 23, 2021 12:45
@ywk253100 ywk253100 merged commit 3feb259 into vmware-tanzu:main Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Pull requests that update a dependency file has-changelog has-e2e-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add E2E test of backups deletion
3 participants