Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Michael Ossmann
0299f70a36 add full path
Some checks failed
Build / host (ubuntu-latest) (push) Failing after 11s
Build / firmware (HACKRF_ONE, ubuntu-latest) (push) Failing after 29s
Build / firmware (JAWBREAKER, ubuntu-latest) (push) Failing after 29s
Check code style / clang-format (push) Failing after 7s
Check code style / clang-format-1 (push) Failing after 5s
Build / firmware (RAD1O, ubuntu-latest) (push) Failing after 32s
Check code style / clang-format-2 (push) Failing after 10s
Check code style / clang-format-3 (push) Failing after 8s
Build / firmware (JAWBREAKER, macos-latest) (push) Has been cancelled
Build / firmware (RAD1O, macos-latest) (push) Has been cancelled
Build / host (macos-latest) (push) Has been cancelled
Build / firmware (HACKRF_ONE, macos-latest) (push) Has been cancelled
2022-09-28 18:36:16 -04:00
Michael Ossmann
cb9b7c0b14 CI: add single-device hackrf_transfer tests 2022-09-28 18:32:08 -04:00
2 changed files with 56 additions and 0 deletions

1
Jenkinsfile vendored
View file

@ -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'
}
}
}

View 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