File tree Expand file tree Collapse file tree 4 files changed +10
-19
lines changed Expand file tree Collapse file tree 4 files changed +10
-19
lines changed Original file line number Diff line number Diff line change
1
+ .env *
2
+ ! .env.dist
Original file line number Diff line number Diff line change @@ -27,18 +27,10 @@ docker-test: test
27
27
test : run-test cleanup-test
28
28
29
29
run-test :
30
- TEST_ADDR=" ${TEST_ADDR} " \
31
- IMAGE_TAG=" ${IMAGE_TAG} " \
32
- DMARC_SRG_UI_PASSWORD=" public" \
33
- # Random port maybe free ?
34
- DMARC_SRG_HTTP_ADDRESS=" 8912" \
35
- docker-compose -f docker-compose-latest.test.yml up --exit-code-from=sut --abort-on-container-exit
30
+ IMAGE_TAG=" $( IMAGE_TAG) " \
31
+ docker compose -f docker-compose-latest.test.yml up --exit-code-from=sut --abort-on-container-exit
36
32
37
33
cleanup-test :
38
34
@echo " Stopping and removing the container"
39
- TEST_ADDR=" ${TEST_ADDR} " \
40
- IMAGE_TAG=" ${IMAGE_TAG} " \
41
- DMARC_SRG_UI_PASSWORD=" public" \
42
- # Random port maybe free ?
43
- DMARC_SRG_HTTP_ADDRESS=" 8912" \
44
- docker-compose -f docker-compose-latest.test.yml down
35
+ IMAGE_TAG=" $( IMAGE_TAG) " \
36
+ docker compose -f docker-compose-latest.test.yml down
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ services:
5
5
container_name : test-bench
6
6
image : ${IMAGE_TAG}
7
7
environment :
8
- TEST_ADDR : ${TEST_ADDR}
8
+ TEST_ADDR : dmarc-srg
9
9
volumes :
10
10
- ./test.sh:/test.sh:ro
11
11
entrypoint : ["/test.sh"]
@@ -16,6 +16,7 @@ services:
16
16
dmarc-srg :
17
17
image : ${IMAGE_TAG}
18
18
container_name : dmarc-srg
19
+ user : application
19
20
healthcheck :
20
21
test :
21
22
[
@@ -36,7 +37,5 @@ services:
36
37
IMAP_HOST : $DMARC_SRG_IMAP_HOST
37
38
IMAP_USER : $DMARC_SRG_IMAP_USER
38
39
IMAP_PASSWORD : $DMARC_SRG_IMAP_PASSWORD
39
- UI_PASSWORD : $DMARC_SRG_UI_PASSWORD
40
- ports :
41
- - ${DMARC_SRG_HTTP_ADDRESS:-8082}:80
40
+ UI_PASSWORD : public
42
41
restart : on-failure:2
Original file line number Diff line number Diff line change @@ -8,15 +8,13 @@ checkUrl() {
8
8
set +e
9
9
if [ " ${2:- } " = " form" ]; then
10
10
curl -# --cookie-jar /tmp/test.cookie-jar -b /tmp/test.cookie-jar --show-error --fail-with-body \
11
- -s \
12
11
-H ' Accept: application/json' \
13
12
-H ' Content-Type: application/json' \
14
13
-L \
15
14
--data-raw " ${3} " \
16
15
" $1 "
17
16
else
18
17
curl -# --cookie-jar /tmp/test.cookie-jar -b /tmp/test.cookie-jar --show-error --fail-with-body \
19
- -s \
20
18
${2:- } \
21
19
-H ' Content-Type: application/json' \
22
20
" $1 "
@@ -40,7 +38,7 @@ checkUrl "http://${TEST_ADDR}/robots.txt" -I
40
38
checkUrl " http://${TEST_ADDR} /css/main.css" -I | grep -F " Cache-Control: max-age=86400"
41
39
42
40
checkUrl " http://${TEST_ADDR} /index.php" | grep -q -F " DMARC Reports"
43
- checkUrl " http://${TEST_ADDR} /login.php" " form" " {" password" :" public" }" | grep -q -F " Successfully logged into server. "
41
+ checkUrl " http://${TEST_ADDR} /login.php" " form" ' {"password":"public"}' | grep -q -F " Authentication succeeded "
44
42
45
43
if [ $DID_FAIL -gt 0 ]; then
46
44
echo " Some URLs failed"
You can’t perform that action at this time.
0 commit comments