aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-09-02 12:04:54 +0200
committerJakob Borg <jakob@nym.se>2014-09-02 12:10:18 +0200
commit1a6ac4aeb1ce774715456cf8c249559086497e07 (patch)
tree5c5f32a3c410825cf56192191728e448c87ee9a8
parentf633bdddf0c5ffbfe954b2d409fd121051c80eb7 (diff)
downloadsyncthing-1a6ac4aeb1ce774715456cf8c249559086497e07.tar.gz
syncthing-1a6ac4aeb1ce774715456cf8c249559086497e07.zip
Integration tests should use v4 localhost
-rw-r--r--integration/common_test.go2
-rwxr-xr-xintegration/test-delupd.sh10
-rwxr-xr-xintegration/test-folders.sh6
-rwxr-xr-xintegration/test-http.sh16
-rwxr-xr-xintegration/test-merge.sh8
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}