Skip to content

Commit f3aaaa8

Browse files
committed
Update test enviroment setup
For phpIPAM version 1.7.0 and above we need to set `api_stringify_results` to `true` to get stringified results from API.
1 parent 030257a commit f3aaaa8

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ install-deps:
9393

9494
setup-phpipam: test-setup
9595
docker-compose -f tests/docker/docker-compose.yml up -d
96-
sh tests/docker/setup_database.sh
96+
sh tests/docker/setup_phpipam.sh
9797

9898
FORCE:
9999

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
exec 10>&1
44
exec > /dev/null 2>&1
55

6+
# split version number into semvar parts
7+
read -r MAJOR MINOR PATCH <<<$(echo ${PHPIPAM_VERSION#v} | tr . " ")
8+
69
function info() {
710
echo "${@}" >&10
811
}
@@ -16,6 +19,11 @@ fi
1619

1720
if "${DOCKER_CMD}" ps | grep -q phpipam_test_webserver && ! eval "${MYSQL_PING}" ; then
1821

22+
if [[ ${MINOR} -ge 7 ]] ; then
23+
info "Running version 1.7.0 or above, patching config"
24+
${DOCKER_CMD} exec -t phpipam_test_webserver sh -c 'sed -i "s/api_stringify_results = false/api_stringify_results = true/g" /phpipam/config.dist.php'
25+
fi
26+
1927
info -n "Waiting for database connection "
2028
while ! eval "${MYSQL_PING}" ; do
2129
info -n "."
@@ -44,8 +52,8 @@ if [[ $(mysqlshow -u root -prootpw -h 127.0.0.1 -P 3306 phpipam 2>/dev/null | wc
4452

4553
else
4654

47-
info "Detabase already initiated" && exit 0
55+
info "Database already initiated" && exit 0
4856

4957
fi
5058

51-
info "Database initialisation $result"
59+
info "Database initialization $result"

0 commit comments

Comments
 (0)