Skip to content

Commit 172be37

Browse files
committedFeb 17, 2025··
Add more tests for CI
1 parent 04665cc commit 172be37

File tree

3 files changed

+1744
-0
lines changed

3 files changed

+1744
-0
lines changed
 

‎.github/nginx/docs/data50k.json

Lines changed: 1712 additions & 0 deletions
Large diffs are not rendered by default.

‎.github/nginx/docs/plugged.png

1.04 MB
Loading

‎.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
TEST_NGINX_BINARY=../objs/nginx prove modsecurity*.t
7373
- name: Start Nginx
7474
run: |
75+
sudo cp /home/runner/work/ModSecurity-nginx/ModSecurity-nginx/ModSecurity-nginx/.github/nginx/docs/* /usr/local/nginx/html/
7576
sudo /usr/local/nginx/sbin/nginx -c /home/runner/work/ModSecurity-nginx/ModSecurity-nginx/ModSecurity-nginx/.github/nginx/nginx.conf
7677
- name: Run attack test vhost 1
7778
run: |
@@ -109,6 +110,37 @@ jobs:
109110
echo "FAIL"
110111
exit 1
111112
fi
113+
- name: Run file consistency check 1
114+
run: |
115+
curl -sS "http://localhost/data50k.json" --output data50k.json
116+
if [ -f data50k.json ]; then
117+
diff data50k.json /usr/local/nginx/html/data50k.json > /dev/null
118+
if [ $? -eq 0 ]; then
119+
echo "OK"
120+
else
121+
echo "FAIL"
122+
exit 2
123+
fi
124+
else
125+
echo "FAIL"
126+
exit 1
127+
fi
128+
- name: Run file consistency check 2
129+
run: |
130+
curl -sS "http://localhost/plugged.png" --output plugged.png
131+
if [ -f plugged.png ]; then
132+
diff plugged.png /usr/local/nginx/html/plugged.png > /dev/null
133+
if [ $? -eq 0 ]; then
134+
echo "OK"
135+
else
136+
echo "FAIL"
137+
exit 2
138+
fi
139+
else
140+
echo "FAIL"
141+
exit 1
142+
fi
143+
112144
113145
build-windows:
114146
runs-on: windows-2022

0 commit comments

Comments
 (0)
Please sign in to comment.