|
|
@@ -1,215 +0,0 @@
|
|
|
-[config var=PROJ_ROOT]
|
|
|
-[config var=PROFILE]
|
|
|
-[config var=VSN]
|
|
|
-[config var=CUR_PKG]
|
|
|
-[config var=OLD_VSN]
|
|
|
-[config var=OLD_PKG]
|
|
|
-
|
|
|
-[config shell_cmd=/bin/bash]
|
|
|
-[config timeout=600000]
|
|
|
-
|
|
|
-[shell http_server]
|
|
|
- !cd http_server
|
|
|
- !rebar3 shell
|
|
|
- ???Eshell
|
|
|
- ???>
|
|
|
- !http_server:start().
|
|
|
- ?Start http_server listener on 7077 successfully.
|
|
|
- ?ok
|
|
|
- ?>
|
|
|
-
|
|
|
-[shell emqx1]
|
|
|
- !cd $PROJ_ROOT
|
|
|
- !mkdir -p emqx1
|
|
|
- !tar -C emqx1 -zxf "$OLD_PKG"
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !cd emqx1
|
|
|
- !export EMQX_NODE_NAME='emqx1@127.0.0.1'
|
|
|
- !./bin/emqx start
|
|
|
- ?EMQX .* is started successfully!
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
-[shell emqx2]
|
|
|
- !cd $PROJ_ROOT
|
|
|
- !mkdir -p emqx2
|
|
|
- !tar -C emqx2 -zxf "$OLD_PKG"
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !cd emqx2
|
|
|
- !export EMQX_NODE__NAME='emqx2@127.0.0.1'
|
|
|
- !export EMQX_STATSD__SERVER='127.0.0.1:8124'
|
|
|
- !export EMQX_LISTENERS__TCP__DEFAULT__BIND='0.0.0.0:1882'
|
|
|
- !export EMQX_LISTENERS__SSL__DEFAULT__BIND='0.0.0.0:8882'
|
|
|
- !export EMQX_LISTENERS__WS__DEFAULT__BIND='0.0.0.0:8082'
|
|
|
- !export EMQX_LISTENERS__WSS__DEFAULT__BIND='0.0.0.0:8085'
|
|
|
- !export EMQX_DASHBOARD__LISTENERS__HTTP__BIND='0.0.0.0:18082'
|
|
|
- !./bin/emqx start
|
|
|
- ?EMQX .* is started successfully!
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx_ctl cluster join emqx1@127.0.0.1
|
|
|
- ???Join the cluster successfully.
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx_ctl cluster status --json | jq -c .running_nodes
|
|
|
- ???["emqx1@127.0.0.1","emqx2@127.0.0.1"]
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- ## create a webhook data bridge with id "my_webhook"
|
|
|
- !curl --user admin:public --silent --show-error 'http://localhost:18082/api/v5/bridges' -X 'POST' -H 'Content-Type: application/json' --data-binary '{"name":"my_webhook","method":"post","url":"http://127.0.0.1:7077/counter","headers":{"content-type":"application/json"},"pool_size":4,"enable_pipelining":100,"connect_timeout":"5s","request_timeout":"5s","max_retries":3,"type":"webhook","ssl":{"enable":false,"verify":"verify_none"}}' | jq '.status'
|
|
|
- ?connected
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- ## create a rule that uses the webhook as action, the rule id = "rule_edsy"
|
|
|
- !curl --user admin:public --silent --show-error 'http://localhost:18082/api/v5/rules' -X 'POST' -H 'Content-Type: application/json' --data-binary '{"id":"rule_edsy","sql":"SELECT\n *\nFROM\n \"t/#\"","actions":["webhook:my_webhook"]}' | jq '.id'
|
|
|
- ?rule_edsy
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
-[shell emqx1]
|
|
|
- ## verify the bridges and rules are sync to the other node
|
|
|
- !curl --user admin:public --silent --show-error 'http://localhost:18083/api/v5/bridges/webhook:my_webhook' -X 'GET' -H 'Content-Type: application/json' | jq '.name'
|
|
|
- ?my_webhook
|
|
|
- ?SH-PROMPT
|
|
|
- !curl --user admin:public --silent --show-error 'http://localhost:18083/api/v5/rules/rule_edsy' -X 'GET' -H 'Content-Type: application/json' | jq '.id'
|
|
|
- ?rule_edsy
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
-[shell bench]
|
|
|
-
|
|
|
- !emqtt_bench pub -c 10 -I 1000 -t t/%i -s 64 -L 300
|
|
|
- ???sent
|
|
|
-
|
|
|
-[shell emqx1]
|
|
|
- !echo "" > log/emqx.log.1
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !cp -f ../$CUR_PKG releases/
|
|
|
-
|
|
|
- ## 1. upgrade to the new version
|
|
|
- !./bin/emqx install $VSN
|
|
|
- ?Made release permanent: "$VSN"
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx versions | grep permanent
|
|
|
- ?(.*)$VSN
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- ## 2. downgrade to the old version
|
|
|
- !./bin/emqx install $OLD_VSN
|
|
|
- ?Made release permanent:.*
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx versions | grep permanent | grep -qs "$OLD_VSN"
|
|
|
- ?SH-PROMPT:
|
|
|
- !echo ==$$?==
|
|
|
- ?^==0==
|
|
|
- ?SH-PROMPT:
|
|
|
-
|
|
|
- ## 3. again, upgrade to the new version
|
|
|
- !./bin/emqx install $VSN
|
|
|
- ?Made release permanent: "$VSN"
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx versions | grep permanent
|
|
|
- ?(.*)$VSN
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx_ctl cluster status --json | jq -c .running_nodes
|
|
|
- ???["emqx1@127.0.0.1","emqx2@127.0.0.1"]
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
-[shell emqx2]
|
|
|
- !echo "" > log/emqx.log.1
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !cp -f ../$CUR_PKG releases/
|
|
|
-
|
|
|
- ## 1. upgrade to the new version
|
|
|
- !./bin/emqx install $VSN
|
|
|
- ?Made release permanent: "$VSN"
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx versions |grep permanent
|
|
|
- ?(.*)$VSN
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- ## 2. downgrade to the old version
|
|
|
- !./bin/emqx install $OLD_VSN
|
|
|
- ?Made release permanent:.*
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx versions | grep permanent | grep -qs "$OLD_VSN"
|
|
|
- ?SH-PROMPT:
|
|
|
- !echo ==$$?==
|
|
|
- ?^==0==
|
|
|
- ?SH-PROMPT:
|
|
|
-
|
|
|
- ## 3. again, upgrade to the new version
|
|
|
- !./bin/emqx install $VSN
|
|
|
- ?Made release permanent: "$VSN"
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx versions |grep permanent
|
|
|
- ?(.*)$VSN
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !./bin/emqx_ctl cluster status --json | jq -c .running_nodes
|
|
|
- ???["emqx1@127.0.0.1","emqx2@127.0.0.1"]
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
-## We don't guarantee not to lose a single message!
|
|
|
-## So even if we received 290~300 messages, we consider it as success
|
|
|
-[shell bench]
|
|
|
- ???publish complete
|
|
|
- ??SH-PROMPT:
|
|
|
- !sleep 5
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !curl --user admin:public --silent --show-error http://localhost:18083/api/v5/rules | jq --raw-output ".[0].node_metrics[] | select(.node==\"emqx1@127.0.0.1\") | .metrics.matched"
|
|
|
- ?300
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- !curl --user admin:public --silent --show-error http://localhost:18083/api/v5/rules | jq --raw-output ".[0].node_metrics[] | select(.node==\"emqx1@127.0.0.1\") | .metrics.\"actions.success\""
|
|
|
- ?\{"data":(29[0-9])|(300),"code":0\}
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
- ## The /counter API is provided by .ci/fvt_test/http_server
|
|
|
- !curl http://127.0.0.1:7077/counter
|
|
|
- ?\{"data":(29[0-9])|(300),"code":0\}
|
|
|
- ?SH-PROMPT
|
|
|
-
|
|
|
-[shell emqx2]
|
|
|
- !cat log/emqx.log.1 | tail -n 100
|
|
|
- -error
|
|
|
- ??SH-PROMPT:
|
|
|
-
|
|
|
- !./bin/emqx stop
|
|
|
- ?ok
|
|
|
- ?SH-PROMPT:
|
|
|
-
|
|
|
- !rm -rf emqx2/
|
|
|
- ?SH-PROMPT:
|
|
|
-
|
|
|
-[shell emqx1]
|
|
|
- !cat log/emqx.log.1 | tail -n 100
|
|
|
- -error
|
|
|
- ??SH-PROMPT:
|
|
|
-
|
|
|
- !./bin/emqx stop
|
|
|
- ?ok
|
|
|
- ?SH-PROMPT:
|
|
|
-
|
|
|
- !rm -rf emqx1/
|
|
|
- ?SH-PROMPT:
|
|
|
-
|
|
|
-[shell http_server]
|
|
|
- !http_server:stop().
|
|
|
- ?ok
|
|
|
- ?>
|
|
|
- !halt(3).
|
|
|
- ?SH-PROMPT:
|
|
|
-
|
|
|
-[cleanup]
|
|
|
- !echo ==$$?==
|
|
|
- ?==0==
|