Skip to content

Commit 2fc6300

Browse files
authored
Merge pull request #7860 from blackpiglet/update_e2e_for_1_14
Skip parallel files upload and download test for Restic case
2 parents 0d36572 + 200f16e commit 2fc6300

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

test/e2e/test/test.go

+16-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package test
1919
import (
2020
"context"
2121
"fmt"
22-
"math/rand"
22+
"math/rand/v2"
2323
"strings"
2424
"time"
2525

@@ -105,8 +105,7 @@ func (t *TestCase) Init() error {
105105
}
106106

107107
func (t *TestCase) GenerateUUID() string {
108-
rand.Seed(time.Now().UnixNano())
109-
return fmt.Sprintf("%08d", rand.Intn(100000000))
108+
return fmt.Sprintf("%08d", rand.IntN(100000000))
110109
}
111110

112111
func (t *TestCase) CreateResources() error {
@@ -168,21 +167,32 @@ func (t *TestCase) Verify() error {
168167
func (t *TestCase) Start() error {
169168
t.Ctx, t.CtxCancel = context.WithTimeout(context.Background(), 1*time.Hour)
170169
veleroCfg := t.GetTestCase().VeleroCfg
171-
if (veleroCfg.CloudProvider == Azure || veleroCfg.CloudProvider == AWS) && strings.Contains(t.GetTestCase().CaseBaseName, "nodeport") {
170+
171+
if (veleroCfg.CloudProvider == Azure || veleroCfg.CloudProvider == AWS) &&
172+
strings.Contains(t.GetTestCase().CaseBaseName, "nodeport") {
172173
Skip("Skip due to issue https://github.com/kubernetes/kubernetes/issues/114384 on AKS")
173174
}
175+
176+
if veleroCfg.UploaderType == UploaderTypeRestic &&
177+
strings.Contains(t.GetTestCase().CaseBaseName, "ParallelFiles") {
178+
Skip("Skip Parallel Files upload and download test cases for environments using Restic as uploader.")
179+
}
174180
return nil
175181
}
176182

177183
func (t *TestCase) Clean() error {
178184
veleroCfg := t.GetTestCase().VeleroCfg
179185
if !veleroCfg.Debug {
180186
By(fmt.Sprintf("Clean namespace with prefix %s after test", t.CaseBaseName), func() {
181-
CleanupNamespaces(t.Ctx, t.Client, t.CaseBaseName)
187+
if err := CleanupNamespaces(t.Ctx, t.Client, t.CaseBaseName); err != nil {
188+
fmt.Println("Fail to cleanup namespaces: ", err)
189+
}
182190
})
183191
By("Clean backups after test", func() {
184192
veleroCfg.ClientToInstallVelero = &t.Client
185-
DeleteAllBackups(t.Ctx, &veleroCfg)
193+
if err := DeleteAllBackups(t.Ctx, &veleroCfg); err != nil {
194+
fmt.Println("Fail to clean backups after test: ", err)
195+
}
186196
})
187197
}
188198
return nil

test/types.go

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const AWS = "aws"
3838
const Gcp = "gcp"
3939
const Vsphere = "vsphere"
4040

41+
const UploaderTypeRestic = "restic"
42+
4143
var PublicCloudProviders = []string{AWS, Azure, Gcp, Vsphere}
4244
var LocalCloudProviders = []string{Kind, VanillaZFS}
4345
var CloudProviders = append(PublicCloudProviders, LocalCloudProviders...)

0 commit comments

Comments
 (0)