Skip to content

Commit a2b6207

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 a936b3e commit a2b6207

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/docker/setup_phpipam.sh

Lines changed: 4 additions & 0 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
}
@@ -17,6 +20,7 @@ fi
1720
if "${DOCKER_CMD}" ps | grep -q phpipam_test_webserver && ! eval "${MYSQL_PING}" ; then
1821

1922
if [[ $(echo "${PHPIPAM_VERSION:-v1.4.4}" | sed -E 's/v[0-9]?.([0-9]?).[0-9]?/\1/g') -ge 7 ]] ; then
23+
if [[ ${MINOR} -ge 7 ]] ; then
2024
info "Running version 1.7.0 or above, patching config"
2125
${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'
2226
fi

0 commit comments

Comments
 (0)