To compile the test you will need cmocka installed on system.
Checks in configure.ac are still missing.
$ cd tinc/test/; make simple
to generate testing directory you can use cmocka-simple.sh
$ ./cmocka-simple.sh
‘mocks/conf1’ -> ‘/tmp/tmp.PtS9r796ns/conf1’
To run the test do: cd /tmp/tmp.PtS9r796ns ; ./simple
$ ./simple
[==========] Running 6 test(s).
[ RUN ] test_edge_init
0 != 0x2
simple.c:73: error: Failure!
[ FAILED ] test_edge_init
[ RUN ] test_read_config_file
[ OK ] test_read_config_file
[ RUN ] test_config_add_item
[ OK ] test_config_add_item
[ RUN ] test_config_add_item_no_filename
value
simple.c:234: error: Failure!
[ FAILED ] test_config_add_item_no_filename
[ RUN ] test_splay_tree_init
[ OK ] test_splay_tree_init
[ RUN ] test_splay_tree_basic
[ OK ] test_splay_tree_basic
[==========] 6 test(s) run.
[ PASSED ] 4 test(s).
[ FAILED ] 2 test(s), listed below:
[ FAILED ] test_edge_init
[ FAILED ] test_config_add_item_no_filename
2 FAILED TEST(S)
This uses the portable Ed25519 library made by Orson Peters, which in turn uses
the reference implementation made by Daniel J. Bernstein.
This implementation also allows Ed25519 keys to be used for key exchange, so
there is no need to add a separate implementation of Curve25519.
Testing multiple daemons connecting to each other on the same computer is
usually difficult, because connections to local IP addresses will bypass most
of the network stack. However, recent versions of Linux support network
namespaces, which can isolate network interfaces. We use this to isolate the
virtual interface of the daemons from each other, so we get the behaviour as if
the daemons were each running on their own machine. This can also be used for
more complicated tests (including those with firewall rules) without disturbing
the real network setup of the host computer.
This is a more complicated test with one tinc daemon using a tap interface
(therefore requiring root), and a second one using a multicast interface. A
separate program "pong" is listening on the same multicast address, and waits
for ARP and ICMP packets, responding to ICMP echo packets with replies.
This test doesn't require any configuration of the tap interface.
It now defers reading from stdin until after the authentication phase is
completed. Furthermore, it supports the -q, -r, -w options similar to those of
Jürgen Nickelsen's socket.