mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-26 00:22:10 +03:00
Add startup checks on test servers
This commit is contained in:
parent
e67ed69d2a
commit
bcf354a94d
@ -3,7 +3,7 @@ set -Eeuo pipefail
|
||||
|
||||
echo "----- install prerequisite packages -----"
|
||||
pacman -Syy --noconfirm
|
||||
pacman -Sy --noconfirm bash curl icu base-devel libxml2 python3 glibc
|
||||
pacman -Sy --noconfirm bash curl icu base-devel libxml2 python3 glibc openbsd-netcat
|
||||
|
||||
python3 get-pip.py
|
||||
|
||||
|
@ -3,6 +3,6 @@ set -Eeuo pipefail
|
||||
|
||||
# Install packages
|
||||
pacman -Syy --noconfirm
|
||||
pacman -Sy --noconfirm bash python3 python-pip icu base-devel libxml2 glibc
|
||||
pacman -Sy --noconfirm bash python3 python-pip icu base-devel libxml2 glibc openbsd-netcat
|
||||
python3 -m pip install --upgrade pip --quiet
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
set -Eeuo pipefail
|
||||
|
||||
# Install packages
|
||||
yum install -y python38 procps gcc libxml2-devel openssl-devel libcurl-devel
|
||||
yum install -y python38 procps gcc libxml2-devel openssl-devel libcurl-devel nc
|
||||
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 0
|
||||
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
|
||||
alternatives --set python3 /usr/bin/python3.8
|
||||
|
@ -3,6 +3,6 @@ set -Eeuo pipefail
|
||||
|
||||
# Install packages
|
||||
apt update
|
||||
apt -y install bash curl sudo libcurl4-openssl-dev libxml2-utils libxml2-dev libssl-dev python3 python3-pip
|
||||
apt -y install bash curl sudo libcurl4-openssl-dev libxml2-utils libxml2-dev libssl-dev python3 python3-pip netcat
|
||||
python3 -m pip install --upgrade pip --quiet
|
||||
|
||||
|
@ -2,6 +2,6 @@
|
||||
set -Eeuo pipefail
|
||||
|
||||
echo "----- install prerequisite packages -----"
|
||||
yum install -y bash procps gcc libxml2-devel openssl-devel libcurl-devel python3-devel python3-pip
|
||||
yum install -y bash procps gcc libxml2-devel openssl-devel libcurl-devel python3-devel python3-pip nc
|
||||
python3 -m pip install --upgrade pip --quiet
|
||||
|
||||
|
@ -3,6 +3,6 @@ set -Eeuo pipefail
|
||||
|
||||
sudo apt update
|
||||
# Install libcurl dev so that hurl can be built dynamically with libcurl
|
||||
sudo apt install bash libcurl4-openssl-dev libxml2-utils
|
||||
sudo apt install bash libcurl4-openssl-dev libxml2-utils netcat
|
||||
python3 -m pip install --upgrade pip --quiet
|
||||
|
||||
|
@ -1,11 +1,47 @@
|
||||
#!/bin/bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
color_green=$(echo -ne "\033[1;32m")
|
||||
color_red=$(echo -ne "\033[1;31m")
|
||||
color_reset=$(echo -ne "\033[0m")
|
||||
|
||||
function check_listen_port(){
|
||||
# vars
|
||||
label="${1:-}"
|
||||
port="${2:-}"
|
||||
wait=5
|
||||
|
||||
# usage
|
||||
if [ -z "${label}" ] || [ -z "${port}" ] ; then
|
||||
echo "${color_red}Usage:${color_reset} check_listen_port {label} {port} {command}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
sleep "${wait}"
|
||||
if nc -zv 127.0.0.1 "${port}" ; then
|
||||
echo "${color_green}${label} listenning${color_reset} on ${port}"
|
||||
return 0
|
||||
else
|
||||
echo "${color_red}${label} not listening${color_reset} on ${port}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
echo "----- install servers prerequisites -----"
|
||||
pip3 install --requirement bin/requirements-frozen.txt
|
||||
|
||||
echo "----- start servers -----"
|
||||
cd integration
|
||||
python3 server.py >server.log 2>&1 &
|
||||
python3 ssl/server.py >server-ssl.log 2>&1 &
|
||||
mitmdump --listen-host 127.0.0.1 --listen-port 8888 --modify-header "/From-Proxy/Hello" >mitmdump.log 2>&1 &
|
||||
|
||||
echo -e "\n------------------ Starting server.py"
|
||||
(python3 server.py 2>&1 || true) &
|
||||
check_listen_port "server.py" 8000
|
||||
|
||||
echo -e "\n------------------ Starting ssl/server.py"
|
||||
(python3 ssl/server.py 2>&1 || true) &
|
||||
check_listen_port "ssl/server.py" 8001
|
||||
|
||||
echo -e "\n------------------ Starting mitmdump"
|
||||
(mitmdump --listen-host 127.0.0.1 --listen-port 8888 --modify-header "/From-Proxy/Hello" 2>&1 ||true) &
|
||||
check_listen_port "mitmdump" 8888
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user