2
2
mirror of https://github.com/octoleo/restic.git synced 2024-09-28 06:29:01 +00:00

s3: Use random prefix for tests

This commit is contained in:
Alexander Neumann 2017-05-11 22:48:46 +02:00
parent db4fa48f66
commit 59d1986660

View File

@ -5,6 +5,7 @@ import (
"crypto/rand"
"encoding/hex"
"errors"
"fmt"
"io"
"net"
"os"
@ -125,6 +126,7 @@ func TestBackendMinio(t *testing.T) {
cfg.Config = s3.Config{
Endpoint: "localhost:9000",
Bucket: "restictestbucket",
Prefix: fmt.Sprintf("test-%d", time.Now().UnixNano()),
UseHTTP: true,
KeyID: key,
Secret: secret,
@ -204,6 +206,7 @@ func TestBackendS3(t *testing.T) {
cfg := s3cfg.(s3.Config)
cfg.KeyID = os.Getenv("RESTIC_TEST_S3_KEY")
cfg.Secret = os.Getenv("RESTIC_TEST_S3_SECRET")
cfg.Prefix = fmt.Sprintf("test-%d", time.Now().UnixNano())
return cfg, nil
},