GitHub CI: update list of container images
[tinc] / test / commandline.test
1 #!/bin/sh
2
3 . "${0%/*}/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 cat >$d1/tinc-up.cmd <<EOF
20 start /min ../$tinc $c1 stop
21 EOF
22
23 # Test tincd command line options that should work
24
25 $tincd $c1 $r1 -D
26 $tincd $c1 $r1 --no-detach
27 $tincd $c1 $r1 -D -d
28 $tincd $c1 $r1 -D -d2
29 $tincd $c1 $r1 -D -d 2
30 $tincd $c1 $r1 -D -n foo
31 $tincd $c1 $r1 -D -nfoo
32 $tincd $c1 $r1 -D --net=foo
33 $tincd $c1 $r1 -D --net foo
34
35 # Test tincd command line options that should not work
36
37 $tincd $c1 $r1 foo && exit 1 || true
38 $tincd $c1 $r1 --pidfile && exit 1 || true
39 $tincd $c1 $r1 --foo && exit 1 || true
40
41 # Test tinc command line options that should work
42
43 $tinc $c1 get name
44 $tinc $c1 -n foo get name
45 $tinc $c1 -nfoo get name
46 $tinc $c1 --net=foo get name
47 $tinc $c1 --net foo get name
48
49 # Test tinc command line options that should not work
50
51 $tinc $c1 -n foo get somethingreallyunknown && exit 1 || true
52 $tinc $c1 --net && exit 1 || true
53 $tinc $c1 --net get name && exit 1 || true
54 $tinc $c1 foo && exit 1 || true