mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 09:05:59 +08:00
fstest: make RandomRemoteName shorter
Use 12 random characters instead of 24, to avoid trouble on the bisync tests
This commit is contained in:
parent
9c287c72d6
commit
3ae4534ce6
|
@ -48,7 +48,7 @@ var (
|
|||
// ListRetries is the number of times to retry a listing to overcome eventual consistency
|
||||
ListRetries = flag.Int("list-retries", 3, "Number or times to retry listing")
|
||||
// MatchTestRemote matches the remote names used for testing
|
||||
MatchTestRemote = regexp.MustCompile(`^rclone-test-[abcdefghijklmnopqrstuvwxyz0123456789]{24}$`)
|
||||
MatchTestRemote = regexp.MustCompile(`^rclone-test-[abcdefghijklmnopqrstuvwxyz0123456789]{12}$`)
|
||||
)
|
||||
|
||||
// Initialise rclone for testing
|
||||
|
@ -266,7 +266,7 @@ func CheckListingWithRoot(t *testing.T, f fs.Fs, dir string, items []Item, expec
|
|||
var objs []fs.Object
|
||||
var dirs []fs.Directory
|
||||
var err error
|
||||
var retries = *ListRetries
|
||||
retries := *ListRetries
|
||||
sleep := time.Second / 2
|
||||
wantListing := makeListingFromItems(items)
|
||||
gotListing := "<unset>"
|
||||
|
@ -431,7 +431,7 @@ func RandomRemoteName(remoteName string) (string, string, error) {
|
|||
if !strings.HasSuffix(remoteName, ":") {
|
||||
remoteName += "/"
|
||||
}
|
||||
leafName = "rclone-test-" + random.String(24)
|
||||
leafName = "rclone-test-" + random.String(12)
|
||||
if !MatchTestRemote.MatchString(leafName) {
|
||||
log.Fatalf("%q didn't match the test remote name regexp", leafName)
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
// MatchTestRemote matches the remote names used for testing (copied
|
||||
// from fstest/fstest.go so we don't have to import that and get all
|
||||
// its flags)
|
||||
var MatchTestRemote = regexp.MustCompile(`^rclone-test-[abcdefghijklmnopqrstuvwxyz0123456789]{24}(_segments)?$`)
|
||||
var MatchTestRemote = regexp.MustCompile(`^rclone-test-[abcdefghijklmnopqrstuvwxyz0123456789]{12,24}(_segments)?$`)
|
||||
|
||||
// cleanFs runs a single clean fs for left over directories
|
||||
func cleanFs(ctx context.Context, remote string, cleanup bool) error {
|
||||
|
|
Loading…
Reference in New Issue
Block a user