2021-11-22 07:34:48 +00:00
|
|
|
/*
|
|
|
|
Copyright the Velero contributors.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-07-31 02:25:48 +00:00
|
|
|
package test
|
2021-11-22 07:34:48 +00:00
|
|
|
|
|
|
|
import (
|
2022-05-09 06:51:18 +00:00
|
|
|
"time"
|
|
|
|
|
2021-11-22 07:34:48 +00:00
|
|
|
"github.com/google/uuid"
|
2022-07-05 12:37:14 +00:00
|
|
|
|
2023-11-07 06:25:13 +00:00
|
|
|
"github.com/vmware-tanzu/velero/pkg/cmd/cli/install"
|
2023-07-31 02:25:48 +00:00
|
|
|
. "github.com/vmware-tanzu/velero/test/util/k8s"
|
2021-11-22 07:34:48 +00:00
|
|
|
)
|
|
|
|
|
2023-04-26 02:33:21 +00:00
|
|
|
const StorageClassName = "e2e-storage-class"
|
2023-08-14 03:48:34 +00:00
|
|
|
const StorageClassName2 = "e2e-storage-class-2"
|
2023-12-12 01:50:55 +00:00
|
|
|
const CSIStorageClassName = "e2e-csi-storage-class"
|
2023-11-27 01:53:13 +00:00
|
|
|
const FeatureCSI = "EnableCSI"
|
2024-02-01 09:19:08 +00:00
|
|
|
const VanillaZFS = "vanilla-zfs"
|
|
|
|
const Kind = "kind"
|
|
|
|
const Azure = "azure"
|
|
|
|
const AzureCSI = "azure-csi"
|
|
|
|
const AwsCSI = "aws-csi"
|
2024-03-29 02:29:27 +00:00
|
|
|
const AWS = "aws"
|
2024-02-01 09:19:08 +00:00
|
|
|
const Gcp = "gcp"
|
|
|
|
const Vsphere = "vsphere"
|
|
|
|
|
2024-03-29 02:29:27 +00:00
|
|
|
var PublicCloudProviders = []string{AWS, Azure, Gcp, Vsphere}
|
2024-02-01 09:19:08 +00:00
|
|
|
var LocalCloudProviders = []string{Kind, VanillaZFS}
|
|
|
|
var CloudProviders = append(PublicCloudProviders, LocalCloudProviders...)
|
2023-04-26 02:33:21 +00:00
|
|
|
|
2023-11-27 01:53:13 +00:00
|
|
|
var InstallVelero bool
|
2021-11-22 07:34:48 +00:00
|
|
|
var UUIDgen uuid.UUID
|
|
|
|
|
2022-10-29 07:54:47 +00:00
|
|
|
var VeleroCfg VeleroConfig
|
2021-11-22 07:34:48 +00:00
|
|
|
|
2023-07-31 02:25:48 +00:00
|
|
|
type Report struct {
|
|
|
|
TestDescription string `yaml:"Test Description"`
|
|
|
|
OtherFields map[string]interface{} `yaml:",inline"`
|
|
|
|
}
|
|
|
|
|
|
|
|
var ReportData *Report
|
|
|
|
|
2022-10-29 07:54:47 +00:00
|
|
|
type VeleroConfig struct {
|
2023-07-31 02:25:48 +00:00
|
|
|
VeleroCfgInPerf
|
2023-11-27 01:53:13 +00:00
|
|
|
install.Options
|
2023-08-14 03:48:34 +00:00
|
|
|
VeleroCLI string
|
|
|
|
VeleroImage string
|
|
|
|
VeleroVersion string
|
|
|
|
CloudCredentialsFile string
|
|
|
|
BSLConfig string
|
|
|
|
BSLBucket string
|
|
|
|
BSLPrefix string
|
|
|
|
VSLConfig string
|
|
|
|
CloudProvider string
|
|
|
|
ObjectStoreProvider string
|
|
|
|
VeleroNamespace string
|
|
|
|
AdditionalBSLProvider string
|
|
|
|
AdditionalBSLBucket string
|
|
|
|
AdditionalBSLPrefix string
|
|
|
|
AdditionalBSLConfig string
|
|
|
|
AdditionalBSLCredentials string
|
|
|
|
RegistryCredentialFile string
|
|
|
|
RestoreHelperImage string
|
|
|
|
UpgradeFromVeleroVersion string
|
|
|
|
UpgradeFromVeleroCLI string
|
|
|
|
MigrateFromVeleroVersion string
|
|
|
|
MigrateFromVeleroCLI string
|
|
|
|
Plugins string
|
|
|
|
AddBSLPlugins string
|
|
|
|
KibishiiDirectory string
|
|
|
|
Debug bool
|
|
|
|
GCFrequency string
|
2024-01-04 02:46:06 +00:00
|
|
|
DefaultClusterContext string
|
|
|
|
StandbyClusterContext string
|
2023-08-14 03:48:34 +00:00
|
|
|
ClientToInstallVelero *TestClient
|
|
|
|
DefaultClient *TestClient
|
|
|
|
StandbyClient *TestClient
|
2024-01-04 02:46:06 +00:00
|
|
|
ClusterToInstallVelero string
|
|
|
|
DefaultClusterName string
|
|
|
|
StandbyClusterName string
|
2023-08-14 03:48:34 +00:00
|
|
|
ProvideSnapshotsVolumeParam bool
|
|
|
|
VeleroServerDebugMode bool
|
|
|
|
SnapshotMoveData bool
|
|
|
|
DataMoverPlugin string
|
|
|
|
StandbyClusterCloudProvider string
|
|
|
|
StandbyClusterPlugins string
|
2024-01-24 19:28:58 +00:00
|
|
|
StandbyClusterObjectStoreProvider string
|
2023-08-14 03:48:34 +00:00
|
|
|
DebugVeleroPodRestart bool
|
2023-11-27 01:53:13 +00:00
|
|
|
IsUpgradeTest bool
|
2024-01-04 02:54:30 +00:00
|
|
|
WithoutDisableInformerCacheParam bool
|
|
|
|
DisableInformerCache bool
|
2024-01-04 02:46:06 +00:00
|
|
|
CreateClusterRoleBinding bool
|
2024-01-24 06:21:04 +00:00
|
|
|
DefaultCLSServiceAccountName string
|
|
|
|
StandbyCLSServiceAccountName string
|
|
|
|
ServiceAccountNameToInstall string
|
2024-01-04 02:46:06 +00:00
|
|
|
EKSPolicyARN string
|
2021-11-22 07:34:48 +00:00
|
|
|
}
|
2022-01-25 01:33:33 +00:00
|
|
|
|
2023-07-31 02:25:48 +00:00
|
|
|
type VeleroCfgInPerf struct {
|
2023-11-07 06:25:13 +00:00
|
|
|
NFSServerPath string
|
|
|
|
TestCaseDescribe string
|
|
|
|
BackupForRestore string
|
|
|
|
DeleteClusterResource bool
|
2023-07-31 02:25:48 +00:00
|
|
|
}
|
|
|
|
|
2022-01-25 01:33:33 +00:00
|
|
|
type SnapshotCheckPoint struct {
|
|
|
|
NamespaceBackedUp string
|
2022-04-10 10:20:16 +00:00
|
|
|
// SnapshotIDList is for Azure CSI Verification
|
|
|
|
// we can get SnapshotID from VolumeSnapshotContent from a certain backup
|
|
|
|
SnapshotIDList []string
|
|
|
|
ExpectCount int
|
|
|
|
PodName []string
|
|
|
|
EnableCSI bool
|
2022-01-25 01:33:33 +00:00
|
|
|
}
|
2022-05-09 06:51:18 +00:00
|
|
|
|
|
|
|
type BackupConfig struct {
|
2023-01-30 03:58:41 +00:00
|
|
|
BackupName string
|
|
|
|
Namespace string
|
|
|
|
BackupLocation string
|
|
|
|
UseVolumeSnapshots bool
|
|
|
|
ProvideSnapshotsVolumeParam bool
|
|
|
|
Selector string
|
|
|
|
TTL time.Duration
|
|
|
|
IncludeResources string
|
|
|
|
ExcludeResources string
|
|
|
|
IncludeClusterResources bool
|
|
|
|
OrderedResources string
|
|
|
|
UseResticIfFSBackup bool
|
|
|
|
DefaultVolumesToFsBackup bool
|
2023-06-20 10:24:11 +00:00
|
|
|
SnapshotMoveData bool
|
2022-07-05 12:37:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type VeleroCLI2Version struct {
|
|
|
|
VeleroVersion string
|
|
|
|
VeleroCLI string
|
2022-05-09 06:51:18 +00:00
|
|
|
}
|