mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-02-19 16:22:52 +01:00
CI: test CLKOUT and CLKIN
This commit is contained in:
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -25,6 +25,8 @@ pipeline {
|
||||
sh './ci-scripts/test-firmware-program.sh'
|
||||
}
|
||||
sh './ci-scripts/test-firmware-flash.sh'
|
||||
sh './ci-scripts/test-clkin.sh'
|
||||
sh './ci-scripts/test-clkout.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
57
ci-scripts/test-clkin.sh
Executable file
57
ci-scripts/test-clkin.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configuration for EUT and TESTER devices
|
||||
# FIXME: move to Dockerfile or somewhere
|
||||
EUT=RunningFromRAM
|
||||
TESTER=0000000000000000325866e629a25623
|
||||
EUT_HUB=D9D1
|
||||
EUT_PORT=2
|
||||
TESTER_HUB=624C
|
||||
TESTER_PORT=2
|
||||
|
||||
COMMAND=host/build/hackrf-tools/src/hackrf_clock
|
||||
|
||||
# Power on USB ports for both EUT and TESTER
|
||||
usbhub --disable-i2c --hub ${EUT_HUB} power state --port ${EUT_PORT} --on
|
||||
usbhub --disable-i2c --hub ${TESTER_HUB} power state --port ${TESTER_PORT} --on
|
||||
sleep 1
|
||||
|
||||
echo "Activating CLKOUT"
|
||||
${COMMAND} -d ${TESTER} -o1 >/tmp/stdout.$$ 2>/tmp/stderr.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stdout.$$
|
||||
cat /tmp/stderr.$$
|
||||
echo "hackrf_clock command failed."
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
${COMMAND} -d ${EUT} -i >/tmp/stdout.$$ 2>/tmp/stderr.$$
|
||||
|
||||
grep -q ": clock signal detected" /tmp/stdout.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stdout.$$
|
||||
cat /tmp/stderr.$$
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Deactivating CLKOUT"
|
||||
${COMMAND} -d ${TESTER} -o0 >/tmp/stdout.$$ 2>/tmp/stderr.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stdout.$$
|
||||
cat /tmp/stderr.$$
|
||||
echo "hackrf_clock command failed."
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
${COMMAND} -d ${EUT} -i >/tmp/stdout.$$ 2>/tmp/stderr.$$
|
||||
|
||||
grep -q ": no clock signal detected" /tmp/stdout.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stdout.$$
|
||||
cat /tmp/stderr.$$
|
||||
exit 3
|
||||
fi
|
||||
57
ci-scripts/test-clkout.sh
Executable file
57
ci-scripts/test-clkout.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configuration for EUT and TESTER devices
|
||||
# FIXME: move to Dockerfile or somewhere
|
||||
EUT=RunningFromRAM
|
||||
TESTER=0000000000000000325866e629a25623
|
||||
EUT_HUB=D9D1
|
||||
EUT_PORT=2
|
||||
TESTER_HUB=624C
|
||||
TESTER_PORT=2
|
||||
|
||||
COMMAND=host/build/hackrf-tools/src/hackrf_clock
|
||||
|
||||
# Power on USB ports for both EUT and TESTER
|
||||
usbhub --disable-i2c --hub ${EUT_HUB} power state --port ${EUT_PORT} --on
|
||||
usbhub --disable-i2c --hub ${TESTER_HUB} power state --port ${TESTER_PORT} --on
|
||||
sleep 1
|
||||
|
||||
echo "Activating CLKOUT"
|
||||
${COMMAND} -d ${EUT} -o1 >/tmp/stdout.$$ 2>/tmp/stderr.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stdout.$$
|
||||
cat /tmp/stderr.$$
|
||||
echo "hackrf_clock command failed."
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
${COMMAND} -d ${TESTER} -i >/tmp/stdout.$$ 2>/tmp/stderr.$$
|
||||
|
||||
grep -q ": clock signal detected" /tmp/stdout.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stdout.$$
|
||||
cat /tmp/stderr.$$
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Deactivating CLKOUT"
|
||||
${COMMAND} -d ${EUT} -o0 >/tmp/stdout.$$ 2>/tmp/stderr.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stdout.$$
|
||||
cat /tmp/stderr.$$
|
||||
echo "hackrf_clock command failed."
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
${COMMAND} -d ${TESTER} -i >/tmp/stdout.$$ 2>/tmp/stderr.$$
|
||||
|
||||
grep -q ": no clock signal detected" /tmp/stdout.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stdout.$$
|
||||
cat /tmp/stderr.$$
|
||||
exit 3
|
||||
fi
|
||||
Reference in New Issue
Block a user