Merge pull request #1233 from grvvy/ci_hackrf_debug
CI: add hackrf_debug test
This commit is contained in:
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@ -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'
|
||||
}
|
||||
|
37
ci-scripts/test-debug.py
Normal file
37
ci-scripts/test-debug.py
Normal file
@ -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(["host/build/hackrf-tools/src/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()
|
Reference in New Issue
Block a user