Commit Graph

6 Commits

Author SHA1 Message Date
Harald Welte 67881aef23 Avoid generating zero-length packets
I used the construct like f_rnd_octstring(f_rnd_int(100)) in a number
of places to generate random-length packets with randomized length.

The problem I didn't realize is that f_rnd_int() of course can also
return '0', which would generate zero-length packets.  This may be
permitted in some protocols, but it leads to problems e.g. when trying
to send a UDP packet of zero length (which the kernel will not do).

So let's introduce
* f_rnd_int_nonzero() for returning non-zero randomized integers
* f_rnd_octstring_rnd_len() for returning a random-length random payload
  octet string
* replace all f_rnd_octstring(f_rnd_int()) call sites with the new
  function.

Change-Id: I818a113ff8d2a2f7cab2ec7d9c8661607c6331d6
Closes: OS#5528
2022-04-12 22:52:47 +02:00
Oliver Smith f8fe1329e2 regen_makefile.sh: set executable name explicitly
Set the executable name in each regen_makefile.sh explicitly with -e,
instead of having it set indirectly from the first .ttcn file. Make it
consistent by placing the name on top of each of these files.

Fix for warning:
ttcn3_makefilegen: warning: File `BSC_Tests.ttcn' was given more than once for the Makefile.

Related: OS#5252
Change-Id: I5ed03f8f3ed905483620dc7bae33b617bbb8507f
2021-10-13 11:12:22 +02:00
Oliver Smith 2e0e624060 regen_makefile.sh: files/flags in separate lines
Make all regen_makefile.sh more readable and diff friendly by moving
each entry in FILES and CPPFLAGS_TTCN3 into separate lines. Order
entries alphabetically.

Related: OS#5252
Change-Id: I6b6866eb9f6ec6232e4ae434517457a4c8c1c050
2021-10-12 16:35:01 +02:00
Oliver Smith 594b4ffa2c pcap-client: set VTY port to 4227
Adjust the VTY port to the new default, 4227, in case somebody uses the
configs from this repository instead of the ones from
docker-playground.git (where it is also adjusted).

Depends: docker-playground I6d45340429925fe5e98cc4e597a01ef51e8322ae
Change-Id: I50af5d0c0930b9bc906a8b909910bc38f025648e
2021-08-09 09:03:01 +02:00
Harald Welte 1c8d16c570 pcap-client: Don't bind to second 'traffic' udp port
if the tester runs on a different host/IP than the IUT (like in our
dockerized jenkins tests), then of course we cannot assume that
traffic sent by the tester can be received by the tester again.

So rather than binding/connecting two sockets, let's only use one
and send packets without caring if there is a remote receiver.

Change-Id: If826705c78c7a0ad0e633b7a320d7dd5e5561c27
2021-04-25 13:06:35 +02:00
Harald Welte c4ac9e0fe3 Initial test suite for osmo-pcap-client
Change-Id: If4a1072e75cb64f785d660e4c828c0f521d84b16
2021-04-24 12:43:48 +02:00