aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-10-04S1AP: HACK: initial fuzzing test case for S1AP_SetupReqfixeria/s1ap_fuzzVadim Yanitskiy3-1/+98
Change-Id: Ib6c8d87a1118a99075d3f2a498f3af4bdc65e6ec
2019-09-29library/GSM_RR_Types.ttcn: fix 'Assignment' vs 'Allocation' confusionVadim Yanitskiy1-3/+3
Change-Id: I8cbdfa891c56fda539d5997201c90f07c7f8307e
2019-09-29library/GSM_RR_Types.ttcn: fix 'presence' in tr_PacketUlSglAssignVadim Yanitskiy1-1/+1
According to 3GPP TS 44.018, section 10.5.2.16 "IA Rest Octets", the first bit of Packet Uplink Assignment defines whether it is a dynamic (1) or single block (0) allocation. Change-Id: If2bee9b1b065fcfedd0e57a6487040cefe2e50c5
2019-09-29PCU_Tests_RAW.ttcn: TC_cs_lqual_ul_tbf: properly check for Dynamic AssignmentVadim Yanitskiy1-1/+6
According to 3GPP TS 44.018, section 10.5.2.16 "IA Rest Octets", Packet Uplink Assignment can be either of the following types: - single block allocation, - dynamic allocation. The current version of TC_cs_lqual_ul_tbf does not handle single block allocation, so we need to make sure we got a TBF with dynamic allocation. Change-Id: I05cf0c62d21094fb53a9e5e54b404f3cf972a182
2019-09-29PCU_Tests_RAW.ttcn: refactor TC_pcuif_suspend: use the RAW PCU componentsVadim Yanitskiy2-22/+27
This change is a step towards getting rid of the old test case infrastructure. Note that a call to f_bssgp_establish() is moved out of f_init_bssgp() to the test case's body. Change-Id: If15339f02c5188e60fcb47ae6dc0ac289efa2896
2019-09-28msc: add f_tc_lu_and_mt_sms_paging_repeatedAlexander Couzens2-0/+53
The testcase will ensure paging is repeated by the MSC. Repeating will improve the reachability of MS when a Paging is lost or not received because the MS is moving between states. Change-Id: Ib5bf0b62e0639436cdcba03acbaedf1458e18873
2019-09-27PCU_Tests_RAW.ttcn: add test case for UL link quality adaptationVadim Yanitskiy2-1/+102
This change introduces a new test case TC_cs_lqual_ul_tbf, which is aimed to test the feedback of OsmoPCU on changing link quality measurements in Uplink Data blocks during an active TBF. Change-Id: Ia78d93e43a3c41b0b30e70df20a2da31077fd05f Related: SYS#4607
2019-09-27PCU_Tests_RAW.ttcn: introduce TC_ta_rach_imm_ass to test initial TAVadim Yanitskiy1-0/+78
The aim of this test case is to test the correctness of Timing Advance at the time of TBF establishment. In particular, the test case sends several Access Bursts (RACH.ind) with increasing 'qta' value, what causes OsmoPCU to allocate a TBF (Temporary Block Flow) for each RACH.ind and send DATA.req with Immediate Assignment on AGCH, containing the expected Timing Advance value. Change-Id: I21f76ae723519c0eb54515922a05ca8045b00ade Related: SYS#4606
2019-09-27library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_dataVadim Yanitskiy1-0/+10
In Ieefa61232eb215a19a02e490255332e28e23b8f8, I had to revert I5808954b5c67c3239e795e43ae77035152d359ef, because that change broke encoding of messages on the PCU interface. Since we cannot use 'PADDING' attribute until its implementation is fixed in TITAN, let's work this around by stripping padding bytes manually in UD_to_PCUIF(). Change-Id: Ibd698094c897d395208e80189457444a91018beb
2019-09-27library/RLCMAC_CSN1_Types.ttcn: add UL Packet Resource RequestVadim Yanitskiy1-0/+72
This change implements UL Packet Resource Request message as per 3GPP TS 44.060, section 11.2.16 (only mandatory fields), and a send template 'ts_RlcMacUlCtrl_PKT_RES_REQ' for it. Change-Id: I0d688beb4112d6db10ac89e2966b555e74887a6e
2019-09-27Introduce PCUIF, BTS and ClckGen components for RAW PCU test casesVadim Yanitskiy3-0/+483
The problem of existing test cases is that they mix IUT (i.e. OsmoPCU) with OsmoBTS (osmo-bts-virtual) and OsmocomBB (virt_phy). This approach allows to avoid dealing with TDMA clock indications and RTS requests on the PCU interface - this is done by OsmoBTS. On the other hand, our test scenarios may be potentially affected by undiscovered bugs in OsmoBTS and the virt_phy. In order to solve that problem, this change introduces a set of new components and the corresponding handler functions: - RAW_PCUIF_CT / f_PCUIF_CT_handler() - PCU interface (UNIX domain socket) handler. Creates a server listening for incoming connections on a given 'pcu_sock_path', handles connection establishment and message forwarding between connected BTS components (see below) and OsmoPCU. - RAW_PCU_BTS_CT / f_BTS_CT_handler() - represents a single BTS entity, connected to OsmoPCU through the RAW_PCUIF_CT. Takes care about sending System Information 13 to OsmoPCU, forwarding TDMA clock indications from a dedicated ClckGen component (see below), and filtering the received messages by the BTS number. Implements minimalistic scheduler for both DATA.ind and RTS.req messages, so they are send in accordance with the current TDMA frame number. - RAW_PCU_ClckGen_CT / f_ClckGen_CT_handler() - TDMA frame clock counter built on top of a timer. Sends clock indications to the BTS component. All components communicate using TTCN-3 ports and explicitly defined sets of messages (see RAW_PCU_MSG_PT). One noticeable kind of such messages is events (see RAW_PCU_Event and RAW_PCU_EventType). That's how e.g. the PCUIF component can notify the BTS component that OsmoPCU has just connected, or the BTS component can notify the MTC that SI13 negotiation is completed. Events may optionally have parameters (e.g. frame-number for TDMA_EV_*). Furthermore, the proposed set of components allows to have more than one BTS entity, so we can also test multi-BTS operation in the future. +-----+ +----------+ +---------+ | MTC +---------------+ PCUIF_CT +------+ OsmoPCU | +--+--+ +----+-----+ +---------+ | | | | | | | +-----------+ | +---------------+ +----+ BTS_CT #1 +------+ | ClckGen_CT #1 | | +-----+-----+ | +-------+-------+ | | | | | +---------------------------+ | | | +-----------+ | +---------------+ +----+ BTS_CT #2 +------+ | ClckGen_CT #2 | | +-----+-----+ | +-------+-------+ | | | | | +---------------------------+ | | | +-----------+ | +---------------+ +----+ BTS_CT #N +------+ | ClckGen_CT #N | +-----+-----+ +-------+-------+ | | +---------------------------+ Change-Id: I63a23abebab88fd5318eb4d907d6028e7c38e9a3
2019-09-26SABP CodecPort and SABP_AdapterHarald Welte4-0/+348
These modules allow TTCN-3 tests to interface with SABP peers over TCP. Change-Id: I6c3cfff044ec447d3e58b646c85ccb0531843b51
2019-09-26SABP (Service Area Broadcast Protocol) definitionsHarald Welte9-0/+1747
Using ASN.1 syntax copy+pasted from 3GPP TS 25.419 version 15.0.0 Release 15 Change-Id: Iab44cca10a664bbe2823a4183bca055ac8851137
2019-09-24MSC_Tests: Expect SGsAP-SERVICE-ABORT-REQUEST on paging timeoutPhilipp Maier1-3/+21
When a paging for a CS-Call times out the MSC/VLR is expected to send an SGsAP-SERVICE-ABORT-REQUEST to the MME to indicate that the paging has timed out. This is not taken into accound yet by TTCN3 test TC_sgsap_paging_and_nothing Related: OS#3614 Depends: osmo-msc I3f8f153afe24cf2efa245713509bdc8488902877 Change-Id: I99950a17ccf26aaa0eebded5480f33be4c57586a
2019-09-24Cosmetic: Fix commentPhilipp Maier1-3/+3
Change-Id: Ie1c80d951ea2f8e3e154beb5623aa0d5f5874a60
2019-09-18Revert "MGCP: fix pattern warning"Neels Hofmeyr1-5/+5
For me this change causes MGCP parsing errors: setverdict(fail): pass -> fail reason: "Could not extract parameters for code "C"" Apparently the \r is after all necessary to parse MGCP. Maybe the '\r' is implicit when an '\n' occurs, but the non-SDP part of MGCP has *only* '\r' line breaks. This reverts commit a9a52fff15227710e1a3a2e6222a388a3da11168. Change-Id: I81d105b951590310c67f14f0b5d0c2777e206c5e
2019-09-18MGCP: fix pattern warningMax1-5/+5
Remove implied \r to fix following warnings: "Duplicate character `\r' in the character set. Please note the \n includes the \r implicitly. Use \q{0,0,0,10} if you would like to match the LF only." Change-Id: I99948e4b82b5b4bd5b8f7c1a4c60a97fcab3c0eb
2019-09-16Require to receive RANAP_CommonId after RANAP_SecurityModeCompleteAlexander Couzens1-0/+2
The SGSN will send a CommonId after it has sent SecurityModeComplete to support paging coordination in the RNC. Change-Id: I82a05cab2aeea25eec699f726b2f5c4b3eef7560
2019-09-16sgsn: replace variable bssgp with ran_indexAlexander Couzens2-15/+15
Since bssgp also been used for Iu connection, rename the variable to ran_index. Be consistent and use the same variable name everywhere. Change-Id: Ib278410bc49f07387873740ed8b411a815d940a8
2019-09-16sgsn: replace variable gb_idx with ran_indexAlexander Couzens2-55/+55
Since gb_idx also been used for Iu connection, rename the variable to ran_index. Be consistent and use the same variable name everywhere. Change-Id: Ia119feee6a442c76dc337e75c07f4a385cd5e1df
2019-09-16sgsn: replace variable gb_index with ran_indexAlexander Couzens1-7/+7
Since gb_index also been used for Iu connection, rename the variable to ran_index. Be consistent and use the same variable name everywhere. Change-Id: I06b0c6184daeb886e8bd28d50bf18909d9244dc6
2019-09-16sgsn: replace variable bssgp_index with ran_indexAlexander Couzens1-10/+10
Since bssgp_index also been used for Iu connection, rename the variable to ran_index. Change-Id: Iec2e8510b749602f0ebb9b4976957c9c5ce3f307
2019-09-16sgsn: TC_attach_check_complete_resend: Expect LU sent to HLRPau Espin Pedrol1-0/+2
SGSN is expected to submit an LU after initial GMM Auth Change-Id: Ie2e8f5b9740c7429f5f0bf28e35707a61f23b565
2019-09-14library/L1CTL_PortType.ttcn: use templates from GSM_RR_TypesVadim Yanitskiy2-19/+9
Get rid of template t_IMM_ASS, which is a part of L1CTL_Types.ttcn. Prepare generic (for both CS and PS) template on top of tr_IMM_ASS, and use it in f_L1CTL_WAIT_IMM_ASS(). Change-Id: I3a410ec3c41e3eefd23071bfb0d80feda82177a5
2019-09-14library/PCUIF_Types.ttcn: mark PCUIF_Text as 'null_terminated'Vadim Yanitskiy1-1/+1
This is a TITAN specific attribute that allows to indicate that a field of type 'charstring' is '\0'-terminated. Without that attribute, 'PCUIF_Text' is mixed with the padding characters: "0.7.0.5-df0f" & char(0, 0, 0, 0) & char(0, 0, 0, 0) & ... Change-Id: Ic81fff4c82871bb29a2385b9ee7a2dd98f67dfb0
2019-09-13Initial TTCN-3 test suite for osmo-remsimHarald Welte15-1/+2252
This adds shared infrastructure and initial test suites for osmo-remsim-{server,client,bankd}. Change-Id: I00034d3a991f0f881cfd8ff0bfc4557113daf830
2019-09-12sgsn: add TC_geran_attach_iu_rauAlexander Couzens1-1/+26
MS <-> SGSN: Successful Attach over Geran MS <-> SGSN: Routing Area Update over Iu The test case will crash the SGSN and is not included in the default run. Change-Id: Id23244aa6ca329579300b66b73ce238bd4d01eef
2019-09-11Revert "library/PCUIF_Types.ttcn: inform RAW codec about PADDING in PCUIF_data"Vadim Yanitskiy1-7/+2
This reverts commit dd6d5d1baa62dc9d50fa90ef01fccb8a10284d53. The PADDING seems to be a very experimental feature of TITAN. It works very well for decoding of messages, so the padding bytes are getting recognized as expected, but encoding is broken. Not only the data buffer and its length are encoded in a wrong way, but other fields too. Change-Id: Ieefa61232eb215a19a02e490255332e28e23b8f8
2019-09-11sgsn: add TC_iu_attach_geran_rauAlexander Couzens1-0/+23
MS <-> SGSN: Attach over Iu MS <-> SGSN: Routing Area Update over Geran The tess case will crash the SGSN and is not included in the default run. Change-Id: Ie043639638a640a2041324fc910964385a41c77d
2019-09-11sgsn: extend f_routing_area_update() to support IuAlexander Couzens1-5/+27
Allow Iu tests to use f_routing_area_update() Change-Id: Ic03952a04c00a4fc437ef39c5ee046549c122c8b
2019-09-11sgsn: make the ranap interface optionalAlexander Couzens2-11/+24
Allows to use the test cases without STP Change-Id: I43df456c2d5aa3ba3ea9e34da3f0f96b55f7c9a1
2019-09-11sgsn: add Iu Attach RequestHarald Welte2-0/+47
MS -> SGSN: Attach Request IMSI MS <- SGSN: Identity Request IMEI MS -> SGSN: Identity Response IMEI MS <- SGSN: Auth Request MS -> SGSN: Auth Response MS <- SGSN: Attach Accept MS -> SGSN: Attach Complete Change-Id: I66069e31c30d33934ad57cc2b8794f56ffd5c7d6
2019-09-11L3 Templates: PDU_L3_MS_SGSN: export ptmsi in template signatureAlexander Couzens1-2/+3
Iu packets needs to contain an ptmsi as tlv in difference to Gb. Change-Id: I7ba51a28524261dd1c7f4f2586ee6ebc970ea944
2019-09-11sgsn: introduce f_send_l3() to allow one function for Gb & IuAlexander Couzens1-48/+132
f_send_l3() replaces f_send_l3_gmm_llc() to have one function which sends L3 messages for Iu and Gb at the same time. This allows to share most of the tests between Iu & Gb. Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
2019-09-09library/LAPDm_RAW_PT.ttcn: use templates from GSM_RR_TypesVadim Yanitskiy1-16/+24
Get rid of t_IMM_ASS_TBF_UL_DYN, use tr_IMM_TBF_ASS instead. Also, use both tr_PacketUlDynAssign and tr_PacketUlSglAssign for matching UL TBF assignment. Change-Id: Icb7dab04a1e2a833c14754d872bd4b85af3d58a5
2019-09-09library/GSM_RR_Types.ttcn: introduce generic tr_IMM_TBF_ASSVadim Yanitskiy3-35/+33
Both 't_IMM_ASS_TBF_DL' and 't_RR_IMM_ASS_TBF_DL' templates were introduced for a specific task - matching Packet Immediate Assignment (Downlink TBF) by TLLI. In the upcoming changes we will also need to match Uplink TBF assignment, and more generic fields such as Timing Advance. Let's add a generic template for Packet Immediate Assignment and allow passing IaRestOctets as a parameter. Change-Id: I492cf990820ba153ea71469b8b623e56e031e549
2019-09-09library/GSM_RR_Types.ttcn: refactor IaRestOctHH codingVadim Yanitskiy3-63/+119
According to 3GPP TS 44.018, section 10.5.2.16, IA Rest Octets IE starting with 'HH' bits may contain one of the following CSN.1 encoded components: 7 6 5 4 3 2 1 0 Bit Numbers H H 0 0 . . . . Packet Uplink Assignment H H 0 1 . . . . Packet Downlink Assignment H H 1 . . . . . Second Part Packet Assignment We already have (partial) support for the first two, while the last type has not been supported so far. Let's add it. Also, this change introduces several templates for IA Rest Octets IE and some of its components mentioned above. This would allow us to abstract the API users from dealing with further changes, e.g. adding a coding attribute 'CSN.1 L/H' and missing fields. Change-Id: Ib3a21e7c5fa1cad4466e3a09fa70540de7f6ecc5
2019-09-09library/GSM_RR_Types.ttcn: fix: apply '2B'O padding to GsmRrMessageVadim Yanitskiy1-3/+5
For some reason TITAN starts padding not from the beginning of record ImmediateAssignment, but from it's wrapper GsmRrMessage. As a result, dec_GsmRrMessage() warns about undecoded octets: Data remained at the end of the stream after successful decoding '2B2B2B'O Similarly enc_GsmRrMessage() generates a shorter payload. Let's work this around by applying PADDING attribute to GsmRrMessage. Change-Id: I5fe327383402956213c20a68b18b8a48381156b5
2019-09-09library/GSM_RR_Types.ttcn: fix hard-coded L2 pseudo length in tr_IMM_ASSVadim Yanitskiy1-1/+1
Change-Id: I1d3b0fbd01875cdb94b923a1521b1387a33adcd8
2019-09-08library/GSM_RR_Types.ttcn: fix ImmediateAssignment coding regressionsVadim Yanitskiy1-4/+6
Since I403d2141536303a966be7ff51b06c3de202412e6, IA Rest Octets is a mandatory IE. When changing the definition of ts_IMM_ASS, I forgot to mark its optional 'lh', 'hl', and 'hh' as omitted explicitly. As a result, many of our TTCN-3 test cases were broken: Dynamic test case error: Using an unbound optional field. Also, in Ifdcdcf50709fcc03195cb8ef6092977e26f910ec I added an optional field 'pad' to record 'IaRestOctets'. That was not the best solution, because padding should be handled transparently. Let's get rid of that dummy field and equip both 'ImmediateAssignment' and 'IaRestOctets' records with proper padding attributes. The later one needs to be marked with 'CSN.1 L/H' attribute in the future, but for now we should keep it octet-aligned. Change-Id: I69d5fbd8e3388e287bfa54f02454d207e62ee640
2019-09-07bsc: Test that ETWS Primary Notification is passed via RSL to PCHHarald Welte1-0/+77
The BSC must not only pass the ETWS Primary Notification from CBSP down every dedicated channel, but it must also send it via an Osmocom-specific RSL message to enable the BTS to brodcast it via the PCH (P1 Rest Octets) and pass it to the PCU for PACCH. Change-Id: Ia418095844aaa418a4e2ff6fd75d8a4b3c8bb9c0 Related: #4046
2019-09-07bsc: Test that ETWS Primary Notification are sent via dedicated channelsHarald Welte3-1/+108
When the BSC receives an ETWS PN via CBSP, it must send it through all established dedicated channels of the matching BTSs. Related: OS#4046 Change-Id: Ib057bd251604e9bae968e71de245b3bbf737a356
2019-09-06CBSP: Fix receive templates if channel_ind == omitHarald Welte1-3/+9
Change-Id: I6e15a7499b5da6f63a517f303576a877ea038788
2019-09-06bts: Test if BTS forwards ETWS Primary Notification to PCUHarald Welte2-2/+72
All MS/UE must be notified of ETWS Primary Notifiations. Depending on their state, the notification goes different paths: * CS dedicated mode: BSC sends it as L3 message over LAPDm / DCCH * CS/PS idle mode: BTS sends paging messages on PCH * PS TBF active: PCU send Packet Application Info This tests the last of the three methods by checking that a ETWS Primary Notification sent on RSL to the BTS is received by the PCU socket. Change-Id: I2661df7f7d870a0ac1c89bb8a85df81644b00b0a Related: OS#4047, OS#4048 Depends: osmo-bts Ic0b3f38b400a0ca7e4089061ceb6548b0695faa6
2019-09-06Revert "bts: f_init_pcu: sleep before connect"Oliver Smith1-4/+3
This reverts commit c089b415f5e3bbf5eb2de435b925581ca42d8872. The additional sleep caused other tests to break, probably because it triggered race conditions: * TC_pcu_socket_connect_multi * TC_pcu_socket_connect_si3gprs * TC_si_sched_13_2bis_2ter_2quater Adjust TC_pcu_socket_verify_info_ind test case error message to mention OS#4179. This test is flapping now, most of the time the BTS sends a CellID 0 because it did not receive the real CellID from the BSC yet. Related: OS#4179 Change-Id: I2115c337f4601a4614b140715323c42803b003ee
2019-09-05library/GSM_RR_Types.ttcn: fix: IA Rest Octets may have optional paddingVadim Yanitskiy1-1/+2
According to 3GPP TS 04.08 (version 7.21.0), section 10.5.2.16 and table 10.5.45, IA Rest Octets IE may contain spare bits. Let's add an optional field 'pad' to record 'IaRestOctets'. NOTE: somehow this change crashes my TITAN runtime: dec_GsmRrMessage(): Stream before decoding: '2D063F100FE3673A096B0000C800300B2B2B2B2B2B2B2B'O *** Error in `././PCU_Tests': malloc(): memory corruption: 0x000000000074a790 *** while the recent version works just fine. Change-Id: Ifdcdcf50709fcc03195cb8ef6092977e26f910ec
2019-09-05library/GSM_RR_Types.ttcn: fix: IA Rest Octets is mandatory IEVadim Yanitskiy1-3/+10
According to 3GPP TS 04.08 (version 7.21.0), table 9.18, IA Rest Octets (see 10.5.2.16) is a mandatory IE, not optional. Change-Id: I403d2141536303a966be7ff51b06c3de202412e6
2019-09-05library/PCUIF_Types.ttcn: inform RAW codec about PADDING in PCUIF_dataVadim Yanitskiy1-2/+7
PADDING is one of the TITAN specific language extensions [1], which tells the RAW codec that an encoded payload shall end at a boundary fixed by a multiple of 'padding' unit bits counted from the beginning of the message. Let's use it for record 'PCUIF_data', where the fixed-size buffer is located in between the other fields, so padding will be ignored by the RAW coding after decoding: $HOST: dec_PCUIF_Message(): Decoded @PCUIF_Types.PCUIF_Message: { msg_type := PCU_IF_MSG_DATA_REQ (0), bts_nr := 0, spare := '0000'O, u := { data_req := { sapi := PCU_IF_SAPI_AGCH (2), len := 23, data := '2D063F100FE3673A096B0000C800300B2B2B2B2B2B2B2B', ... } } } As a result, we don't have to deal with padding manually and can safely use 'decmatch' statement in the receive templates. [1] usrguide/referenceguide/4-ttcn3_language_extensions.adoc Change-Id: I5808954b5c67c3239e795e43ae77035152d359ef
2019-09-05bsc: Test suite for CBSP (Cell Broadcast Service Protocol)Harald Welte7-6/+552
In this testsuite, we simulate BTS and CBC by attaching to RSL and CBSP protocol interfaces of the BSC. We then issue a variety of CBSP commands to the BSC and check for corresponding action on both the BTS- facing RSL as well as responses on the CBSP side. Change-Id: Ia6ffac181f50586d06d2f29bca1c57285179e861
2019-09-05CBSP: Hack to make receive templates workHarald Welte1-5/+5
For some reason, the 'ifpresent' annotation doesn't work in lists of templates. This means we have to re-think the CBSP template structure at some point. However, this would be a significant detour and I'd rather have working tests right now, so we can verify the actual functionality merged into the BSC right now. Change-Id: I3fa174b4352c17feaea4d33f773877104d4913c4