CI: test CLKOUT and CLKIN

This commit is contained in:
Michael Ossmann
2022-10-12 15:05:03 -04:00
parent e3e406491d
commit e5e5fbdbee
3 changed files with 116 additions and 0 deletions

2
Jenkinsfile vendored
View File

@@ -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
View 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
View 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