diff --git a/.ci/docker-compose-file/docker-compose-redis-cluster-tcp.yaml b/.ci/docker-compose-file/docker-compose-redis-cluster-tcp.yaml index b8ea44971..df1db686f 100644 --- a/.ci/docker-compose-file/docker-compose-redis-cluster-tcp.yaml +++ b/.ci/docker-compose-file/docker-compose-redis-cluster-tcp.yaml @@ -6,7 +6,7 @@ services: container_name: redis volumes: - ./redis/:/data/conf - command: bash -c "/bin/bash /data/conf/redis.sh --node cluster && while true; do echo 1; sleep 1; done" + command: bash -c "/bin/bash /data/conf/redis.sh --node cluster && tail -f /var/log/redis-server.log" networks: emqx_bridge: # Assign a public address. Erlang container cannot find cluster nodes by network-scoped alias (redis_cluster). diff --git a/.ci/docker-compose-file/docker-compose-redis-cluster-tls.yaml b/.ci/docker-compose-file/docker-compose-redis-cluster-tls.yaml index 16654531e..bc62b5f75 100644 --- a/.ci/docker-compose-file/docker-compose-redis-cluster-tls.yaml +++ b/.ci/docker-compose-file/docker-compose-redis-cluster-tls.yaml @@ -7,7 +7,7 @@ services: volumes: - ../../apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs:/tls - ./redis/:/data/conf - command: bash -c "/bin/bash /data/conf/redis.sh --node cluster --tls-enabled && while true; do echo 1; sleep 1; done" + command: bash -c "/bin/bash /data/conf/redis.sh --node cluster --tls-enabled && tail -f /var/log/redis-server.log" networks: emqx_bridge: # Assign a public address. Erlang container cannot find cluster nodes by network-scoped alias (redis_cluster). diff --git a/.ci/docker-compose-file/docker-compose-redis-sentinel-tcp.yaml b/.ci/docker-compose-file/docker-compose-redis-sentinel-tcp.yaml index f2a79bda6..15a936c42 100644 --- a/.ci/docker-compose-file/docker-compose-redis-sentinel-tcp.yaml +++ b/.ci/docker-compose-file/docker-compose-redis-sentinel-tcp.yaml @@ -6,7 +6,7 @@ services: image: redis:${REDIS_TAG} volumes: - ./redis/:/data/conf - command: bash -c "/bin/bash /data/conf/redis.sh --node sentinel && while true; do echo 1; sleep 1; done" + command: bash -c "/bin/bash /data/conf/redis.sh --node sentinel && tail -f /var/log/redis-server.log" networks: emqx_bridge: # Assign a public address. Erlang container cannot find cluster nodes by network-scoped alias (redis_cluster). diff --git a/.ci/docker-compose-file/redis/redis-tls.conf b/.ci/docker-compose-file/redis/redis-tls.conf index 3ef09f315..46cddc518 100644 --- a/.ci/docker-compose-file/redis/redis-tls.conf +++ b/.ci/docker-compose-file/redis/redis-tls.conf @@ -1,5 +1,6 @@ daemonize yes bind 0.0.0.0 :: +logfile /var/log/redis-server.log tls-cert-file /tls/redis.crt tls-key-file /tls/redis.key -tls-ca-cert-file /tls/ca.crt \ No newline at end of file +tls-ca-cert-file /tls/ca.crt diff --git a/.ci/docker-compose-file/redis/redis.conf b/.ci/docker-compose-file/redis/redis.conf index 27eabdef5..71114329b 100644 --- a/.ci/docker-compose-file/redis/redis.conf +++ b/.ci/docker-compose-file/redis/redis.conf @@ -1,2 +1,3 @@ daemonize yes -bind 0.0.0.0 :: \ No newline at end of file +bind 0.0.0.0 :: +logfile /var/log/redis-server.log diff --git a/.ci/docker-compose-file/redis/redis.sh b/.ci/docker-compose-file/redis/redis.sh index a233659ee..53228eff5 100755 --- a/.ci/docker-compose-file/redis/redis.sh +++ b/.ci/docker-compose-file/redis/redis.sh @@ -1,5 +1,9 @@ #!/bin/bash +set -x + +LOCAL_IP=$(hostname -i | grep -oE '((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])\.){3}(25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])' | head -n 1) + node=single tls=false while [[ $# -gt 0 ]] @@ -48,9 +52,9 @@ elif [ "${node}" = "sentinel" ] ; then redis-server /data/conf/redis.conf --port 7000 --cluster-config-file /data/conf/nodes.7000.conf \ --cluster-enabled no; redis-server /data/conf/redis.conf --port 7001 --cluster-config-file /data/conf/nodes.7001.conf \ - --cluster-enabled no --slaveof 172.16.239.10 7000; + --cluster-enabled no --slaveof "$LOCAL_IP" 7000; redis-server /data/conf/redis.conf --port 7002 --cluster-config-file /data/conf/nodes.7002.conf \ - --cluster-enabled no --slaveof 172.16.239.10 7000; + --cluster-enabled no --slaveof "$LOCAL_IP" 7000; fi REDIS_LOAD_FLG=true; @@ -76,7 +80,7 @@ do continue; fi if [ "${node}" = "cluster" ] ; then - yes "yes" | redis-cli --cluster create 172.16.239.10:7000 172.16.239.10:7001 172.16.239.10:7002; + yes "yes" | redis-cli --cluster create "$LOCAL_IP:7000" "$LOCAL_IP:7001" "$LOCAL_IP:7002"; elif [ "${node}" = "sentinel" ] ; then cp /data/conf/sentinel.conf /_sentinel.conf redis-server /_sentinel.conf --sentinel; diff --git a/.ci/docker-compose-file/redis/sentinel.conf b/.ci/docker-compose-file/redis/sentinel.conf index c3f96c1ff..146ad80fe 100644 --- a/.ci/docker-compose-file/redis/sentinel.conf +++ b/.ci/docker-compose-file/redis/sentinel.conf @@ -1,3 +1,4 @@ port 26379 dir /tmp sentinel monitor mymaster 172.16.239.10 7000 1 +logfile /var/log/redis-server.log diff --git a/.github/workflows/run_cts_tests.yaml b/.github/workflows/run_cts_tests.yaml index 66744917f..1e3c59947 100644 --- a/.github/workflows/run_cts_tests.yaml +++ b/.github/workflows/run_cts_tests.yaml @@ -364,12 +364,7 @@ jobs: docker exec -i erlang bash -c "echo \"https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com\" > /root/.git-credentials && git config --global credential.helper store" fi - name: run test cases - timeout-minutes: 10 run: | - while ! nc -zv ${EMQX_AUTH__REDIS__SERVER%:*} ${EMQX_AUTH__REDIS__SERVER##*:} > /dev/null 2>&1; do - echo "waiting redis server" - sleep 1 - done export CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_ printenv > .env docker exec -i erlang sh -c "make ensure-rebar3"