chore(ci): grep `emqx ctl listeners` to check if node is listening

This commit is contained in:
Thales Macedo Garitezi 2022-01-12 09:41:58 -03:00
parent fca0d2bfd8
commit 5a7943f583
No known key found for this signature in database
GPG Key ID: DD279F8152A9B6DD
1 changed files with 4 additions and 8 deletions

View File

@ -32,14 +32,10 @@ is_node_up() {
is_node_listening() {
local node="$1"
if [ "${IS_ELIXIR:-no}" = "yes" ]
then
docker exec -i "$node" \
emqx eval ":ok = case :gen_tcp.connect('localhost', 1883, []), do: ({:ok, port} -> (:gen_tcp.close(port); :ok); _ -> :error)" > /dev/null 2>&1
else
docker exec -i "$node" \
emqx eval "ok = case gen_tcp:connect(\"localhost\", 1883, []) of {ok, P} -> gen_tcp:close(P), ok; _ -> exit(1) end." > /dev/null 2>&1
fi
docker exec -i "$node" \
emqx ctl listeners | \
grep -A6 'tcp:default' | \
grep -qE 'running *: true'
}
is_cluster_up() {