Jenkins move hardware testing to JLink debugger setup

This commit is contained in:
Daniel Agar 2019-01-05 20:33:38 -05:00 committed by GitHub
parent 8ae3f50095
commit 542cd7f216
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 31 deletions

View File

@ -6,10 +6,10 @@ pipeline {
parallel {
stage('px4_fmu-v2') {
stage('px4_fmu-v4_default') {
agent {
docker {
image 'px4io/px4-dev-nuttx:2018-11-22'
image 'px4io/px4-dev-nuttx:2019-01-01'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
@ -18,11 +18,11 @@ pipeline {
sh 'make distclean'
sh 'ccache -z'
sh 'git fetch --tags'
sh 'make px4_fmu-v2_test'
sh 'make px4_fmu-v4_default'
sh 'make sizes'
sh 'ccache -s'
stash includes: 'build/px4_fmu-v2_test/px4_fmu-v2_test.elf', name: 'px4_fmu-v2_test'
stash includes: 'Tools/HIL/monitor_firmware_upload.py, Tools/HIL/run_tests.py', name: 'scripts-px4_fmu-v2'
stash includes: 'build/px4_fmu-v4_default/px4_fmu-v4_default.elf', name: 'px4_fmu-v4_default'
stash includes: 'Tools/HIL/monitor_firmware_upload.py, Tools/HIL/run_tests.py', name: 'scripts-px4_fmu-v4_default'
}
post {
always {
@ -31,10 +31,10 @@ pipeline {
}
}
stage('px4_fmu-v4 (stackcheck)') {
stage('px4_fmu-v4_stackcheck') {
agent {
docker {
image 'px4io/px4-dev-nuttx:2018-11-22'
image 'px4io/px4-dev-nuttx:2019-01-01'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
@ -47,7 +47,7 @@ pipeline {
sh 'make sizes'
sh 'ccache -s'
stash includes: 'build/px4_fmu-v4_stackcheck/px4_fmu-v4_stackcheck.elf', name: 'px4_fmu-v4_stackcheck'
stash includes: 'Tools/HIL/monitor_firmware_upload.py, Tools/HIL/run_tests.py', name: 'scripts-px4_fmu-v4'
stash includes: 'Tools/HIL/monitor_firmware_upload.py, Tools/HIL/run_tests.py', name: 'scripts-px4_fmu-v4_stackcheck'
}
post {
always {
@ -63,29 +63,31 @@ pipeline {
parallel {
stage('px4_fmu-v2') {
stage('px4fmu-v4_default') {
agent {
label 'px4fmu-v2'
label 'px4fmu-v4'
}
steps {
script {
try {
sh 'export'
sh 'find /dev/serial'
unstash 'scripts-px4_fmu-v2'
unstash 'px4_fmu-v2_test'
sh ''' gdb -nx --batch \
-ex "target extended-remote `find /dev/serial -name *Black_Magic_Probe_*-if00`" \
-ex "monitor version" \
-ex "monitor connect_srst enable" \
-ex "monitor swdp_scan" \
-ex "attach 1" \
unstash 'scripts-px4_fmu-v4_default'
unstash 'px4_fmu-v4_default'
sh ''' JLinkGDBServerCLExe -device STM32F427VI -endian little -if SWD -speed auto -noir -LocalhostOnly -silent & \
gdb-multiarch -nx --batch \
-ex "target remote localhost:2331" \
-ex "monitor reset 0" \
-ex "load" \
-ex "monitor compare-sections" \
-ex "monitor reset 0" \
-ex "monitor sleep 1000" \
-ex "monitor go" \
-ex "kill" \
build/px4_fmu-v2_test/px4_fmu-v2_test.elf
build/px4_fmu-v4_default/px4_fmu-v4_default.elf
'''
sh './Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *Black_Magic_Probe_*-if02` --baudrate 57600'
sh './Tools/HIL/run_tests.py --device `find /dev/serial -name *Black_Magic_Probe_*-if02`'
sh './Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-FTDI_TTL232R-3V3_*` --baudrate 57600'
sh './Tools/HIL/run_tests.py --device `find /dev/serial -name *usb-FTDI_TTL232R-3V3_*`'
} catch (Exception err) {
// always report passed for now
currentBuild.result = 'SUCCESS'
@ -97,7 +99,7 @@ pipeline {
}
}
stage('px4_fmu-v4') {
stage('px4fmu-v4_stackcheck') {
agent {
label 'px4fmu-v4'
}
@ -106,20 +108,22 @@ pipeline {
try {
sh 'export'
sh 'find /dev/serial'
unstash 'scripts-px4_fmu-v4'
unstash 'scripts-px4_fmu-v4_stackcheck'
unstash 'px4_fmu-v4_stackcheck'
sh ''' gdb -nx --batch \
-ex "target extended-remote `find /dev/serial -name *Black_Magic_Probe_*-if00`" \
-ex "monitor version" \
-ex "monitor connect_srst enable" \
-ex "monitor swdp_scan" \
-ex "attach 1" \
sh ''' JLinkGDBServerCLExe -device STM32F427VI -endian little -if SWD -speed auto -noir -LocalhostOnly -silent & \
gdb-multiarch -nx --batch \
-ex "target remote localhost:2331" \
-ex "monitor reset 0" \
-ex "load" \
-ex "monitor compare-sections" \
-ex "monitor reset 0" \
-ex "monitor sleep 1000" \
-ex "monitor go" \
-ex "kill" \
build/px4_fmu-v4_stackcheck/px4_fmu-v4_stackcheck.elf
'''
sh './Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *Black_Magic_Probe_*-if02` --baudrate 57600'
sh './Tools/HIL/run_tests.py --device `find /dev/serial -name *Black_Magic_Probe_*-if02`'
sh './Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-FTDI_TTL232R-3V3_*` --baudrate 57600'
sh './Tools/HIL/run_tests.py --device `find /dev/serial -name *usb-FTDI_TTL232R-3V3_*`'
} catch (Exception err) {
// always report passed for now
currentBuild.result = 'SUCCESS'