Commit Graph

34 Commits

Author SHA1 Message Date
Vadim Yanitskiy c041e9902f library/Osmocom_Types: use f_rnd_bitstring() in f_rnd_ra11_ps()
Change-Id: I122d386b0c8ce320687016b6cab883b8a36bdffc
2021-12-11 02:11:35 +03:00
Vadim Yanitskiy 6a2a11ff4c library/Osmocom_Types: fix maximum values passed to f_rnd_int()
It's clearly stated in a comment to this function that the returned
value is 0 <= x < max, so it's always less than the maximum.

Change-Id: If127fc6a2feeddbdd3ea636b56dadf8957941758
2021-12-11 02:08:46 +03:00
Harald Welte b5688f26ed gbproxy: Verify BVC FSM state during bring-up
This adds IUT fsm state instrospection via the CTRL interface.

docker-playground will need to set "mp_gbproxy_ip" in its configs.

Change-Id: I272e43b9be8ba53d8a815e8ab099c939f63413a7
2021-04-01 18:25:31 +02:00
Harald Welte daf89681c4 NS_Emulation: Avoid g_unblocked_nsvcs_* overflowing
Sometimes we run into situations where the g_unblocked_nsvcs_* is
exceeding the number of NSVCs we have in g_nsvcs.  This can only happen
as we blindly append integers to the ro_integer fields, rather than
checking if they are already contained.

Let's factor out the add_unique and del functions (in Osmocom_Types)
and use them from NS_Emulation.

Change-Id: Ib3273d6ce9b80f700c964d578fdb0f268eac6a14
2021-02-04 17:11:30 +01:00
Harald Welte aaa0dfdd3f Move "ro_integer" to Osmocom_Types
We don't need several re-definitions of a "record of integer" type,
plus associated helper functions.  Let's move that to the shared
Osmocom_Types.ttcn

Change-Id: I6a68ab8180a40b93c540db9cb80941c39c2fb549
2021-02-04 17:11:30 +01:00
Harald Welte 3f10c62331 Osmocom_Types: fix formatting of log line (missing ", ")
Change-Id: If4555cd2902e056b32e835daa741ee84b346b922
2021-01-18 19:55:03 +01:00
Harald Welte bf3976185a Add f_gen_tmsi() to generate a TMSI similar to f_gen_{imsi,imei}()
... and start to use it from BSC_Tests.ttcn

Related: OS#4472, SYS#5002
Change-Id: Iacba62bb740374c28cbcf50d54ba1814c5b4e1c2
2021-01-16 22:50:21 +01:00
Vadim Yanitskiy 1acc7bb184 library: move Osmocom_Types.Arfcn to GSM_Types.GsmBandArfcn
In some cases GsmArfcn itself is not enough.  It case of L1CTL
and GSMTAP, it needs to be equipped with a band discriminator:

  - DCS / PCS (as the numbers may overlap),
  - Downlink / Uplink (not yet there).

Let's rename this record and move it to GSM_Types.  Also, add
send / receive tamplates, so we can add new fields later.

Change-Id: I7a63f03bbd15a06caafb786122dc12991d115771
2020-11-24 11:58:49 +01:00
Harald Welte 69b3a4839f move f_gen_{imsi,imei,msisdn} from L3_Templates to Osmocom_Types
Those functions don't depend on any L3 specific data structurs, and
it is not a good idea to burden every user with having to impot all
of a 2G/3G Layer3 just to generate some hexstring identifiers.

Change-Id: I7880633a46afc607f16f8aa6ea1a277f7958c95b
2020-11-12 21:51:40 +01:00
Alexander Couzens e0f7c543b7 NS_Emulation: remove dependency on PCUIF_Types
The dependency of PCUIF_Types creates also a dependency on

Replace the PCU_AddrType by an unix like address family defined
in the Osmocom_Types to reduce the dependency.

Change-Id: I0b4fda96accef401ffc009010f9f5621583fd6dd
2020-09-17 23:29:16 +02:00
Alexander Couzens 4231de67fc library: Osmocom_Types: fix extra indention tab
The top level context doesn't have an indent.

Change-Id: Ib94fa74a7752f21ba8203a5de17ce2b10d800d16
2020-09-11 20:24:19 +02:00
Vadim Yanitskiy 27057e0e23 library/Osmocom_Types: fix f_rnd_ra_cs(): ensure non-emergency RA
Change-Id: Idbb2a2c7c2024adea5ff5ee639aeca6eab8ebb3b
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy 146efe6391 library/Osmocom_Types: fix: '10111111'B is a valid emergency RA
Most likely, the second part of the condition was copy-pasted
from ra_is_ps(), where the specs. require that at least one
of the three LSB's shall be zero.  This requirement does not
apply to emergency RA values in range '101xxxxx'B.

Change-Id: I4c923682edfeee9c6bf3aeeeb67438809a54109f
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy 6f9f7d2662 library/Osmocom_Types: share RA generation helpers from BTS_Tests
Change-Id: I7c9c3d243b39bbd3d521009d23c1043df729ee10
2020-08-28 05:56:39 +07:00
Neels Hofmeyr f793a7e464 comment: Osmocom_Types.ttcn: clarify f_rnd_int() return val
Change-Id: I0841b037d39fcadb75e1c13cf97d22917b68e2aa
2020-08-13 05:36:26 +00:00
Vadim Yanitskiy a01a05531c library/Osmocom_Types: add f_rnd_bitstring() and f_pad_bit()
Change-Id: I9be55f6979c8ce1cbf5b2ef317c998ae30488e0e
2020-07-21 16:14:20 +00:00
Vadim Yanitskiy 12cf3d908a BTS: manually compose Rest Octets for SI Type 3 and 4
Finally, we can get rid of hard-coded octetstrings and control
every field of the Rest Octets we're sending to the IUT.

