From eedba9a9f39f3bd2ae53077132eddc0474d2da2f Mon Sep 17 00:00:00 2001 From: z4yx Date: Mon, 9 Mar 2020 20:28:56 +0800 Subject: [PATCH] fix tests --- docs/zh_CN/workers.conf | 2 ++ worker/provider_test.go | 13 +++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/zh_CN/workers.conf b/docs/zh_CN/workers.conf index 1f2cdda..5f04a6a 100644 --- a/docs/zh_CN/workers.conf +++ b/docs/zh_CN/workers.conf @@ -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]] @@ -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 \ No newline at end of file diff --git a/worker/provider_test.go b/worker/provider_test.go index 98062a6..91b221d 100644 --- a/worker/provider_test.go +++ b/worker/provider_test.go @@ -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, } @@ -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(), ), ) @@ -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(), ), ) @@ -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(), )