diff --git a/.travis.yml b/.travis.yml index 9994238..6cb7332 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - docker run -dt -p 80 --name web2 nginx:${NGINX_CONTAINER_VERSION:-latest} install: - - sudo apt-get install -y sshpass jq cpanminus libwww-perl liblwp-protocol-https-perl libjson-perl strace + - sudo apt-get install -y sshpass jq cpanminus libwww-perl liblwp-protocol-https-perl libjson-perl strace perltidy - sudo cpanm Monitoring::Plugin - git clone https://github.com/bats-core/bats-core.git bats-core @@ -24,5 +24,6 @@ script: - export WEB02_IP=$(docker inspect web2 | jq -r .[0].NetworkSettings.IPAddress) - sed -i "s/WEB01_IP/${WEB01_IP}/g" tests/ns.conf - sed -i "s/WEB02_IP/${WEB02_IP}/g" tests/ns.conf + - tests/lint.sh - tests/travis_prepare.sh - bats-core/bin/bats tests/bats diff --git a/tests/lint.sh b/tests/lint.sh new file mode 100755 index 0000000..5b22439 --- /dev/null +++ b/tests/lint.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +LINT_FILE=$(mktemp) + +perltidy check_netscaler.pl > ${LINT_FILE} +diff check_netscaler.pl ${LINT_FILE} + +echo + +if [ "${?}" -eq 0 ]; then + echo "OK: perltidy lint ok" + exit 0 +else + echo "ERROR: please run perltidy, changes found" + exit 1 +fi