Note that template 'ts_SI4_default' did not contain any Rest
Octets at all, thus the GPRS indicator was (and still is)
absent. This will be fixed in a follow up change.

Change-Id: I0a95b34b495267edf1f48692e24fcd5ede8ccdd1
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-06 02:26:03 +07:00
Harald Welte 88b3ccbf5b Add GTPv2_Emulation component
Change-Id: If73aa453e44ebf28032c60d207feb03e8061dc0c
2020-04-21 22:57:31 +02:00
Vadim Yanitskiy a52347ca32 library/GSUP_Types.ttcn: fix MSISDN / SMSC coding in SM-RP-OA/DA
Unlike IMSI, both MSISDN and SMSC address in SM-RP-OA/DA not only
contain the BCD encoded digits, but also a little header with
NPI (Numbering Plan Identification), ToN (Type of Number), and
Extension fields.

Change-Id: I3f55834489f3e613f541cf1e216027e8d48ccaf0
Related: OS#4324
2020-01-03 12:27:17 +00:00
Harald Welte bb9512e640 bts: move f_pad_oct() to Osmocom_Types as it's generally useful
Change-Id: I4df99e5612c67006eb2998529425956fb4a664af
2019-05-30 15:06:12 +02:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Harald Welte 07d99c8e7b move imsi_hex2oct to Osmocom_Types.ttcn
This function is required not only for the MSC_Tests, but also for
the upcoming Iu related SGSN tests

Change-Id: Ic23669671ce79151046f2330726bb68542faeb0e
2019-05-02 18:35:43 +02:00
Daniel Willmann e4ff537f9b library: Ensure setverdict(fail) is followed by mtc.stop
This will prevent subsequent failures from overwriting the verdict so we
can easily see the root cause of the test failure.

Using testcase.stop instead for errors internal to our test
infrastructure to mark them as test errors instead of failed.

Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778
2018-07-24 09:54:18 +00:00
Harald Welte 060e27a476 gprs_gb: working UL TBF with segmentation
Change-Id: I0f93246f02e1bee2e1e9db62af5e1e3559c415e9
2018-03-12 14:23:57 +00:00
Harald Welte c3a3f45268 Add new f_timer_safe_restart() function for warning-safe restart
TITAN will print warnings if a still-running timer is res-started.
It will also warn if a not-started timer is stopped, so we need
a conditional stop + start if we want to avoid any warnings in a
convenient way.

Change-Id: Iee83b4905cce3a84eb007ffd189b55f4b54f7cb6
2018-02-27 22:32:54 +01:00
Harald Welte 262f122ab4 Helper functions in GSM_Tyes and Osmocom_Types
Change-Id: Ibd8f215a7cd4564126503c3552bbcceb6d31c779
2018-02-25 16:33:38 +01:00
Harald Welte 02369801d5 Osmocom_Types: Add c_UINT16_MAX / c_UINT32_MAX
Change-Id: I99f3b08b07a46042a8c1e13a420743c58e94603b
2018-02-25 12:59:54 +01:00
Harald Welte ccda45ecf9 bool2bit_tmpl(): Print unsupported template in failure case
Change-Id: I53c65e3a2b71e4c9b6691969d50def69b25ddfd0
2018-02-16 20:03:47 +01:00
Harald Welte b596c18689 bool2bit_tmpl(): Fix for '?' template case
Change-Id: I6dd3c4afdf61689a23aefc277a70cf298cb24c96
2018-02-16 20:03:47 +01:00
Harald Welte c7adaa722b Osmocom_Types: Add bool2bit() and bool2bit_templ()
Those can be very handy to convert boolean values and templates
to the BIT1 type that is used a lot in Ericsson code.

Change-Id: I137595edabd2bbf5e6cf8bf9bdb73b3589c94c64
2018-02-16 20:03:47 +01:00
Harald Welte c2461d66a5 msc: Move f_sleep() to common Osmocom_Types.ttcn
Change-Id: Ic748e1dfe002cb6ee4d785e9b7f8dca34873e504
2018-01-26 22:53:57 +01:00
Harald Welte 9182704cbc ggsn: Move random number helpers to Osmocom_Types.ttcn
Change-Id: I141289cbf1807e81d72f07ac1183fa48b2dc54af
2018-01-26 10:42:53 +01:00
Harald Welte 484160bf21 library: Initial work on GPRS RLC/MAC encoder/decoder
For Downlink and Uplink RLC/MAC Control blocks this is already working
quite nicely.  Data blocks is not working, as their encoding cannot be
expressed in TTCN-3 RAW syntax, and a mixture of C++/native and
RAW-generated coder will be required.
2017-07-28 13:30:24 +02:00
Harald Welte 3b8bdd6358 Introduce 'library' directory for modules shared by multiple test cases 2017-07-19 19:57:26 +02:00