Skip to content

chore: rename EMQ X -> EMQX #447

chore: rename EMQ X -> EMQX

chore: rename EMQ X -> EMQX #447

name: Run test cases
on: [push, pull_request]
jobs:
run_test_cases:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pgsql_tag:
- 9
- 10
- 11
- 12
- 13
network_type:
- ipv4
- ipv6
connect_type:
- ssl
- tcp
steps:
- uses: actions/checkout@v1
- name: run test cases
shell: bash
env:
PGSQL_TAG: ${{ matrix.pgsql_tag }}
NETWORK_TYPE: ${{ matrix.network_type }}
CONNECT_TYPE: ${{ matrix.connect_type }}
run: |
if [ "$CONNECT_TYPE" = "ssl" ]; then
docker-compose -f .ci/docker-compose-ssl.yml -p test up -d --build
if [ "$PGSQL_TAG" = "12" ] || [ "$PGSQL_TAG" = "13" ]; then
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.pgsql.ssl.tls_versions =/c auth.pgsql.ssl.tls_versions = tlsv1.3,tlsv1.2' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
else
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.pgsql.ssl.tls_versions =/c auth.pgsql.ssl.tls_versions = tlsv1.2,tlsv1.3' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
fi
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.pgsql.ssl =/c auth.pgsql.ssl = true' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "echo 'auth.pgsql.ssl_opts.cacertfile = /emqx_auth_pgsql/.ci/pgsql/root.crt' >> /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "echo 'auth.pgsql.ssl_opts.keyfile = /emqx_auth_pgsql/.ci/pgsql/postgresql.key' >> /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "echo 'auth.pgsql.ssl_opts.certfile = /emqx_auth_pgsql/.ci/pgsql/postgresql.crt' >> /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
else
docker-compose -f .ci/docker-compose.yml -p test up -d
fi
if [ "$NETWORK_TYPE" != "ipv6" ];then
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.pgsql.server/c auth.pgsql.server = 192.168.1.10:5432' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
else
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.pgsql.server/c auth.pgsql.server = 2001:3200:3200::20:5432' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
fi
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.pgsql.username =/c auth.pgsql.username = postgres' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.pgsql.database =/c auth.pgsql.database = postgres' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.pgsql.password =/c auth.pgsql.password = postgres' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf"
docker ps -a
docker logs test_pgsql_server_1
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "make -C /emqx_auth_pgsql xref"
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "make -C /emqx_auth_pgsql eunit"
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "make -C /emqx_auth_pgsql ct"
docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "make -C /emqx_auth_pgsql cover"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: logs_pgsql${{ matrix.pgsql_tag }}_${{ matrix.network_type }}
path: _build/test/logs