Jenkins HIL test loading all airframes

This commit is contained in:
Daniel Agar 2021-11-22 11:17:48 -05:00
parent 0153c870d2
commit 1b7f4b6003
3 changed files with 58 additions and 9 deletions

View File

@ -21,7 +21,7 @@ pipeline {
sh 'make cubepilot_cubeorange_bootloader'
sh 'make cubepilot_cubeorange_test'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'cubepilot_cubeorange_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*, build/cubepilot_cubeorange_test/etc/init.d/airframes/*', name: 'cubepilot_cubeorange_test'
}
post {
always {
@ -48,6 +48,9 @@ pipeline {
steps {
// run tests
runTests()
// load all airframes
// sh("./Tools/HIL/test_airframes.sh `find /dev/serial -name *usb-*` `cd build/cubepilot_cubeorange_test/etc/init.d/airframes/; find . -regex '.*/[0-9].*' -exec basename {} \\; | cut -d '_' -f 1` || true") // test loading all airframes\
}
}
stage("status") {
@ -92,7 +95,7 @@ pipeline {
sh 'make cuav_x7pro_bootloader'
sh 'make cuav_x7pro_test'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'cuav_x7pro_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*', name: 'cuav_x7pro_test'
}
post {
always {
@ -161,7 +164,7 @@ pipeline {
sh 'make px4_fmu-v3_test'
sh 'make px4_fmu-v3_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v3_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*', name: 'px4_fmu-v3_test'
}
post {
always {
@ -230,7 +233,7 @@ pipeline {
sh 'make px4_fmu-v4_test'
sh 'make px4_fmu-v4_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v4_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*', name: 'px4_fmu-v4_test'
}
post {
always {
@ -298,7 +301,7 @@ pipeline {
sh 'make px4_fmu-v4pro_test'
sh 'make px4_fmu-v4pro_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v4pro_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*', name: 'px4_fmu-v4pro_test'
}
post {
always {
@ -367,7 +370,7 @@ pipeline {
sh 'make px4_fmu-v5_debug'
sh 'make px4_fmu-v5_debug bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v5_debug'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*', name: 'px4_fmu-v5_debug'
}
post {
always {
@ -447,7 +450,7 @@ pipeline {
sh 'make px4_fmu-v5_stackcheck'
sh 'make px4_fmu-v5_stackcheck bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v5_stackcheck'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*', name: 'px4_fmu-v5_stackcheck'
}
post {
always {
@ -526,7 +529,7 @@ pipeline {
sh 'make px4_fmu-v5_test'
sh 'make px4_fmu-v5_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v5_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*', name: 'px4_fmu-v5_test'
}
post {
always {
@ -595,7 +598,7 @@ pipeline {
sh 'make nxp_fmuk66-v3_test'
//sh 'make nxp_fmuk66-v3_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'nxp_fmuk66-v3_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*', name: 'nxp_fmuk66-v3_test'
}
post {
always {
@ -756,6 +759,10 @@ void resetParameters() {
}
void runTests() {
// test loading a range of airframes
sh './Tools/HIL/test_airframes.sh `find /dev/serial -name *usb-*` 1000 1001 2100 3000 4001 6001 8001 10016'
resetParameters()
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "IMU_GYRO_CAL_EN" --value "0" || true' // disable during testing

41
Tools/HIL/test_airframes.sh Executable file
View File

@ -0,0 +1,41 @@
#! /bin/bash
# exit when any command fails
set -e
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SERIAL_DEVICE=$1
if [ ! -e "${SERIAL_DEVICE}" ]
then
echo "Invalid serial device ${SERIAL_DEVICE}"
exit -1
fi
# all airframes (from ROMFS/px4fmu_common/init.d/airframes/)
# $(find . -regex '.*/[0-9].*' -exec basename {} \; | cut -d "_" -f 1)
ALL_AIRFRAMES=${@:2}
echo "airframes: ${ALL_AIRFRAMES}"
for airframe in $ALL_AIRFRAMES
do
echo
echo "##########################################################################################"
echo " Airframe: $airframe"
echo "##########################################################################################"
echo
${DIR}/nsh_param_set.py --device ${SERIAL_DEVICE} --name SYS_AUTOSTART --value $airframe
${DIR}/nsh_param_set.py --device ${SERIAL_DEVICE} --name CBRK_BUZZER --value 782097
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param reset SYS_HITL'
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param save'
${DIR}/reboot.py --device ${SERIAL_DEVICE}
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'ps'
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'work_queue status'
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'pwm info'
done

View File

@ -74,6 +74,7 @@ class RCOutput():
result += "\n"
result += "if [ ${AIRFRAME} != none ]\n"
result += "then\n"
result += "\techo \"Loading airframe: /etc/init.d/airframes/${AIRFRAME}\"\n"
result += "\t. /etc/init.d/airframes/${AIRFRAME}\n"
if not post_start:
result += "else\n"