test-example: Provide test which uses unshare(8)
[secnet] / test-example / README
CommitLineData
0cf9c062
IJ
1This directory contains some files useful for ad-hoc tests.
2With these it is possible to run a test of secnet on a Linux host
3even if that Linux host does not have another working network connection.
4
5The keys here are (obviously) public. They were generated like this:
6 ssh-keygen -C inside@example.com -f test-example/inside.key -t rsa1 -b 1024
7 ssh-keygen -C outside@example.com -f test-example/outside.key -t rsa1 -b 1024
8 # edit sites to paste {inside,outside}.key.pub into pubkey lines
9 base64 <inside.key >inside.key.b64
10 base64 <outside.key >outside.key.b64
11
12To run the test:
13 Run the makefile:
14 make -C test-example/
15 In one window, as root
16 ./secnet -dvnc test-example/inside.conf
17 And in another
18 ./secnet -dvnc test-example/outside.conf
19 Then in a third
20 ping -I secnet-test-i 172.18.232.2
21
a3289567
IJ
22For running under valgrind memcheck, do something like this:
23 valgrind --num-callers=40 --gen-suppressions=yes --db-attach=yes \
24 --leak-check=full --suppressions=test-example/memcheck.suppressions \
25 ./secnet -dvnc test-example/outside.conf
26NB that --num-callers is needed as secnet's stack can be deep.
abf665fc
IJ
27
28The config file outside-unshare.conf can be used on Linux in
29conjunction with test-example/fake-userv and a built checkout of
30userv-utils.git to run the "outside" copy of secnet in a new "network
31namespace".