mirror of
https://github.com/restic/restic.git
synced 2024-12-23 08:16:36 +00:00
s3: Use random prefix for tests
This commit is contained in:
parent
db4fa48f66
commit
59d1986660
1 changed files with 3 additions and 0 deletions
|
@ -5,6 +5,7 @@ import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
@ -125,6 +126,7 @@ func TestBackendMinio(t *testing.T) {
|
||||||
cfg.Config = s3.Config{
|
cfg.Config = s3.Config{
|
||||||
Endpoint: "localhost:9000",
|
Endpoint: "localhost:9000",
|
||||||
Bucket: "restictestbucket",
|
Bucket: "restictestbucket",
|
||||||
|
Prefix: fmt.Sprintf("test-%d", time.Now().UnixNano()),
|
||||||
UseHTTP: true,
|
UseHTTP: true,
|
||||||
KeyID: key,
|
KeyID: key,
|
||||||
Secret: secret,
|
Secret: secret,
|
||||||
|
@ -204,6 +206,7 @@ func TestBackendS3(t *testing.T) {
|
||||||
cfg := s3cfg.(s3.Config)
|
cfg := s3cfg.(s3.Config)
|
||||||
cfg.KeyID = os.Getenv("RESTIC_TEST_S3_KEY")
|
cfg.KeyID = os.Getenv("RESTIC_TEST_S3_KEY")
|
||||||
cfg.Secret = os.Getenv("RESTIC_TEST_S3_SECRET")
|
cfg.Secret = os.Getenv("RESTIC_TEST_S3_SECRET")
|
||||||
|
cfg.Prefix = fmt.Sprintf("test-%d", time.Now().UnixNano())
|
||||||
return cfg, nil
|
return cfg, nil
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue