File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,12 +37,17 @@ trigger:
3737 - success
3838
3939steps :
40- - name : base_node_test
40+ - name : base_php_test
4141 image : fabiodcorreia/base-php:test
42+ ports : [ 80 ]
43+ detach : true
4244 pull : always
4345 environment :
4446 PUID : " 1000"
4547 PGID : " 1000"
48+
49+ - name : test image
50+ image : python:2.7.18-alpine
4651 commands :
4752 - sleep 60
4853 - sh ./test/start.sh
Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ LABEL maintainer="fabiodcorreia"
88
99RUN \
1010 echo "**** install runtime packages ****" && \
11- apk add --no-cache nginx \
11+ apk add --no-cache \
12+ curl \
13+ nginx \
1214 php7 \
1315 php7-fileinfo \
1416 php7-fpm \
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ busybox-1.31.1-r19
77ca-certificates-20191127-r4
88ca-certificates-bundle-20191127-r4
99coreutils-8.32-r0
10+ curl-7.70.0-r2
1011libacl-2.2.53-r0
1112libattr-2.4.48-r0
1213libc-utils-0.7.2-r3
Original file line number Diff line number Diff line change 1+ import sys
2+ import os
3+ import mechanize
4+
5+ APP_TEST_PORT = "80"
6+
7+ assert len (sys .argv ) > 1 , "no arguments"
8+
9+ APP_TEST_URL = sys .argv [1 ]
10+
11+ print ("TEST_ULR=" + APP_TEST_URL )
12+
13+ br = mechanize .Browser ()
14+ br .set_handle_robots (False )
15+
16+ response = br .open (APP_TEST_URL )
17+ assert response .code == 200 , "response code is not 200"
18+ assert br .title == "PHP 7.3.19 - phpinfo()"
Original file line number Diff line number Diff line change 1+ mechanize
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- INDEX= ` curl -s localhost | grep " PHP 7.3.19 - phpinfo() " | wc -l `
3+ pip install -r ./test/requirements.txt
44
5- if [ $INDEX != 1 ]; then
6- echo " **** Index with PHP Info not found ****"
7- exit 1
8- fi
5+ IP=` ping base_php_test -c 1 -s 16 | grep -o ' ([^ ]*' | grep -m1 " " | grep -o ' ([^ ]*' | tr -d ' (:)' `
6+
7+ echo " base_php_test = $IP "
8+
9+ APP_TEST_URL=" http://$IP "
10+ APP_TEST_PORT=" 80"
11+
12+ python ./test/main.py $APP_TEST_URL $APP_TEST_PORT
You can’t perform that action at this time.
0 commit comments