diff --git a/docker/docker-connect-test.sh b/docker/docker-connect-test.sh index 77306bddf5a..213f2b30f47 100755 --- a/docker/docker-connect-test.sh +++ b/docker/docker-connect-test.sh @@ -35,6 +35,8 @@ show_usage() { echo " -e All methods except excluded, example: applySettings,signTransaction" echo " -p Test pattern" echo " -f Use specific firmware version, example: 2.1.4, 1.8.0 default: -main" + echo " -b Use specific firmware branch" + echo " -o Use BTC-only firmware of the specified branch" echo " -i Included methods only, example: applySettings,signTransaction" echo " -s actual test script. default: 'yarn test:integration'" echo " -u Firmware url" @@ -46,6 +48,8 @@ show_usage() { # default options FIRMWARE="" FIRMWARE_URL="" +FIRMWARE_BRANCH="" +FIRMWARE_BTC_ONLY=false INCLUDED_METHODS="" EXCLUDED_METHODS="" DOCKER=true @@ -59,7 +63,7 @@ TRANSPORT="2.0.33" # echo $OPTARG # user options OPTIND=2 -while getopts ":p:i:e:f:u:m:t:hdcr" opt; do +while getopts ":p:i:e:f:b:u:m:t:hdcro" opt; do case $opt in d) DOCKER=false @@ -71,6 +75,9 @@ while getopts ":p:i:e:f:u:m:t:hdcr" opt; do f) FIRMWARE=$OPTARG ;; + b) + FIRMWARE_BRANCH=$OPTARG + ;; u) FIRMWARE_URL=$OPTARG ;; @@ -83,6 +90,9 @@ while getopts ":p:i:e:f:u:m:t:hdcr" opt; do p) PATTERN=$OPTARG ;; + o) + FIRMWARE_BTC_ONLY=true + ;; m) FIRMWARE_MODEL=$OPTARG ;; @@ -110,6 +120,11 @@ else SCRIPT="yarn workspace @trezor/connect test:e2e:web" fi +if [[ $FIRMWARE_BTC_ONLY == true && -z $FIRMWARE_BRANCH ]]; then + echo "BTC-only firmware requires a branch to be specified" + exit 1 +fi + # export essential process.env variables export TESTS_FIRMWARE=$FIRMWARE export TESTS_INCLUDED_METHODS=$INCLUDED_METHODS @@ -119,6 +134,8 @@ export TESTS_USE_WS_CACHE=$USE_WS_CACHE export TESTS_PATTERN=$PATTERN export TESTS_SCRIPT=$SCRIPT export TESTS_FIRMWARE_URL=$FIRMWARE_URL +export TESTS_FIRMWARE_BRANCH=$FIRMWARE_BRANCH +export TESTS_FIRMWARE_BTC_ONLY=$FIRMWARE_BTC_ONLY export TESTS_FIRMWARE_MODEL=$FIRMWARE_MODEL export TESTS_RANDOM=$RANDOMIZE export TESTS_TRANSPORT=$TRANSPORT @@ -133,6 +150,8 @@ run() { echo " Firmware: ${TESTS_FIRMWARE}" echo " Firmware model: ${TESTS_FIRMWARE_MODEL}" echo " Firmware from url: ${FIRMWARE_URL}" + echo " Firmware from branch: ${FIRMWARE_BRANCH}" + echo " Firmware BTC-only: ${FIRMWARE_BTC_ONLY}" echo " Test pattern: $PATTERN" echo " Included methods: ${INCLUDED_METHODS}" echo " Excluded methods: ${EXCLUDED_METHODS}"