| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
tests=() |
| 6 |
|
| 7 |
if [ -x "$(pwd)debian/libreswan/usr/libexec/ipsec/cavp" ] ; then |
| 8 |
cavp="$(pwd)debian/libreswan/usr/libexec/ipsec/cavp" |
| 9 |
echo "Testing built CAVP binary: $cavp" |
| 10 |
else |
| 11 |
cavp=/usr/libexec/ipsec/cavp |
| 12 |
echo "Testing installed CAVP binary: $cavp" |
| 13 |
fi |
| 14 |
|
| 15 |
workdir=$(mktemp -d) |
| 16 |
cd "$workdir" |
| 17 |
|
| 18 |
wget --quiet https://download.libreswan.org/cavs/{ikev1_dsa,ikev1_psk,ikev2}.fax.bz2 |
| 19 |
bunzip2 *.fax.bz2 |
| 20 |
|
| 21 |
"$cavp" -v2 ikev2.fax | diff -u ikev2.fax - > /dev/null |
| 22 |
"$cavp" -v1dsa ikev1_dsa.fax | diff -u ikev1_dsa.fax - > /dev/null |
| 23 |
"$cavp" -v1psk ikev1_psk.fax | diff -u ikev1_psk.fax - > /dev/null |
| 24 |
|
| 25 |
cd - |
| 26 |
rm -rf "$workdir" |