Add stricter checks for netnames.
[tinc] / test / algorithms.test
1 #!/bin/sh
2
3 . ./testlib.sh
4
5 # Initialize two nodes
6
7 $tinc $c1 <<EOF
8 init foo
9 set DeviceType dummy
10 set Port 32755
11 set Address localhost
12 set ExperimentalProtocol no
13 EOF
14
15 $tinc $c2 <<EOF
16 init bar
17 set DeviceType dummy
18 set Port 0
19 set ExperimentalProtocol no
20 EOF
21
22 # Exchange configuration
23
24 $tinc $c1 export | $tinc $c2 exchange | $tinc $c1 import
25 $tinc $c2 add ConnectTo foo
26 $tinc $c1 start $r1
27
28 # Test various ciphers and digests
29
30 for digest in none md5 sha1 sha256 sha512; do
31         for cipher in none bf-cbc aes-128-cbc aes-256-cbc camellia-128-cbc camellia-256-cbc; do
32                 echo Testing $cipher $digest
33                 $tinc $c2 <<EOF
34 set Digest $digest
35 set Cipher $cipher
36 EOF
37
38                 $tinc $c2 start $r2
39                 sleep 2;
40                 $tinc $c1 info bar
41                 $tinc $c1 info bar | grep -q 'directly with UDP'
42                 $tinc $c2 stop
43         done
44 done
45
46 $tinc $c1 stop