Compare commits
2 commits
main
...
transfer-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0299f70a36 | ||
|
|
cb9b7c0b14 |
2 changed files with 56 additions and 0 deletions
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 './ci-scripts/test-transfer-single.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
55
ci-scripts/test-transfer-single.sh
Executable file
55
ci-scripts/test-transfer-single.sh
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
echo "Single-device hackrf_transfer tests:"
|
||||
echo "Testing single sample transmit: -c0"
|
||||
COMMAND=host/build/hackrf-tools/src/hackrf_transfer
|
||||
timeout -s2 -k1 2 ${COMMAND} -a0 -x0 -c0 -n1 >/tmp/stdout.$$ 2>/tmp/stderr.$$
|
||||
EXIT_CODE="$?"
|
||||
if [ "$EXIT_CODE" == "124" ]
|
||||
then
|
||||
cat /tmp/stderr.$$
|
||||
echo "Command timed out (SIGINT after 2 seconds)."
|
||||
exit $EXIT_CODE
|
||||
elif [ "$EXIT_CODE" == "137" ]
|
||||
then
|
||||
cat /tmp/stderr.$$
|
||||
echo "Command timed out (SIGKILL after 3 seconds)."
|
||||
exit $EXIT_CODE
|
||||
elif [ "$EXIT_CODE" != "0" ]
|
||||
then
|
||||
cat /tmp/stderr.$$
|
||||
echo "unexpected exit code"
|
||||
exit $EXIT_CODE
|
||||
else
|
||||
echo "hackrf_transfer command completed."
|
||||
fi
|
||||
|
||||
grep -q "Couldn't transfer any bytes for one second." /tmp/stderr.$$
|
||||
if [ "$?" == "0" ]
|
||||
then
|
||||
cat /tmp/stderr.$$
|
||||
exit 1
|
||||
fi
|
||||
|
||||
grep -q "average power -inf dBfs" /tmp/stderr.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stderr.$$
|
||||
"unexpected power level"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
grep -q "^ 0.0 MiB" /tmp/stderr.$$
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
cat /tmp/stderr.$$
|
||||
"unexpected total data transferred"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
if [ -s "/tmp/stdout.$$" ]
|
||||
then
|
||||
cat /tmp/stderr.$$
|
||||
"unexpected stdout:"
|
||||
cat /tmp/stdout.$$
|
||||
exit 4
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue