Skip to content

Commit

Permalink
Fixed script path error and added ME18 WLP PER test. (#418)
Browse files Browse the repository at this point in the history
* Added M318 WLP_V1 per.

* Debug rf switch failure.

* Debug rf switch.

* Back to use MSDK.
  • Loading branch information
yc-adi authored Feb 14, 2023
1 parent 8b473b6 commit c8cfd0c
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 47 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/scripts/board_per_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,24 @@ PKG_RA=$8
PHY_RA=$9
STEP=${10}


echo MSDK: $MSDK
echo BRD1: $BRD1
echo BRD2: $BRD2
echo CURR_TIME: $CURR_TIME
echo CURR_JOB_FILE: $CURR_JOB_FILE
echo CURR_LOG: $CURR_LOG
echo all_in_one: $all_in_one
echo PKG_RA: $PKG_RA
echo PHY_RA: $PHY_RA
echo STEP: $STEP
echo
echo " MSDK: $MSDK"
echo " BRD1: $BRD1"
echo " BRD2: $BRD2"
echo " CURR_TIME: $CURR_TIME"
echo "CURR_JOB_FILE: $CURR_JOB_FILE"
echo " CURR_LOG: $CURR_LOG"
echo " all_in_one: $all_in_one"
echo " PKG_RA: $PKG_RA"
echo " PHY_RA: $PHY_RA"
echo " STEP: $STEP"
echo ""

#------------------------------------------------
echo "Use python 3.10.9."
source ~/anaconda3/etc/profile.d/conda.sh
conda activate py3_10
python3 -c "import sys; print(sys.version)"
echo
echo ""

RS_FILE=~/Workspace/Resource_Share/boards_config.json
echo "The board info are stored in ${RS_FILE}."
Expand Down Expand Up @@ -79,14 +78,15 @@ echo BRD2_SW_ST: ${BRD2_SW_ST}
echo

echo "#--------------------------------------------------------------------------------------------"
echo "# PER test on board ${BRD2}"
echo "# PER test on board ${BRD2} ${BRD2_TYPE}"
echo "#--------------------------------------------------------------------------------------------"
echo

echo "Try to lock the hardware resources."
python3 ~/Workspace/Resource_Share/Resource_Share.py -l -t 3600 /home/$USER/Workspace/Resource_Share/mc_rf_sw.txt
python3 ~/Workspace/Resource_Share/Resource_Share.py -l -t 3600 /home/$USER/Workspace/Resource_Share/${BRD1}.txt
python3 ~/Workspace/Resource_Share/Resource_Share.py -l -t 3600 /home/$USER/Workspace/Resource_Share/${BRD2}.txt
echo ""

echo CURR_JOB_FILE: ${CURR_JOB_FILE}
touch ${CURR_JOB_FILE}
Expand All @@ -112,9 +112,9 @@ echo "#-------------------------------------------------------------------------
echo "Set the Mini-circuits RF Switches."
set -x
echo RF switch for ${BRD1}
python3 $MSDK/Tools/Bluetooth/mc_rf_sw.py --model ${BRD1_SW_MODEL} --op set --state ${BRD1_SW_ST}
unbuffer python3 $MSDK/Tools/Bluetooth/mc_rf_sw.py --model ${BRD1_SW_MODEL} --op set --state ${BRD1_SW_ST} --debug
echo RF switch for ${BRD2}
python3 $MSDK/Tools/Bluetooth/mc_rf_sw.py --model ${BRD2_SW_MODEL} --op set --state ${BRD2_SW_ST}
unbuffer python3 $MSDK/Tools/Bluetooth/mc_rf_sw.py --model ${BRD2_SW_MODEL} --op set --state ${BRD2_SW_ST} --debug
set +x
echo

Expand Down Expand Up @@ -185,15 +185,15 @@ do
# Run the PER test
RESULT_PATH=~/Workspace/ci_results/per
res=${RESULT_PATH}/msdk-${CURR_TIME}
res_files[i]=${res}_${BRD2_CHIP_LC}_${i}.csv
res_files[i]=${res}_${BRD2_CHIP_LC}_${BRD2_TYPE}_${i}.csv
echo "The test results will be saved in file ${res_files[i]}."

slv_ser=${BRD2_HCI}
mst_ser=${BRD1_HCI}

set -x
python3 $MSDK/Tools/Bluetooth/conn_sweep.py ${slv_ser} ${mst_ser} ${res_files[i]} \
--stp ${BRD2_CON} --pktlen ${pkt_len} --phys ${phy} --step ${step}
unbuffer python3 $MSDK/Tools/Bluetooth/conn_sweep.py ${slv_ser} ${mst_ser} ${res_files[i]} \
--stp ${BRD2_CON} --pktlen ${pkt_len} --phys ${phy} --step ${step} --loss -17.4
set +x

echo "cat ${res_files[i]}"
Expand Down Expand Up @@ -222,7 +222,7 @@ echo "cat ${all_in_one}"
cat "${all_in_one}"
echo
echo "Check the PER values."
python3 ${MSDK}/.github/workflows/scripts/check_results.py --csv $(realpath ${all_in_one}) --debug
unbuffer python3 ${MSDK}/.github/workflows/scripts/check_results.py --csv $(realpath ${all_in_one}) --debug

if [[ $? -ne 0 ]]; then
echo
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/scripts/msdk_per_skip_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

echo
echo "#################################################################################################################"
echo "msdk_per_skip_check.sh 1_NO_SKIP 2_MSDK 3_CHIP_UC #"
echo " return 0: run the test #"
echo " return 1: skip the test #"
echo "# msdk_per_skip_check.sh 1_NO_SKIP 2_MSDK 3_CHIP_UC 4_BRD_TYPE #"
echo "# return 0: run the test #"
echo "# return 1: skip the test #"
echo "#################################################################################################################"
echo
echo $0 $@
Expand All @@ -13,10 +13,12 @@ echo
NO_SKIP=$1
MSDK=$2
CHIP_UC=$3
BRD_TYPE=$4

echo NO_SKIP: $NO_SKIP
echo MSDK: $MSDK
echo CHIP_UC: $CHIP_UC
echo " NO_SKIP: $NO_SKIP"
echo " MSDK: $MSDK"
echo " CHIP_UC: $CHIP_UC"
echo "BRD_TYPE: $BRD_TYPE"
echo

CHIP_LC=${CHIP_UC,,}
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/scripts/unlock_plot.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

echo "#############################################################################################"
echo "# ./unlock_plot.sh GITHUB_WORKSPACE LOCK_FILE_LIST PER_RESULT_FILE NEED_TO_PLOT #"
echo "# ./unlock_plot.sh MSDK LOCK_FILE_LIST PER_RESULT_FILE NEED_TO_PLOT #"
echo "#############################################################################################"
echo
echo $0 $@
Expand All @@ -12,15 +12,11 @@ if [ "x$2" == "x" ] || [ "x$3" == "x" ]; then
exit 2
fi

GITHUB_WORKSPACE=$1
MSDK=$1
CURR_JOB_FILE=$2
all_in_one=$3
NEED_TO_PLOT=$4

echo CURR_JOB_FILE: ${CURR_JOB_FILE}
echo "Result file: "${all_in_one}
echo

# Use python 3.10.9
source ~/anaconda3/etc/profile.d/conda.sh && conda activate py3_10
python3 -c "import sys; print(sys.version)"
Expand Down Expand Up @@ -66,7 +62,7 @@ echo "--------------------------------------------------------------------------
echo "Plot the results"
echo

cd ${GITHUB_WORKSPACE}/.github/workflows/scripts
cd ${MSDK}/.github/workflows/scripts
echo PWD: `pwd`
echo

Expand Down
123 changes: 109 additions & 14 deletions .github/workflows/simple_per_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
# Remove old archives
rm -f *.zip
# Runs a set of commands using the runners shell
- name: get_and_set_configurations
env:
Expand Down Expand Up @@ -122,11 +121,13 @@ jobs:
# Prepare the arguments for script.
MSDK=${GITHUB_WORKSPACE}
CHIP_UC=MAX32655
BRD_TYPE=EvKit_V1
$MSDK/.github/workflows/msdk_per_skip_check.sh \
$MSDK/.github/workflows/scripts/msdk_per_skip_check.sh \
$NO_SKIP \
$MSDK \
$CHIP_UC
$CHIP_UC \
$BRD_TYPE
if [[ $? -ne 0 ]]; then
echo "SKIPPED."
Expand All @@ -149,18 +150,19 @@ jobs:
CURR_TIME=$(date +%Y-%m-%d_%H-%M-%S)
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}.txt
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.txt
echo "::set-env name=CURR_JOB_FILE::${CURR_JOB_FILE}"
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}.log
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.log
echo "::set-env name=CURR_LOG::${CURR_LOG}"
RESULT_PATH=~/Workspace/ci_results/per
res=${RESULT_PATH}/msdk-${CURR_TIME}
all_in_one=${res}_${BRD2_CHIP_LC}.csv
all_in_one=${res}_${BRD2_CHIP_LC}_${BRD_TYPE}.csv
echo "::set-env name=all_in_one::${all_in_one}"
#------------------------------------------------
set -e
${MSDK}/.github/workflows/scripts/board_per_test.sh \
$MSDK \
$BRD1 \
Expand All @@ -175,6 +177,7 @@ jobs:
2>&1 | tee -a ${CURR_LOG}
if [[ $? -ne 0 ]]; then
#core.setFailed('${CHIP_UC} ${BRD_TYPE} PER test failed.')
exit 1
fi
#------------------------------------------------
Expand Down Expand Up @@ -203,11 +206,13 @@ jobs:
# Prepare the arguments for script.
MSDK=${GITHUB_WORKSPACE}
CHIP_UC=MAX32665
BRD_TYPE=EvKit_V1
$MSDK/.github/workflows/scripts/msdk_per_skip_check.sh \
$NO_SKIP \
$MSDK \
$CHIP_UC
$CHIP_UC \
$BRD_TYPE
if [[ $? -ne 0 ]]; then
echo "SKIPPED."
Expand All @@ -230,18 +235,19 @@ jobs:
CURR_TIME=$(date +%Y-%m-%d_%H-%M-%S)
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}.txt
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.txt
echo "::set-env name=CURR_JOB_FILE::${CURR_JOB_FILE}"
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}.log
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.log
echo "::set-env name=CURR_LOG::${CURR_LOG}"
RESULT_PATH=~/Workspace/ci_results/per
res=${RESULT_PATH}/msdk-${CURR_TIME}
all_in_one=${res}_${BRD2_CHIP_LC}.csv
all_in_one=${res}_${BRD2_CHIP_LC}_${BRD_TYPE}.csv
echo "::set-env name=all_in_one::${all_in_one}"
#------------------------------------------------
set -e
${MSDK}/.github/workflows/scripts/board_per_test.sh \
$MSDK \
$BRD1 \
Expand All @@ -256,6 +262,7 @@ jobs:
2>&1 | tee -a ${CURR_LOG}
if [[ $? -ne 0 ]]; then
#core.setFailed('${CHIP_UC} ${BRD_TYPE} PER test failed.')
exit 1
fi
#------------------------------------------------
Expand Down Expand Up @@ -283,11 +290,13 @@ jobs:
# Prepare the arguments for script.
MSDK=${GITHUB_WORKSPACE}
CHIP_UC=MAX32690
BRD_TYPE=EvKit_V1
$MSDK/.github/workflows/scripts/msdk_per_skip_check.sh \
$NO_SKIP \
$MSDK \
$CHIP_UC
$CHIP_UC \
$BRD_TYPE
if [[ $? -ne 0 ]]; then
echo "SKIPPED."
Expand All @@ -310,18 +319,19 @@ jobs:
CURR_TIME=$(date +%Y-%m-%d_%H-%M-%S)
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}.txt
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.txt
echo "::set-env name=CURR_JOB_FILE::${CURR_JOB_FILE}"
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}.log
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.log
echo "::set-env name=CURR_LOG::${CURR_LOG}"
RESULT_PATH=~/Workspace/ci_results/per
res=${RESULT_PATH}/msdk-${CURR_TIME}
all_in_one=${res}_${BRD2_CHIP_LC}.csv
all_in_one=${res}_${BRD2_CHIP_LC}_${BRD_TYPE}.csv
echo "::set-env name=all_in_one::${all_in_one}"
#------------------------------------------------
set -e
${MSDK}/.github/workflows/scripts/board_per_test.sh \
$MSDK \
$BRD1 \
Expand All @@ -336,6 +346,7 @@ jobs:
2>&1 | tee -a ${CURR_LOG}
if [[ $? -ne 0 ]]; then
#core.setFailed('${CHIP_UC} ${BRD_TYPE} PER test failed.')
exit 1
fi
#------------------------------------------------
Expand All @@ -351,3 +362,87 @@ jobs:
chmod u+x ${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh
${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh ${GITHUB_WORKSPACE} ${CURR_JOB_FILE} ${all_in_one} True 2>&1 | tee -a ${CURR_LOG}
# Runs a set of commands using the runners shell
- name: max32690-wlp_simple_per_test
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"

run: |
#------------------------------------------------------------------------------------------------------------
# Prepare the arguments for script.
MSDK=${GITHUB_WORKSPACE}
CHIP_UC=MAX32690
BRD_TYPE=WLP_V1
$MSDK/.github/workflows/scripts/msdk_per_skip_check.sh \
$NO_SKIP \
$MSDK \
$CHIP_UC \
$BRD_TYPE
if [[ $? -ne 0 ]]; then
echo "SKIPPED."
exit 0
fi
#------------------------------------------------
# Prepare the arguments for function call
if [ "${DO_MAX32690_WLP}" == "0" ]; then
echo "Skip the test for MAX32690 WLP_V1."
exit 0
fi
BRD2_CHIP_LC=max32690
MSDK=${GITHUB_WORKSPACE}
BRD1=nRF52840_1
BRD2=max32690_board_A1
CURR_TIME=$(date +%Y-%m-%d_%H-%M-%S)
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.txt
echo "::set-env name=CURR_JOB_FILE::${CURR_JOB_FILE}"
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.log
echo "::set-env name=CURR_LOG::${CURR_LOG}"
RESULT_PATH=~/Workspace/ci_results/per
res=${RESULT_PATH}/msdk-${CURR_TIME}
all_in_one=${res}_${BRD2_CHIP_LC}_${BRD_TYPE}.csv
echo "::set-env name=all_in_one::${all_in_one}"
#------------------------------------------------
set -e
${MSDK}/.github/workflows/scripts/board_per_test.sh \
$MSDK \
$BRD1 \
$BRD2 \
$CURR_TIME \
$(realpath ${CURR_JOB_FILE}) \
$(realpath ${CURR_LOG}) \
$(realpath ${all_in_one}) \
"${MAX32690_WLP_PKG_RA}" \
"${MAX32690_WLP_PHY_RA}" \
${MAX32690_WLP_STEP} \
2>&1 | tee -a ${CURR_LOG}
if [[ $? -ne 0 ]]; then
#core.setFailed('${CHIP_UC} ${BRD_TYPE} PER test failed.')
exit 1
fi
#------------------------------------------------
# Unlock even when cancelled or failed
- name: unlock_max32690-wlp
if: always()
run: |
cd ${GITHUB_WORKSPACE}
echo PWD: `pwd`
echo
chmod u+x ${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh
${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh ${GITHUB_WORKSPACE} ${CURR_JOB_FILE} ${all_in_one} True 2>&1 | tee -a ${CURR_LOG}

0 comments on commit c8cfd0c

Please sign in to comment.