Don't assume sa.sa_family is a short int.
[tinc] / test / commandline.test
1 #!/bin/sh
2
3 . ./testlib.sh
4
5 # Initialize one node
6
7 $tinc $c1 <<EOF
8 init foo
9 set DeviceType dummy
10 set Port 0
11 EOF
12
13 cat >$d1/tinc-up <<EOF
14 #!/bin/sh
15 read pid rest <$d1/pid
16 (sleep 0.1; kill \$pid) &
17 EOF
18
19 # Test tincd command line options that should work
20
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
30
31 # Test tincd command line options that should not work
32
33 $tincd $c1 $r1 foo && exit 1 || true
34 $tincd $c1 $r1 --pidfile && exit 1 || true
35 $tincd $c1 $r1 --foo && exit 1 || true
36
37 # Test tinc command line options that should work
38
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
44
45 # Test tinc command line options that should not work
46
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