mirror of
https://github.com/ivanilves/xiringuito.git
synced 2025-05-29 13:30:26 -07:00
Case: run with DNS propagation
This commit is contained in:
parent
5f6fcdcd36
commit
f49ad97aab
@ -21,6 +21,7 @@ script:
|
|||||||
- testing/run_integration_case.sh connect_with_ssh_key
|
- testing/run_integration_case.sh connect_with_ssh_key
|
||||||
- testing/run_integration_case.sh do_client_teardown
|
- testing/run_integration_case.sh do_client_teardown
|
||||||
- testing/run_integration_case.sh do_server_teardown
|
- testing/run_integration_case.sh do_server_teardown
|
||||||
|
- testing/run_integration_case.sh run_with_dns_propagation
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
@ -11,11 +11,7 @@ ${XIRI_EXE} -X -R ${SSH_USER}@${REMOTE_IP} &
|
|||||||
XIRI_PID=${!}; sleep ${INIT_DELAY}
|
XIRI_PID=${!}; sleep ${INIT_DELAY}
|
||||||
NEW_LINKS=$(get_client_links)
|
NEW_LINKS=$(get_client_links)
|
||||||
|
|
||||||
kill ${XIRI_PID}; sleep ${DOWN_DELAY}
|
kill_reliably ${XIRI_PID} ${DOWN_DELAY}
|
||||||
if [[ $(ps -p ${XIRI_PID} | wc -l) -eq 2 ]]; then
|
|
||||||
kill -9 ${XIRI_PID} &>/dev/null
|
|
||||||
sleep ${DOWN_DELAY}
|
|
||||||
fi
|
|
||||||
FINAL_LINKS=$(get_client_links)
|
FINAL_LINKS=$(get_client_links)
|
||||||
|
|
||||||
if [[ "${ORIG_LINKS}" == "${NEW_LINKS}" ]]; then
|
if [[ "${ORIG_LINKS}" == "${NEW_LINKS}" ]]; then
|
||||||
|
@ -12,11 +12,7 @@ ${XIRI_EXE} -f 1 -X -R ${SSH_USER}@${REMOTE_IP} &
|
|||||||
XIRI_PID=${!}; sleep ${INIT_DELAY}
|
XIRI_PID=${!}; sleep ${INIT_DELAY}
|
||||||
NEW_LINKS=$(get_server_links)
|
NEW_LINKS=$(get_server_links)
|
||||||
|
|
||||||
kill ${XIRI_PID}; sleep ${DOWN_DELAY}
|
kill_reliably ${XIRI_PID} ${DOWN_DELAY}
|
||||||
if [[ $(ps -p ${XIRI_PID} | wc -l) -eq 2 ]]; then
|
|
||||||
kill -9 ${XIRI_PID} &>/dev/null
|
|
||||||
sleep ${DOWN_DELAY}
|
|
||||||
fi
|
|
||||||
|
|
||||||
FINAL_LINKS=$(get_server_links)
|
FINAL_LINKS=$(get_server_links)
|
||||||
|
|
||||||
|
@ -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}
|
@ -17,6 +17,22 @@ function setup(){
|
|||||||
done
|
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(){
|
function complain(){
|
||||||
echo -e "\033[1;31m>>> ${@}\033[0m"
|
echo -e "\033[1;31m>>> ${@}\033[0m"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user