Osmocom test suites in TTCN-3 (Eclipse Titan) https://osmocom.org/projects/core-testing-infra
Go to file
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
COMMON initial chekin of code received by Ericsson on 20170410 2017-04-12 12:13:44 +02:00
ROHC_CNL113426_LATEST import Ericsson NS, ISUP, ROHC and SNDCP modules for TITAN 2017-07-25 08:23:52 +02:00
SCCP_Test regen_makefile.sh: set executable name explicitly 2021-10-13 11:12:22 +02:00
asn-test HNBAP, RUA and RANAP protocol codecs 2019-04-25 20:07:11 +00:00
bin Remove M3UA/MTP3/SCCP code from this repo, use upstream repos 2018-03-18 12:52:20 +01:00
bsc bsc: fix sccplite test fallout: deactivate as_Media in f_ho_into_this_bsc() 2022-04-12 01:53:00 +02:00
bsc-nat ran emulation: allow multiple reset attempts 2022-03-31 17:49:10 +00:00
bts BTS_Tests: tune waiting timeout in TC_rsl_ms_pwr_dyn_up 2022-04-11 12:04:21 +00:00
cbc regen_makefile.sh: set executable name explicitly 2021-10-13 11:12:22 +02:00
ccid ccid: Lots of CCID helpers have been moved to titan.TestPorts.USB 2022-02-25 16:56:16 +01:00
deps ccid: Lots of CCID helpers have been moved to titan.TestPorts.USB 2022-02-25 16:56:16 +01:00
doc doc: Always annotate codec port types in case of IPL4/UD ports 2021-12-22 14:24:50 +00:00
fr Avoid generating zero-length packets 2022-04-12 22:52:47 +02:00
fr-net Start BSSGP_CT and NS_CT as alive-type component in all testsuites 2022-02-24 11:47:43 +00:00
gbproxy Use alive-type components for "infrastructure" components 2021-12-15 20:20:30 +00:00
ggsn_tests ggsn: Initial testing of open5gs Gy interface 2022-04-11 12:04:55 +00:00
hlr regen_makefile.sh: set executable name explicitly 2021-10-13 11:12:22 +02:00
hnbgw fix sgsn and hnbgw test issue introduced in 49888a65dc 2022-04-02 19:38:52 +00:00
hnodeb Iuh_Emulation: Introduce Iuh_ConnHdlr component type 2022-02-11 15:27:11 +01:00
lapdm regen_makefile.sh: set executable name explicitly 2021-10-13 11:12:22 +02:00
library Avoid generating zero-length packets 2022-04-12 22:52:47 +02:00
mgw mgw: Introduce test TC_two_crcx_mdcx_and_iuup_rtp 2022-01-17 09:11:21 +00:00
mme lib/DIAMETER: Allow sending CEA with AuthAppId 2022-03-14 12:05:37 +01:00
msc ran emulation: allow multiple reset attempts 2022-03-31 17:49:10 +00:00
ns ns: fr: fix ttcn & osmo-ns-dummy.cfg 2021-10-19 18:44:50 +02:00
pcap-client Avoid generating zero-length packets 2022-04-12 22:52:47 +02:00
pcu pcu: Introduce test TC_dl_llc_sapi_priority 2022-04-05 10:22:14 +00:00
pgw pgw: Don't expect Gx messages during delete of unknwon session 2022-04-11 16:50:41 +00:00
remsim Avoid generating zero-length packets 2022-04-12 22:52:47 +02:00
sccp Avoid generating zero-length packets 2022-04-12 22:52:47 +02:00
selftest regen_makefile.sh: set executable name explicitly 2021-10-13 11:12:22 +02:00
sgsn fix sgsn and hnbgw test issue introduced in 49888a65dc 2022-04-02 19:38:52 +00:00
simtrace move SIMTRACE_{Types,Templates,Emulation}.ttcn to library 2022-02-25 16:56:16 +01:00
sip regen_makefile.sh: set executable name explicitly 2021-10-13 11:12:22 +02:00
smlc regen_makefile.sh: set executable name explicitly 2021-10-13 11:12:22 +02:00
stp Avoid generating zero-length packets 2022-04-12 22:52:47 +02:00
sysinfo regen_makefile.sh: set executable name explicitly 2021-10-13 11:12:22 +02:00
.gitignore .gitignore sms.db 2021-08-06 14:03:28 +00:00
.gitreview Add git-review config 2017-12-13 11:15:48 +01:00
Common.cfg Common.cfg: Always log VEERDICTOP on Console 2020-10-10 18:15:37 +02:00
Makefile Makefile: Include hnbgw in SUBDIRS 2022-02-17 16:09:41 +00:00
compare-results.py compare_results.py: use ansi colors 2020-05-19 19:25:35 +00:00
gen_links.sh.inc gen_links.sh.inc: Fix globbing writing '*.ttcn' to */.gitignore 2022-03-22 17:49:55 +00:00
log_merge.sh Put build / run scripts under Apache 2.0 license 2019-06-21 09:34:09 +00:00
mask_expected_results.sh add mask_expected_results.sh 2018-04-11 19:32:01 +02:00
regen-makefile.sh regen_makefile.sh: files/flags in separate lines 2021-10-12 16:35:01 +02:00
rmlinks.sh Remove M3UA/MTP3/SCCP code from this repo, use upstream repos 2018-03-18 12:52:20 +01:00
start-testsuite.sh start-testsuite.sh: allow overriding TTCN3_BIN_DIR 2020-05-29 06:10:42 +00:00
ttcn3-dumpcap-start.sh ttcn3-dumpcap-start.sh: Always capture lo interface 2020-12-12 16:28:30 +01:00
ttcn3-dumpcap-stop.sh gbproxy: Properly capture HDLC/FR traffic in addition to ethernet 2020-12-11 15:32:08 +01:00
ttcn3-tcpdump-start.sh ttcn3-tcpdump-start.sh: don't hardcode binary paths 2021-12-16 12:17:45 +00:00
ttcn3-tcpdump-stop.sh ttcn3-tcpdump-stop: add timeout for talloc report 2021-12-17 12:25:29 +01:00
update_expected_results_from_jenkins.sh Put build / run scripts under Apache 2.0 license 2019-06-21 09:34:09 +00:00