diff --git a/changelogs/unreleased/10524-krishhna24 b/changelogs/unreleased/10524-krishhna24 new file mode 100644 index 000000000..02943adfa --- /dev/null +++ b/changelogs/unreleased/10524-krishhna24 @@ -0,0 +1 @@ +Use the Kind constant instead of the kind string literal in the e2e tests diff --git a/test/e2e/backups/deletion.go b/test/e2e/backups/deletion.go index a9ee3ce5f..e96433d1a 100644 --- a/test/e2e/backups/deletion.go +++ b/test/e2e/backups/deletion.go @@ -88,8 +88,8 @@ func runBackupDeletionTests(client TestClient, veleroCfg VeleroConfig, backupLoc nsCount := len(workloadNamespaceList) workloadNamespaces := strings.Join(workloadNamespaceList[:], ",") - if useVolumeSnapshots && veleroCfg.CloudProvider == "kind" { - Skip("Volume snapshots not supported on kind") + if useVolumeSnapshots && veleroCfg.CloudProvider == Kind { + Skip(fmt.Sprintf("Volume snapshots not supported on %s", Kind)) } oneHourTimeout, ctxCancel := context.WithTimeout(context.Background(), time.Minute*60) defer ctxCancel() diff --git a/test/e2e/basic/namespace-mapping.go b/test/e2e/basic/namespace-mapping.go index a5a0cc1be..59e3c0939 100644 --- a/test/e2e/basic/namespace-mapping.go +++ b/test/e2e/basic/namespace-mapping.go @@ -8,6 +8,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/vmware-tanzu/velero/test" . "github.com/vmware-tanzu/velero/test/e2e/test" . "github.com/vmware-tanzu/velero/test/util/k8s" . "github.com/vmware-tanzu/velero/test/util/kibishii" @@ -34,7 +35,7 @@ func (n *NamespaceMapping) Init() error { n.VeleroCfg.UseVolumeSnapshots = n.UseVolumeSnapshots n.VeleroCfg.UseNodeAgent = !n.UseVolumeSnapshots n.kibishiiData = &KibishiiData{Levels: 2, DirsPerLevel: 10, FilesPerLevel: 10, FileLength: 1024, BlockSize: 1024, PassNum: 0, ExpectedNodes: 2} - if n.VeleroCfg.CloudProvider == "kind" { + if n.VeleroCfg.CloudProvider == test.Kind { n.kibishiiData = &KibishiiData{Levels: 0, DirsPerLevel: 0, FilesPerLevel: 0, FileLength: 0, BlockSize: 0, PassNum: 0, ExpectedNodes: 2} } backupType := "fs-backup" @@ -70,7 +71,7 @@ func (n *NamespaceMapping) Init() error { "create", "--namespace", n.VeleroCfg.VeleroNamespace, "backup", n.BackupName, "--include-namespaces", strings.Join(*n.NSIncluded, ","), "--wait", } - if n.VeleroCfg.CloudProvider == "kind" { + if n.VeleroCfg.CloudProvider == test.Kind { // don't test volume snapshotter or file system backup on kind n.BackupArgs = append(n.BackupArgs, "--snapshot-volumes=false") n.UseVolumeSnapshots = false