Commit Graph

143 Commits (release-1.11)

Author SHA1 Message Date
danfengl 4db866a0b2 Add upgrade test into E2E tests
Signed-off-by: danfengl <danfengl@vmware.com>
2021-09-08 13:16:53 +00:00
Daniel Jiang 8abc80ec41
Merge pull request #4082 from reasonerjt/refine-e2e
Enhance e2e test
2021-09-01 10:12:25 +08:00
Wenkai Yin(尹文开) 8d57215ded
Several fixes to improve the stability of E2E testing (#4056)
1. Support to customize the restic restore helper image
2. Use a seperated context when doing the clean up works
3. Wait a while before doing the the restore for aws to avoid #1799

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-08-31 12:50:38 -04:00
Daniel Jiang 70a8a5d54d Enhance e2e test
1. Check the error when waiting for restice daemonset to be ready, so
   the timeout will be reported
2. Add support for gcp provider and fail early if the provider is
   unknown

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-08-31 21:01:21 +08:00
Daniel Jiang 74476db9d7
Merge pull request #4064 from kahirokunn/main
fixes for CVE-2021-3121 and CVE-2021-3580
2021-08-30 18:33:18 +08:00
Wenkai Yin(尹文开) a9f411d27a Install/uninstall velero by CLI in the E2E test case
Do this for two reasons:
1. Verify the functionalities for installation and uninstllation of CLI
2. We want to add upgrade test case which needs to install different versions of velero, calling libraries is impossible for this

fixes #4062

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-08-26 09:32:29 +08:00
kahirokunn 0eda0ec8b9 fixes for CVE-2021-3121 and CVE-2021-3580
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
2021-08-24 17:08:20 +09:00
Wenkai Yin(尹文开) 31a8e5080c
Wait the namespace deletion completed before removing the CRDs (#4007)
Wait the namespace deletion completed before removing the CRDs when uninstalling the velero

Fixes #3974

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-08-17 08:55:22 -07:00
Wenkai Yin(尹文开) d913f83c72
Fix the random failure of E2E test cases (#4005)
Fix the random failure by increasing the timeout and introducing few minor refactor/bug fixes

Fixes #3970

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-08-12 09:44:24 +08:00
Bridget McErlean d98c65f69e
Use appropriate CRD API during readiness check (#4015)
* Use appropriate CRD API during readiness check

The readiness check for the Velero CRDs was still using the v1beta1 API.
This would cause the readiness check to fail on 1.22 clusters as the
v1beta1 API is no longer available. Previously, this error would be
ignored and the installation would proceed, however with #4002, we are
no longer ignoring errors from this check.

This change modifies the CRD readiness check to check the CRDs using the
same API version that was used when submitting the CRDs to the cluster.
It also introduces a new CRD builder using the V1 API for testing.

This change also fixes a bug that was identified in the polling code
where if the CRDs were not ready on the first polling iteration, they
would be added again to the list of CRDs to check resulting in
duplicates. This would cause the length check to fail on all subsequent
polls and the timeout would always be reached.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>

* Remove duplicate V1 CRD builder and update comment

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-08-05 15:17:14 -04:00
Wenkai Yin(尹文开) b84ce9b6aa Patch the resources of velero and kibishii when running E2E testing
Add the image pull secret to the service account when deploying velero and kibishii to avoid the image pull limit issue of Docker Hub

Fixes #3966

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-07-29 11:38:57 +08:00
Scott Seago 2c46b47404 enable e2e tests to choose crd apiVersion
Signed-off-by: Scott Seago <sseago@redhat.com>
2021-07-28 17:40:30 -04:00
Wenkai Yin(尹文开) df65754c54
Control the name of backup used in E2E test to avoid issue on vSphere (#3985)
The backup name must be no more than 63 characters otherwise we'll get error on vSphere platform:
Failed to create snapshot record: Snapshot.backupdriver.cnsdp.vmware.com \"snap-8945e7df-069e-4f56-aeb5-75b1dd87547f\" is invalid: metadata.labels: Invalid value: \"backup-bsl-e7a1d0f3-2f29-4d80-9184-6214dac91d96-e7a1d0f3-2f29-4d80-9184-6214dac91d96\": must be no more than 63 characters"

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-07-28 15:28:27 +08:00
Jai Subash Devmane 36b1aaa99d
Fixing multipleNamespaceTest bug - Missing expect statement in test (#3983)
* Fixing multipleNamespaceTest bug - No expect statement in test
* adding changelog

Signed-off-by: Jai Subash Devmane <jdevmane@redhat.com>
2021-07-27 15:32:36 +08:00
Daniel Jiang e555588a93
Merge pull request #3986 from ywk253100/210726_plugin_version
Bump up vSphere plugin version to v1.1.1
2021-07-26 16:50:32 +08:00
Wenkai Yin(尹文开) 1d2750b86c Bump up vSphere plugin version to v1.1.1
Bump up vSphere plugin version to v1.1.1 to avoid the issue https://github.com/vmware-tanzu/velero-plugin-for-vsphere/issues/290

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-07-26 10:37:03 +08:00
Wenkai Yin(尹文开) 6a0267d4e9 Generate test report for the E2E testing
Generate test report for the E2E testing so that we can check the test result in the automation pipelines easily

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-07-26 09:49:42 +08:00
Jai Subash Devmane db375f34c1 Fix -install-velero flag for e2e tests
Signed-off-by: Jai Subash Devmane <jdevmane@redhat.com>
2021-07-02 17:21:36 -04:00
Wenkai Yin(尹文开) bb05ed390b Enable the E2E test on Github Action
1. Run the E2E test with kind(provision various versions of k8s cluster) and MinIO on Github Action
2. Bug fix: the variable "stdoutBuf" is assigned to both "installPluginCmd.Stdout" and "installPluginCmd.Stderr", this causes 'if !strings.Contains(stderrBuf.String(), "Duplicate value")' takes no effect as the "stderrBuf.String()" is always empty
3. Print the stdout and stderr for easy debugging

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-06-30 21:45:26 +08:00
Scott Seago 962a957f1b
regression introduced in 1.6 restore progress: fix CR restore (#3845)
Signed-off-by: Scott Seago <sseago@redhat.com>
2021-06-19 00:03:11 -07:00
David L. Smith-Uchida d871370c1e
Added multiple namespace test (#3763)
Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-06-17 11:23:12 -07:00
codegold79 c21b66166a
API groups e2e tests remove controllers (#3564)
* Remove controllers and sleeps in API groups e2e tests

Signed-off-by: F. Gold <fgold@vmware.com>

* Print command in AfterEach(...) and check error

Signed-off-by: F. Gold <fgold@vmware.com>

* Make change ahead of PR3764 changes in main

Signed-off-by: F. Gold <fgold@vmware.com>

* Update go.{mod,sum} files

Signed-off-by: F. Gold <fgold@vmware.com>

* Run make update

Signed-off-by: F. Gold <fgold@vmware.com>
2021-06-17 10:50:59 -07:00
Alay Patel 888de9fe46 fix typos for code spell test
Signed-off-by: Alay Patel <alay1431@gmail.com>
2021-06-11 00:13:50 -04:00
Carlisia Thompson 81f1f21871
Consolidate api clients for e2e tests (#3764)
* Consolidate api clients
* Adress Nolan reviews
* Adding back output warning for consistency
* Remove unnecessary documentation
* Address Bridget's reviews
* Update go.sum files

Signed-off-by: Carlisia <carlisia@grokkingtech.io>
Co-authored-by: Bridget McErlean <bmcerlean@vmware.com>
2021-06-09 22:07:56 +08:00
David L. Smith-Uchida 4d173d725c
Changed kibishii wait commands to output stdout/stderr, makes for better debugging (#3762)
Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-05-10 09:30:41 -04:00
Carlisia Thompson ccac3d4130
A small refactor of the e2e tests (#3726)
* A small refactor of the e2e tests

Signed-off-by: Carlisia <carlisia@grokkingtech.io>

* Add copyright header

Signed-off-by: Carlisia <carlisia@grokkingtech.io>

* Fix CI

Signed-off-by: Carlisia <carlisia@grokkingtech.io>

* Revert unneeded changes

Signed-off-by: Carlisia <carlisia@grokkingtech.io>

* Remove file that doesnt belong here

Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2021-04-28 09:54:17 -07:00
David L. Smith-Uchida 6a6734789e
Merge pull request #3618 from carlisia/c-uninstall
Make uninstall more robust and informative
2021-03-25 19:13:01 -07:00
David L. Smith-Uchida 242fba9c05
Runs vSphere tests with snapshots (#3629)
Added wait for vSphere plug-in uploads to complete

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-03-25 17:46:57 -04:00
Carlisia 61c891f055 Addressed Dave's review
Signed-off-by: Carlisia <carlisia@vmware.com>
2021-03-25 13:24:30 -07:00
Carlisia 4fff2a4a5c Make uninstall more robust and informative
Signed-off-by: Carlisia <carlisia@vmware.com>
2021-03-23 18:00:38 -07:00
David L. Smith-Uchida e9c997839e
Added volume snapshot test for backup/restore. (#3592)
Snapshot tests can be run with Ginkgo focus "Snapshot" and restic tests with Ginkgo focus "Restic".
Restic and volume snapshot tests can now be run simultaneously.
Added check for kibishii app start after restore.
Consolidated kibishii pod checks into waitForKibishiiPods.
Added WaitForPods function to e2e/tests/common.goSnapshot tests are skipped automatically on kind clusters.
Fixed issue where velero_utils InstallVeleroServer was looking for the Restic daemon set in the "velero" namespace only (was ignoring io.Namespace)

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-03-17 14:38:47 -04:00
Carlisia c032f12232 Upgrade e2e tests to new plugin versions (v1.2)
Signed-off-by: Carlisia <carlisia@vmware.com>
2021-03-15 16:06:16 -07:00
Bridget McErlean 70287f00f9
Install plugins for additional BSL in E2E test (#3582)
The test for multiple credentials assumed that the plugin for the
additional BSL provider was already installed. This will not be the case
when performing a clean install of Velero between tests.

This adds a new utility function to add the plugins that are necessary
for the additional BSL provider. It doesn't check which plugins are
already installed, it will just attempt to install and if the stderr
contains the message that it is a duplicate plugin, we ignore the error
and continue. This could be improved by instpecting the output from
`velero plugin get` but I opted for a quicker solution given the
upcoming release.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-03-14 23:23:41 -07:00
David L. Smith-Uchida b191140cf1
Updated Azure plugin in e2e tests to 1.1.2 (latest) (#3585)
Updated vSphere plugin in e2e tests to 1.1.0 (latest)

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-03-14 23:21:05 -07:00
Bridget McErlean 26c14933cc Address review comments
Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-03-10 17:35:17 -05:00
Bridget McErlean 9ad1e898d6 Add E2E test for multiple credentials
This change adds an E2E test which exercises the mulitple credentials
feature added in #3489. The test creates a secret from the given
credentials and creates a BackupStorageLocation which uses those
credentials. A backup and restore is then performed to the default
BSL and to the newly created BSL.

This change adds new flags to the E2E test suite to configure the BSL
created and used in the test.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-03-10 16:43:47 -05:00
Ashish Amarnath 55a9b65c17
Prefer conditional waiting over magic sleep (#3527)
* prefer conditional waiting over magic sleep

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* update go modules

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2021-03-09 13:32:30 -08:00
Suraj Banakar ff1a31db4a
Support cli uninstall (#3399)
* Add uninstall cmd
- init fn to uninstall velero
- abstract dynamic client creation to a separate fn
- creates a separate client per unstructured resource
- add delete client for CRDs
- export appendUnstructured
- add uninstall command to main cmd
- export `podTemplateOption`
- uninstall resources in the reverse order of installation
- fallback to `velero` if no ns is provided during uninstall
- skip deletion if the resource doesn't exist
- handle resource not found error
- match log formatting with cli install logs
- add Delete fn to fake client
- fix import order
- add changelog
- add comment doc for CreateClient fn

Signed-off-by: Suraj Banakar <suraj@infracloud.io>

* Re-use uninstall code from test suite
- move helper functions out of test suite
- this is to prevent cyclic imports
- move uninstall helpers to uninstall cmd
- call them from test suite
- revert export of variables/fns from install code
- because not required anymore

Signed-off-by: Suraj Banakar <suraj@infracloud.io>

* Revert `PodTemplateOption` -> `podTemplateOption`

Signed-off-by: Suraj Banakar <suraj@infracloud.io>

* Use uninstall helper under VeleroUninstall
- as a wrapper
- fix import related errors in test suite

Signed-off-by: Suraj Banakar <suraj@infracloud.io>
2021-03-04 14:16:40 -05:00
David L. Smith-Uchida 45d53178ae
E2E tests now run in multiple clouds in addition to KIND (#3286)
Split plug-in provider into cloud provider/object provider
Moved velero install/uninstall for tests into velero_utils
Added remove of CRDs to test v elero uninstall
Added remove of cluster role binding to test velero uninstall
Added dump of velero describe and logs on error
Added velero namespace argument to velero_utils functions
Modified api group versions e2e tests to use VeleroInstall
Added velero logs dumps for api group versions e2e testing
Added DeleteNamespace to test/e2e/common.go
Fixed VeleroInstall to use the image specified
Changed enable_api_group_versions_test to use veleroNamespace instead of hardcoded "velero"

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-02-19 08:16:59 +08:00
codegold79 6bdd4ac192
Restore API group version by priority (#3133)
* Restore API group version by priority

Signed-off-by: F. Gold <fgold@vmware.com>

* Add changelog

Signed-off-by: F. Gold <fgold@vmware.com>

* Correct spelling

Signed-off-by: F. Gold <fgold@vmware.com>

* Refactor userResourceGroupVersionPriorities(...) to accept config map, adjust unit test

Signed-off-by: F. Gold <fgold@vmware.com>

* Move some unit tests into e2e

Signed-off-by: F. Gold <fgold@vmware.com>

* Add three e2e tests using Testify Suites

Summary of changes

Makefile - add testify e2e test target
go.sum - changed with go mod tidy
pkg/install/install.go - increased polling timeout
test/e2e/restore_priority_group_test.go - deleted
test/e2e/restore_test.go - deleted
test/e2e/velero_utils.go - made restic optional in velero install
test/e2e_testify/Makefile - makefile for testify e2e tests
test/e2e_testify/README.md - example command for running tests
test/e2e_testify/common_test.go - helper functions
test/e2e_testify/e2e_suite_test.go - prepare for tests and run
test/e2e_testify/restore_priority_apigv_test.go - test cases

Signed-off-by: F. Gold <fgold@vmware.com>

* Make changes per @nrb code review

Signed-off-by: F. Gold <fgold@vmware.com>

* Wait for pods in e2e tests

Signed-off-by: F. Gold <fgold@vmware.com>

* Remove testify suites e2e scaffolding moved to PR #3354

Signed-off-by: F. Gold <fgold@vmware.com>

* Make changes per @brito-rafa and Velero maintainers code reviews

- Made changes suggested by @brito-rafa in GitHub.
- We had a code review meeting with @carlisia, @dsu-igeek, @zubron, and @nrb
- and changes were made based on their suggetions:
  - pull in logic from 'meetsAPIGVResotreReqs()' to restore.go.
  - add TODO to remove APIGroupVersionFeatureFlag check
  - have feature flag and backup version format checks in separate `if` statements.
  - rename variables to be sourceGVs, targetGVs, and userGVs.

Signed-off-by: F. Gold <fgold@vmware.com>

* Convert Testify Suites e2e tests to existing Ginkgo framework

Signed-off-by: F. Gold <fgold@vmware.com>

* Made changes per @zubron PR review

Signed-off-by: F. Gold <fgold@vmware.com>

* Run go mod tidy after resolving go.sum merge conflict

Signed-off-by: F. Gold <fgold@vmware.com>

* Add feature documentation to velero.io site

Signed-off-by: F. Gold <fgold@vmware.com>

* Add config map e2e test; rename e2e test file and name

Signed-off-by: F. Gold <fgold@vmware.com>

* Update go.{mod,sum} files

Signed-off-by: F. Gold <fgold@vmware.com>

* Move CRDs and CRs to testdata folder

Signed-off-by: F. Gold <fgold@vmware.com>

* Fix typos in cert-manager to pass codespell CICD check

Signed-off-by: F. Gold <fgold@vmware.com>

* Make changes per @nrb code review round 2

- make checkAndReadDir function private
- add info level messages when priorties 1-3 API group versions can not be used

Signed-off-by: F. Gold <fgold@vmware.com>

* Make user config map rules less strict

Signed-off-by: F. Gold <fgold@vmware.com>

* Update e2e test image version in example

Signed-off-by: F. Gold <fgold@vmware.com>

* Update case A music-system controller code

Signed-off-by: F. Gold <fgold@vmware.com>

* Documentation updates

Signed-off-by: F. Gold <fgold@vmware.com>

* Update migration case documentation

Signed-off-by: F. Gold <fgold@vmware.com>
2021-02-16 12:36:17 -05:00
David L. Smith-Uchida 3754691e1c
Updated for new repository for Kibishii Distributed Data Generator for e2e tests (#3267)
Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-01-21 21:06:44 -05:00
Ashish Amarnath 249215f1ff
Add more E2E tests and improvement (#3111)
* remove checked in binary and update test/e2e Makefile

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* remove platform specific tests for now

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* install velero before running tests and robust makefiles

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* changelog

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* running e2e tests expects credentials file to be supplied
run e2e tests on velero/velero:main image by default

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* refactor to parameterize tests

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* rename files to use provider tests convention

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* rename tests file

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* remove providerName config

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* run kibishii test on azure

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* refactor to make bsl vsl configurable

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* skip e2e tests when not explicitly running e2e tests

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* update e2e docs

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* refactor and update docs

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* refactor

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* cleanup

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* use velero's exec package

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

Co-authored-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2020-12-09 16:26:05 -08:00
David L. Smith-Uchida aa47309700
Add an E2E test framework to test Velero across cloud platforms (#3060)
* Basic end-to-end tests, generate data/backup/remove/restore/verify
Uses distributed data generator

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Moved backup/restore into velero_utils, started using a name for the restore

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* remove checked in binary and update test/e2e Makefile

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* Ran make update

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Save

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* Ran make update

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Basic end-to-end test, generate data/backup/remove/restore/verify
Uses distributed data generator

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Changed tests/e2e Makefile to just use go get to install ginkgo in the GOPATH/bin
Updated to ginkgo 1.14.2
Put cobra back to v0.0.7

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Added CLOUD_PLATFORM env variable to Makefile, updated README, removed ginkgo from .gitignore

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* choose velero CLI binary based on local env

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

Co-authored-by: Ashish Amarnath <ashisham@vmware.com>
2020-11-24 14:12:52 -05:00