Case: run with DNS propagation

This commit is contained in:
Ivan Ilves 2017-05-24 19:45:52 +02:00
parent 5f6fcdcd36
commit f49ad97aab
5 changed files with 37 additions and 10 deletions

View File

@ -21,6 +21,7 @@ script:
- testing/run_integration_case.sh connect_with_ssh_key
- 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
branches:
only:

View File

@ -11,11 +11,7 @@ ${XIRI_EXE} -X -R ${SSH_USER}@${REMOTE_IP} &
XIRI_PID=${!}; sleep ${INIT_DELAY}
NEW_LINKS=$(get_client_links)
kill ${XIRI_PID}; sleep ${DOWN_DELAY}
if [[ $(ps -p ${XIRI_PID} | wc -l) -eq 2 ]]; then
kill -9 ${XIRI_PID} &>/dev/null
sleep ${DOWN_DELAY}
fi
kill_reliably ${XIRI_PID} ${DOWN_DELAY}
FINAL_LINKS=$(get_client_links)
if [[ "${ORIG_LINKS}" == "${NEW_LINKS}" ]]; then

View File

@ -12,11 +12,7 @@ ${XIRI_EXE} -f 1 -X -R ${SSH_USER}@${REMOTE_IP} &
XIRI_PID=${!}; sleep ${INIT_DELAY}
NEW_LINKS=$(get_server_links)
kill ${XIRI_PID}; sleep ${DOWN_DELAY}
if [[ $(ps -p ${XIRI_PID} | wc -l) -eq 2 ]]; then
kill -9 ${XIRI_PID} &>/dev/null
sleep ${DOWN_DELAY}
fi
kill_reliably ${XIRI_PID} ${DOWN_DELAY}
FINAL_LINKS=$(get_server_links)

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 ${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 update /etc/resolv.conf"
exit 1
fi
kill_reliably ${XIRI_PID} ${DOWN_DELAY}

View File

@ -17,6 +17,22 @@ function setup(){
done
}
function kill_reliably(){
local TARGET_PID=${1}
local CHECK_DELAY=${2}
kill ${TARGET_PID}
sleep ${CHECK_DELAY}
if [[ $(ps -p ${TARGET_PID} | wc -l) -eq 2 ]]; then
kill -9 ${TARGET_PID} &>/dev/null
sleep ${CHECK_DELAY}
fi
}
function warn(){
echo -e "\033[1;33m${@}\033[0m"
}
function complain(){
echo -e "\033[1;31m>>> ${@}\033[0m"
}