| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
if [ -x OBJ.*/programs/algparse/algparse ] ; then |
| 6 |
algparse=OBJ.*/programs/algparse/algparse |
| 7 |
pluto=OBJ.*/programs/pluto/pluto |
| 8 |
printf "Testing built binary: %s\n" $algparse $pluto |
| 9 |
else |
| 10 |
algparse=/usr/libexec/ipsec/algparse |
| 11 |
pluto=/usr/libexec/ipsec/pluto |
| 12 |
printf "Testing installed binary: %s\n" $algparse $pluto |
| 13 |
fi |
| 14 |
|
| 15 |
|
| 16 |
printf "testing -tp\n" |
| 17 |
$algparse -v --debug -tp || { echo prooposal test failed; exit 1; } |
| 18 |
printf "testing -ta\n" |
| 19 |
$algparse -v --debug -ta || { echo algorithm test failed; exit 1; } |
| 20 |
tmpdir=$(mktemp -d) |
| 21 |
printf "initializing NSS db\n" |
| 22 |
certutil -N -d "sql:$tmpdir" --empty-password |
| 23 |
printf "running pluto selftest\n" |
| 24 |
$pluto --selftest --nssdir "$tmpdir" --rundir "$tmpdir" |
| 25 |
rm -rf "$tmpdir" |