ttcn3-tcpdump-start.sh: Avoid using dumpcap if it has no access to pcap parent dir

dumpcap seems to be opening the pcap file it writes to *after* dropping
privileges, which means even if running it as root, it will fail to
create the pcap file inside a directory where that same user (even if
root) doesn't have write+execute permissions.

This is exactly what happens when one tries to run the
ttcn3-tcmpdump-start.sh script inside docker with "--cap-add=NET_ADMIN
--cap-add=SYS_RESOURCE" and root user, where it then tells dumpcap to
write to a volume mounted inside docker which was created by the user
outside user, hence with UID=1000 instead of UID=0 inside docker.

Since tcpdump works fine in this setup, simply skip using dumpcap if it
would fail to create the pcap file.

Related: OS#6455
Change-Id: If8ea5bb62f4866042761d3e08fe83179bf10c75a
1 file changed
tree: 0b263f77983577a53fbcff6a47ecb8524ec51d8a
  1. .github/
  2. asn-test/
  3. asterisk/
  4. bin/
  5. bsc/
  6. bsc-nat/
  7. bts/
  8. cbc/
  9. ccid/
  10. COMMON/
  11. deps/
  12. dia2gsup/
  13. doc/
  14. epdg/
  15. fr/
  16. fr-net/
  17. gbproxy/
  18. ggsn_tests/
  19. hlr/
  20. hnbgw/
  21. hnodeb/
  22. hss/
  23. ipad/
  24. lapdm/
  25. library/
  26. mgw/
  27. mme/
  28. msc/
  29. ns/
  30. pcap-client/
  31. pcu/
  32. pgw/
  33. remsim/
  34. ROHC_CNL113426_LATEST/
  35. sccp/
  36. SCCP_Test/
  37. selftest/
  38. sgsn/
  39. simtrace/
  40. sip/
  41. smlc/
  42. stp/
  43. sysinfo/
  44. upf/
  45. .checkpatch.conf
  46. .gitignore
  47. .gitreview
  48. Common.cfg
  49. compare-results.py
  50. gen_links.sh.inc
  51. log_merge.sh
  52. Makefile
  53. mask_expected_results.sh
  54. README.md
  55. regen-makefile.sh
  56. rmlinks.sh
  57. start-testsuite.sh
  58. ttcn3-dumpcap-start.sh
  59. ttcn3-dumpcap-stop.sh
  60. ttcn3-tcpdump-start.sh
  61. ttcn3-tcpdump-stop.sh
  62. update_expected_results_from_jenkins.sh
README.md

Osmocom TTCN-3 Test Suites

This repository contains a collection of test suites developed within the Osmocom (Open Source Mobile Communications) project. The test suites are developed in the TTCN-3 programming language, compiled/executed by the Eclipse TITAN compiler and runtime.

Those test suites mostly are performing functional testing of cellular network elements, from 2G, 3G, 4G to 5G. The individual test-suites are in sub-directories, while some shared library code is in library.

Continuous Integration

The individual tests suites are executed against different versions of the respective IUT (Implementation Under Test) by the Osmocom jenkins.

See the list of all TTCN-3 jenkins jobs for more details

Further reading

Some more information about those test suites can be found at https://osmocom.org/projects/cellular-infrastructure/wiki/Titan_TTCN3_Testsuites.