diff --git a/integration/common_test.go b/integration/common_test.go index c251017a..0b7244e0 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 957352e5..d24954e0 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 2ff26fcc..1c0de574 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 20095667..ef38719c 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 e5c0b17c..629d8c2f 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}