Case: run without DNS propagation

This commit is contained in:
Ivan Ilves 2017-05-24 23:09:27 +02:00
parent f49ad97aab
commit 20d6d7b179
3 changed files with 26 additions and 1 deletions

View File

@ -22,6 +22,7 @@ script:
- testing/run_integration_case.sh do_client_teardown
- testing/run_integration_case.sh do_server_teardown
- testing/run_integration_case.sh run_with_dns_propagation
- testing/run_integration_case.sh run_without_dns_propagation
branches:
only:

View File

@ -0,0 +1,18 @@
INIT_DELAY=20
DOWN_DELAY=20
ORIG_RESOLV_CONF=$(cat /etc/resolv.conf)
warn "${ORIG_RESOLV_CONF}"
${XIRI_EXE} -f 1 -X -R -D ${SSH_USER}@${REMOTE_IP} 10.245.245.245/32 &
XIRI_PID=${!}; sleep ${INIT_DELAY}
NEW_RESOLV_CONF=$(cat /etc/resolv.conf)
warn "${NEW_RESOLV_CONF}"
if [[ "${ORIG_RESOLV_CONF}" != "${NEW_RESOLV_CONF}" ]]; then
complain "Should NOT update /etc/resolv.conf"
exit 1
fi
kill_reliably ${XIRI_PID} ${DOWN_DELAY}

View File

@ -30,7 +30,13 @@ function kill_reliably(){
}
function warn(){
echo -e "\033[1;33m${@}\033[0m"
local LC=$(echo "${@}" | wc -l)
local CL=1
while [[ ${CL} -le ${LC} ]]; do
echo -e "\033[1;33m$(echo "${@}" | head -n${CL} | tail -n1)\033[0m"
let CL+=1
done
}
function complain(){