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