commandline.test 988 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. . ./testlib.sh
  3. # Initialize one node
  4. $tinc $c1 <<EOF
  5. init foo
  6. set DeviceType dummy
  7. set Port 0
  8. EOF
  9. cat >$d1/tinc-up <<EOF
  10. #!/bin/sh
  11. read pid rest <$d1/pid
  12. (sleep 0.1; kill \$pid) &
  13. EOF
  14. # Test tincd command line options that should work
  15. $tincd $c1 $r1 -D
  16. $tincd $c1 $r1 --no-detach
  17. $tincd $c1 $r1 -D -d
  18. $tincd $c1 $r1 -D -d2
  19. $tincd $c1 $r1 -D -d 2
  20. $tincd $c1 $r1 -D -n foo
  21. $tincd $c1 $r1 -D -nfoo
  22. $tincd $c1 $r1 -D --net=foo
  23. $tincd $c1 $r1 -D --net foo
  24. # Test tincd command line options that should not work
  25. $tincd $c1 $r1 foo && exit 1 || true
  26. $tincd $c1 $r1 --pidfile && exit 1 || true
  27. $tincd $c1 $r1 --foo && exit 1 || true
  28. # Test tinc command line options that should work
  29. $tinc $c1 get name
  30. $tinc $c1 -n foo get name
  31. $tinc $c1 -nfoo get name
  32. $tinc $c1 --net=foo get name
  33. $tinc $c1 --net foo get name
  34. # Test tinc command line options that should not work
  35. $tinc $c1 --net && exit 1 || true
  36. $tinc $c1 --net get name && exit 1 || true
  37. $tinc $c1 foo && exit 1 || true