Restore libgcrypt support.
[tinc] / test / algorithms.test
1 #!/bin/sh
2
3 . ./testlib.sh
4
5 echo [STEP] Initialize two nodes
6
7 tinc foo <<EOF
8 init foo
9 set DeviceType dummy
10 set Port 30070
11 set Address localhost
12 set ExperimentalProtocol no
13 EOF
14
15 tinc bar <<EOF
16 init bar
17 set DeviceType dummy
18 set Port 0
19 set ExperimentalProtocol no
20 EOF
21
22 create_script foo hosts/bar-up
23 create_script bar hosts/foo-up
24
25 echo [STEP] Exchange configuration
26
27 tinc foo export | tinc bar exchange | tinc foo import
28 tinc bar add ConnectTo foo
29 start_tinc foo
30
31 echo [STEP] Test various ciphers and digests
32
33 # The full suite results in a large test matrix and it takes a lot of time to run.
34 # The list was reduced to the strongest available algorithms (and "none").
35 digests="none sha256 sha512"
36 ciphers="none aes-256-cbc"
37
38 for digest in $digests; do
39   for cipher in $ciphers; do
40     echo "Testing $cipher $digest"
41
42     tinc bar <<EOF
43 set Digest $digest
44 set Cipher $cipher
45 EOF
46
47     start_tinc bar
48     wait_script foo hosts/bar-up
49     wait_script bar hosts/foo-up
50
51     tinc foo info bar | grep reachable
52
53     tinc bar stop
54   done
55 done