From 394168a475531f555c652cbd3ad9cd169365e635 Mon Sep 17 00:00:00 2001 From: grvvy Date: Wed, 23 Nov 2022 14:20:34 -0700 Subject: [PATCH 1/2] CI: add hackrf_debug test --- Jenkinsfile | 1 + ci-scripts/test-debug.py | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 ci-scripts/test-debug.py diff --git a/Jenkinsfile b/Jenkinsfile index cb7f9d61..ddfe64d7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,6 +25,7 @@ pipeline { sh './ci-scripts/test-firmware-program.sh' } sh './ci-scripts/test-firmware-flash.sh' + sh 'python3 ci-scripts/test-debug.py' sh 'python3 ci-scripts/test-transfer.py tx' sh 'python3 ci-scripts/test-transfer.py rx' } diff --git a/ci-scripts/test-debug.py b/ci-scripts/test-debug.py new file mode 100644 index 00000000..18f0fa9c --- /dev/null +++ b/ci-scripts/test-debug.py @@ -0,0 +1,37 @@ +#!/usr/bin/python3 +import sys +import subprocess + +PASS, FAIL = range(2) +EUT = "RunningFromRAM" + + +def check_debug(target, register, reg_val): + hackrf_debug = subprocess.run(["hackrf_debug", + f"--{target}", "--register", register, + "--read", "--device", EUT], + capture_output=True, encoding="UTF-8") + + if reg_val in hackrf_debug.stdout: + print(f"hackrf_debug --{target} passed.") + return PASS + else: + print(f"hackrf_debug --{target} failed.") + return FAIL + + +def main(): + results = [ + check_debug("si5351c", "2", "0x03"), + check_debug("max2837", "3", "0x1b9"), + check_debug("rffc5072", "2", "0x9055"), + ] + + if FAIL not in results: + sys.exit(PASS) + else: + sys.exit(FAIL) + + +if __name__ == "__main__": + main() From 1f5a88b400f9c9fc48f0cce7ec618ea719358657 Mon Sep 17 00:00:00 2001 From: grvvy Date: Wed, 23 Nov 2022 14:29:48 -0700 Subject: [PATCH 2/2] CI: add full path to hackrf_debug call --- ci-scripts/test-debug.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/test-debug.py b/ci-scripts/test-debug.py index 18f0fa9c..26c4cd11 100644 --- a/ci-scripts/test-debug.py +++ b/ci-scripts/test-debug.py @@ -7,7 +7,7 @@ EUT = "RunningFromRAM" def check_debug(target, register, reg_val): - hackrf_debug = subprocess.run(["hackrf_debug", + hackrf_debug = subprocess.run(["host/build/hackrf-tools/src/hackrf_debug", f"--{target}", "--register", register, "--read", "--device", EUT], capture_output=True, encoding="UTF-8")