tinc: update to 1.1pre11
[tomato.git] / release / src / router / tinc / test / commandline.test
blob157eb54c41976a40196c258115ca985aa552ea10
1 #!/bin/sh
3 . ./testlib.sh
5 # Initialize one node
7 $tinc $c1 <<EOF
8 init foo
9 set DeviceType dummy
10 set Port 0
11 EOF
13 cat >$d1/tinc-up <<EOF
14 #!/bin/sh
15 read pid rest <$d1/pid
16 (sleep 0.1; kill \$pid) &
17 EOF
19 # Test tincd command line options that should work
21 $tincd $c1 $r1 -D
22 $tincd $c1 $r1 --no-detach
23 $tincd $c1 $r1 -D -d
24 $tincd $c1 $r1 -D -d2
25 $tincd $c1 $r1 -D -d 2
26 $tincd $c1 $r1 -D -n foo
27 $tincd $c1 $r1 -D -nfoo
28 $tincd $c1 $r1 -D --net=foo
29 $tincd $c1 $r1 -D --net foo
31 # Test tincd command line options that should not work
33 $tincd $c1 $r1 foo && exit 1 || true
34 $tincd $c1 $r1 --pidfile && exit 1 || true
35 $tincd $c1 $r1 --foo && exit 1 || true
37 # Test tinc command line options that should work
39 $tinc $c1 get name
40 $tinc $c1 -n foo get name
41 $tinc $c1 -nfoo get name
42 $tinc $c1 --net=foo get name
43 $tinc $c1 --net foo get name
45 # Test tinc command line options that should not work
47 $tinc $c1 -n foo get somethingreallyunknown && exit 1 || true
48 $tinc $c1 --net && exit 1 || true
49 $tinc $c1 --net get name && exit 1 || true
50 $tinc $c1 foo && exit 1 || true