pytest.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. ## This script is to run emqx cluster smoke tests (fvt) in github action
  3. ## This script is executed in paho_client
  4. set -x
  5. set +e
  6. # shellcheck disable=SC3028 disable=SC3054
  7. SCRIPT_DIR="$( dirname -- "$( readlink -f -- "$0"; )"; )"
  8. EMQX_TEST_DB_BACKEND=$1
  9. if [ "$EMQX_TEST_DB_BACKEND" = "rlog" ]
  10. then
  11. # TODO: target only replica to avoid replication races
  12. # see: https://github.com/emqx/emqx/issues/6094
  13. TARGET_HOST="node2.emqx.io"
  14. else
  15. # use loadbalancer
  16. TARGET_HOST="haproxy"
  17. fi
  18. apk update && apk add git curl
  19. git clone -b develop-5.0 https://github.com/emqx/paho.mqtt.testing.git /paho.mqtt.testing
  20. pip install -r "$SCRIPT_DIR/requirements.txt"
  21. pytest --retries 3 -v /paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host "$TARGET_HOST"
  22. RESULT=$?
  23. pytest --retries 3 -v /paho.mqtt.testing/interoperability/test_client --host "$TARGET_HOST"
  24. RESULT=$(( RESULT + $? ))
  25. # pytest -v /paho.mqtt.testing/interoperability/test_cluster --host1 "node1.emqx.io" --host2 "node2.emqx.io"
  26. # RESULT=$(( RESULT + $? ))
  27. exit $RESULT