chore: add a script to run relup lux test locally

This commit is contained in:
Zaiming (Stone) Shi 2022-06-28 10:54:07 +02:00
parent f7a2112a5a
commit 184b337e84
4 changed files with 51 additions and 11 deletions

View File

@ -1,5 +1,5 @@
[config var=PROJ_ROOT]
[config var=PROFILE]
[config var=PACKAGE_PATH]
[config var=VSN]
[config var=CUR_PKG]
[config var=OLD_VSN]
@ -19,21 +19,19 @@
?>
[shell emqx1]
!cd $PACKAGE_PATH
!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'
# debug boot
!sed 's/-boot_var RELEASE_LIB/-init_debug -boot_var RELEASE_LIB/g' -i ./bin/emqx
!./bin/emqx start
?EMQX .* is started successfully!
?SH-PROMPT
[shell emqx2]
!cd $PACKAGE_PATH
!cd $PROJ_ROOT
!mkdir -p emqx2
!tar -C emqx2 -zxf "$OLD_PKG"
?SH-PROMPT
@ -182,7 +180,7 @@
?SH-PROMPT
[shell emqx2]
!cat log/emqx.log.1 |grep -v 691c29ba |tail -n 100
!cat log/emqx.log.1 | tail -n 100
-error
??SH-PROMPT:
@ -190,11 +188,11 @@
?ok
?SH-PROMPT:
!rm -rf $PACKAGE_PATH/emqx2
!rm -rf emqx2/
?SH-PROMPT:
[shell emqx1]
!cat log/emqx.log.1 |grep -v 691c29ba |tail -n 100
!cat log/emqx.log.1 | tail -n 100
-error
??SH-PROMPT:
@ -202,7 +200,7 @@
?ok
?SH-PROMPT:
!rm -rf $PACKAGE_PATH/emqx
!rm -rf emqx1/
?SH-PROMPT:
[shell http_server]

View File

@ -119,8 +119,8 @@ jobs:
lux \
--progress verbose \
--case_timeout infinity \
--var PROJ_ROOT="$(pwd)" \
--var PROFILE="$profile" \
--var PACKAGE_PATH=$(pwd)/packages \
--var VSN="$cur_vsn" \
--var OLD_VSN="$OLD_VSN" \
--var CUR_PKG="$cur_pkg" \

42
scripts/run-relup-lux.sh Executable file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env bash
## This script needs the 'lux' command in PATH
## it runs the .ci/fvt_tests/relup.lux script
set -euo pipefail
old_vsn="${1}"
# ensure dir
cd -P -- "$(dirname -- "$0")/.."
set -x
case "$old_vsn" in
e*)
cur_vsn="$(./pkg-vsn.sh emqx-enterprise)"
profile='emqx-enterprise'
;;
v*)
cur_vsn="$(./pkg-vsn.sh emqx)"
profile='emqx'
;;
*)
echo "unknown old version $old_vsn"
exit 1
;;
esac
old_pkg="$(pwd)/_upgrade_base/${profile}-${old_vsn#[e|v]}-otp24.2.1-1-ubuntu20.04-amd64.tar.gz"
cur_pkg="$(pwd)/_packages/${profile}/${profile}-${cur_vsn}-otp24.2.1-1-ubuntu20.04-amd64.tar.gz"
lux \
--progress verbose \
--case_timeout infinity \
--var PROJ_ROOT="$(pwd)" \
--var PROFILE="$profile" \
--var VSN="$cur_vsn" \
--var OLD_VSN="$old_vsn" \
--var CUR_PKG="$cur_pkg" \
--var OLD_PKG="$old_pkg" \
.ci/fvt_tests/relup.lux

View File

@ -40,7 +40,7 @@ docker run -d -t --restart=always --name "$NODE2" \
-p 18084:18083 \
"$IMAGE"
wait (){
wait () {
container="$1"
while ! docker exec "$container" emqx_ctl status >/dev/null 2>&1; do
echo -n '.'