Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
z4yx committed Mar 9, 2020
1 parent 41088c7 commit eedba9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 2 additions & 0 deletions docs/zh_CN/workers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ docker_image = "tunathu/tunasync-scripts:latest"
name = "gnu"
provider = "rsync"
upstream = "rsync://mirrors.ocf.berkeley.edu/gnu/"
rsync_options = [ "--delete-excluded" ]
memory_limit = "256M"

[[mirrors]]
Expand Down Expand Up @@ -72,6 +73,7 @@ name = "ubuntu"
provider = "two-stage-rsync"
stage1_profile = "debian"
upstream = "rsync://archive.ubuntu.com/ubuntu/"
rsync_options = [ "--delete-excluded" ]
memory_limit = "256M"

# vim: ft=toml
13 changes: 5 additions & 8 deletions worker/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func TestRsyncProviderWithAuthentication(t *testing.T) {
extraOptions: []string{"--delete-excluded"},
logDir: tmpDir,
logFile: tmpFile,
useIPv6: true,
useIPv4: true,
interval: 600 * time.Second,
}

Expand Down Expand Up @@ -158,7 +158,7 @@ exit 0
fmt.Sprintf(
"%s %s -aHvh --no-o --no-g --stats --exclude .~tmp~/ "+
"--delete --delete-after --delay-updates --safe-links "+
"--timeout=120 --contimeout=120 -6 %s %s --delete-excluded",
"--timeout=120 --contimeout=120 -4 --delete-excluded %s %s",
provider.username, provider.password, provider.upstreamURL, provider.WorkingDir(),
),
)
Expand Down Expand Up @@ -361,16 +361,14 @@ exit 0
fmt.Sprintf(
"-aHvh --no-o --no-g --stats --exclude .~tmp~/ --safe-links "+
"--timeout=120 --contimeout=120 --exclude dists/ -6 "+
"--exclude-from %s %s %s "+
"--delete-excluded --cache",
"--exclude-from %s --delete-excluded --cache %s %s",
provider.excludeFile, provider.upstreamURL, provider.WorkingDir(),
),
targetDir,
fmt.Sprintf(
"-aHvh --no-o --no-g --stats --exclude .~tmp~/ "+
"--delete --delete-after --delay-updates --safe-links "+
"--timeout=120 --contimeout=120 -6 --exclude-from %s %s %s "+
"--delete-excluded --cache",
"--timeout=120 --contimeout=120 -6 --exclude-from %s --delete-excluded --cache %s %s",
provider.excludeFile, provider.upstreamURL, provider.WorkingDir(),
),
)
Expand Down Expand Up @@ -402,8 +400,7 @@ exit 0
expectedOutput := fmt.Sprintf(
"-aHvh --no-o --no-g --stats --exclude .~tmp~/ --safe-links "+
"--timeout=120 --contimeout=120 --exclude dists/ -6 "+
"--exclude-from %s %s %s\n"+
"--delete-excluded --cache",
"--exclude-from %s --delete-excluded --cache %s %s\n",
provider.excludeFile, provider.upstreamURL, provider.WorkingDir(),
)

Expand Down

0 comments on commit eedba9a

Please sign in to comment.