Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit bf0174d

Browse files
committed
Some build updates and test changes
1 parent 9973e59 commit bf0174d

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

test/config/fail.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ http:
33
cloudflarewarp:
44
plugin:
55
cloudflarewarp:
6-
disableDefault: false
6+
disableDefault: true

test/config/success.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ http:
33
cloudflarewarp:
44
plugin:
55
cloudflarewarp:
6+
disableDefault: false
67
trustip:
78
- 10.0.0.0/8
89
- 172.0.0.0/8

test/test-base.sh

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ cp "./config/${1}.${2}" "./tempconfig/config.${2}"
2222
chmod -R 7777 ./logs;
2323
chmod -R 7777 ./tempconfig;
2424

25+
sleep 2s;
26+
2527
if [ "${3}" = "stack" ]; then
2628
docker stack deploy -c docker-stack.yml test-instance;
2729
sleep 1s;
@@ -52,6 +54,7 @@ while ! grep -q "Propagating new UP status" "./logs/debug.log" && [ $iterations
5254
done
5355

5456
curl -H "CF-Connecting-IP:${4}" -H "CF-Visitor:{\"scheme\":\"https\"}" http://localhost:4008/ >> ./logs/output.log;
57+
echo "Headers:\nCF-Connecting-IP:${4}\nCF-Visitor:{\"scheme\":\"https\"}" >> ./logs/request.log
5558
cat ./logs/output.log;
5659

5760
if [ "${3}" = "stack" ] ; then

test/test-verify.sh

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
SUCCESS_CONFIG_FILE="./logs-success-${1}/output.log"
22
FAIL_CONFIG_FILE="./logs-fail-${1}/output.log"
33

4-
echo "RUNNING TESTS FOR ${1}";
4+
echo "RUNNING TESTS FOR ${1}"
5+
echo " - Succ $SUCCESS_CONFIG_FILE"
6+
echo " - Fail $FAIL_CONFIG_FILE"
7+
8+
sleep 1s
59

610
if ! grep -q "X-Is-Trusted: yes" $SUCCESS_CONFIG_FILE; then
7-
echo "X-Is-Trusted header was not added and parsed"
11+
echo "'X-Is-Trusted: yes' header was not added and parsed ($SUCCESS_CONFIG_FILE)"
812
exit 5
913
fi
1014
if ! grep -q "X-Forwarded-For: ${2}" $SUCCESS_CONFIG_FILE; then
11-
echo "IP header not defined"
15+
echo "'X-Forwarded-For: ${2}' header not defined ($SUCCESS_CONFIG_FILE)"
1216
exit 5
1317
fi
1418
#if ! grep -q "X-Real-Ip: 10.0.0.2" $SUCCESS_CONFIG_FILE; then
1519
# echo "IP real not defined"
1620
# exit 5
1721
#fi
1822
if ! grep -q "Cf-Visitor: {\"scheme\":\"https\"}" $SUCCESS_CONFIG_FILE; then
19-
echo "Schema header not defined"
23+
echo "'Cf-Visitor: {\"scheme\":\"https\"}' header not defined ($SUCCESS_CONFIG_FILE)"
2024
exit 5
2125
fi
2226

2327
if ! grep -q "X-Is-Trusted: no" $FAIL_CONFIG_FILE; then
24-
echo "X-Is-Trusted header was not added to the invalid request"
28+
echo "'X-Is-Trusted: no' header was not added to the invalid request ($FAIL_CONFIG_FILE)"
2529
exit 5
2630
fi
2731
#if ! grep -q "X-Forwarded-For: 10.0.0.2" $FAIL_CONFIG_FILE; then

0 commit comments

Comments
 (0)