diff options
author | Jakob Borg <jakob@nym.se> | 2014-09-02 12:04:54 +0200 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-09-02 12:10:18 +0200 |
commit | 1a6ac4aeb1ce774715456cf8c249559086497e07 (patch) | |
tree | 5c5f32a3c410825cf56192191728e448c87ee9a8 | |
parent | f633bdddf0c5ffbfe954b2d409fd121051c80eb7 (diff) | |
download | syncthing-1a6ac4aeb1ce774715456cf8c249559086497e07.tar.gz syncthing-1a6ac4aeb1ce774715456cf8c249559086497e07.zip |
Integration tests should use v4 localhost
-rw-r--r-- | integration/common_test.go | 2 | ||||
-rwxr-xr-x | integration/test-delupd.sh | 10 | ||||
-rwxr-xr-x | integration/test-folders.sh | 6 | ||||
-rwxr-xr-x | integration/test-http.sh | 16 | ||||
-rwxr-xr-x | integration/test-merge.sh | 8 |
5 files changed, 21 insertions, 21 deletions
diff --git a/integration/common_test.go b/integration/common_test.go index c251017a3..0b7244e00 100644 --- a/integration/common_test.go +++ b/integration/common_test.go @@ -59,7 +59,7 @@ func (p *syncthingProcess) stop() { } func (p *syncthingProcess) peerCompletion() (map[string]int, error) { - resp, err := http.Get(fmt.Sprintf("http://localhost:%d/rest/debug/peerCompletion", p.port)) + resp, err := http.Get(fmt.Sprintf("http://127.0.0.1:%d/rest/debug/peerCompletion", p.port)) if err != nil { return nil, err } diff --git a/integration/test-delupd.sh b/integration/test-delupd.sh index 957352e5a..d24954e07 100755 --- a/integration/test-delupd.sh +++ b/integration/test-delupd.sh @@ -23,7 +23,7 @@ start() { stop() { for i in 1 2 3 ; do - curl -HX-API-Key:abc123 -X POST "http://localhost:808$i/rest/shutdown" + curl -HX-API-Key:abc123 -X POST "http://127.0.0.1:808$i/rest/shutdown" done exit $1 } @@ -31,9 +31,9 @@ stop() { testConvergence() { while true ; do sleep 5 - s1comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8082/rest/debug/peerCompletion" | ./json "$id1") - s2comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8083/rest/debug/peerCompletion" | ./json "$id2") - s3comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8081/rest/debug/peerCompletion" | ./json "$id3") + s1comp=$(curl -HX-API-Key:abc123 -s "http://127.0.0.1:8082/rest/debug/peerCompletion" | ./json "$id1") + s2comp=$(curl -HX-API-Key:abc123 -s "http://127.0.0.1:8083/rest/debug/peerCompletion" | ./json "$id2") + s3comp=$(curl -HX-API-Key:abc123 -s "http://127.0.0.1:8081/rest/debug/peerCompletion" | ./json "$id3") s1comp=${s1comp:-0} s2comp=${s2comp:-0} s3comp=${s3comp:-0} @@ -119,7 +119,7 @@ alterFiles() { pkill -CONT syncthing echo "Restarting instance 2" - curl -HX-API-Key:abc123 -X POST "http://localhost:8082/rest/restart" + curl -HX-API-Key:abc123 -X POST "http://127.0.0.1:8082/rest/restart" } rm -rf h?/*.idx.gz h?/index diff --git a/integration/test-folders.sh b/integration/test-folders.sh index 2ff26fcc3..1c0de574b 100755 --- a/integration/test-folders.sh +++ b/integration/test-folders.sh @@ -21,7 +21,7 @@ start() { stop() { echo "Stopping..." for i in 1 2 ; do - curl -HX-API-Key:abc123 -X POST "http://localhost:808$i/rest/shutdown" + curl -HX-API-Key:abc123 -X POST "http://127.0.0.1:808$i/rest/shutdown" done } @@ -46,8 +46,8 @@ setup() { testConvergence() { while true ; do sleep 5 - s1comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8082/rest/debug/peerCompletion" | ./json "$id1") - s2comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8081/rest/debug/peerCompletion" | ./json "$id2") + s1comp=$(curl -HX-API-Key:abc123 -s "http://127.0.0.1:8082/rest/debug/peerCompletion" | ./json "$id1") + s2comp=$(curl -HX-API-Key:abc123 -s "http://127.0.0.1:8081/rest/debug/peerCompletion" | ./json "$id2") s1comp=${s1comp:-0} s2comp=${s2comp:-0} tot=$(($s1comp + $s2comp)) diff --git a/integration/test-http.sh b/integration/test-http.sh index 20095667b..ef38719cd 100755 --- a/integration/test-http.sh +++ b/integration/test-http.sh @@ -10,8 +10,8 @@ id3=373HSRP-QLPNLIE-JYKZVQF-P4PKZ63-R2ZE6K3-YD442U2-JHBGBQG-WWXAHAU stop() { echo Stopping - curl -s -o/dev/null -HX-API-Key:abc123 -X POST http://localhost:8081/rest/shutdown - curl -s -o/dev/null -HX-API-Key:abc123 -X POST http://localhost:8082/rest/shutdown + curl -s -o/dev/null -HX-API-Key:abc123 -X POST http://127.0.0.1:8081/rest/shutdown + curl -s -o/dev/null -HX-API-Key:abc123 -X POST http://127.0.0.1:8082/rest/shutdown exit $1 } @@ -26,14 +26,14 @@ syncthing -home h2 > 2.out 2>&1 & sleep 1 echo Fetching CSRF tokens -curl -s -o /dev/null http://testuser:testpass@localhost:8081/index.html -curl -s -o /dev/null http://localhost:8082/index.html +curl -s -o /dev/null http://testuser:testpass@127.0.0.1:8081/index.html +curl -s -o /dev/null http://127.0.0.1:8082/index.html sleep 1 echo Testing -./http -target localhost:8081 -user testuser -pass testpass -csrf h1/csrftokens.txt || stop 1 -./http -target localhost:8081 -api abc123 || stop 1 -./http -target localhost:8082 -csrf h2/csrftokens.txt || stop 1 -./http -target localhost:8082 -api abc123 || stop 1 +./http -target 127.0.0.1:8081 -user testuser -pass testpass -csrf h1/csrftokens.txt || stop 1 +./http -target 127.0.0.1:8081 -api abc123 || stop 1 +./http -target 127.0.0.1:8082 -csrf h2/csrftokens.txt || stop 1 +./http -target 127.0.0.1:8082 -api abc123 || stop 1 stop 0 diff --git a/integration/test-merge.sh b/integration/test-merge.sh index e5c0b17ce..629d8c2f7 100755 --- a/integration/test-merge.sh +++ b/integration/test-merge.sh @@ -23,7 +23,7 @@ start() { stop() { for i in 1 2 3 4 ; do - curl -HX-API-Key:abc123 -X POST "http://localhost:808$i/rest/shutdown" + curl -HX-API-Key:abc123 -X POST "http://127.0.0.1:808$i/rest/shutdown" done exit $1 } @@ -40,9 +40,9 @@ clean() { testConvergence() { while true ; do sleep 5 - s1comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8082/rest/debug/peerCompletion" | ./json "$id1") - s2comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8083/rest/debug/peerCompletion" | ./json "$id2") - s3comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8081/rest/debug/peerCompletion" | ./json "$id3") + s1comp=$(curl -HX-API-Key:abc123 -s "http://127.0.0.1:8082/rest/debug/peerCompletion" | ./json "$id1") + s2comp=$(curl -HX-API-Key:abc123 -s "http://127.0.0.1:8083/rest/debug/peerCompletion" | ./json "$id2") + s3comp=$(curl -HX-API-Key:abc123 -s "http://127.0.0.1:8081/rest/debug/peerCompletion" | ./json "$id3") s1comp=${s1comp:-0} s2comp=${s2comp:-0} s3comp=${s3comp:-0} |