@@ -19,7 +19,7 @@ package test
19
19
import (
20
20
"context"
21
21
"fmt"
22
- "math/rand"
22
+ "math/rand/v2 "
23
23
"strings"
24
24
"time"
25
25
@@ -105,8 +105,7 @@ func (t *TestCase) Init() error {
105
105
}
106
106
107
107
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 ))
110
109
}
111
110
112
111
func (t * TestCase ) CreateResources () error {
@@ -168,21 +167,32 @@ func (t *TestCase) Verify() error {
168
167
func (t * TestCase ) Start () error {
169
168
t .Ctx , t .CtxCancel = context .WithTimeout (context .Background (), 1 * time .Hour )
170
169
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" ) {
172
173
Skip ("Skip due to issue https://github.com/kubernetes/kubernetes/issues/114384 on AKS" )
173
174
}
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
+ }
174
180
return nil
175
181
}
176
182
177
183
func (t * TestCase ) Clean () error {
178
184
veleroCfg := t .GetTestCase ().VeleroCfg
179
185
if ! veleroCfg .Debug {
180
186
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
+ }
182
190
})
183
191
By ("Clean backups after test" , func () {
184
192
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
+ }
186
196
})
187
197
}
188
198
return nil
0 commit comments