Commit Graph

194 Commits

Author SHA1 Message Date
Neels Hofmeyr a4d2100431 update expected results
Change-Id: I37014274ee97f09985c31966e7cc9122fe11a856
2020-05-19 19:25:35 +00:00
Vadim Yanitskiy 61564be045 library/IPA: split t_ASP_IPA_EVT_UD into send / receive templates
Change-Id: Ib5494bff3f9aa0ac396b729c326e7b4a64c5a5dd
2020-05-18 20:47:14 +07:00
Pau Espin e8d7d16f13 Split templates in RLCMAC_{CSN1_}Types into their own _Templates file
RLCMAC blocks have a lot of fields and we will potentially require lots
of different templates, as well as functions to handle related structs.

Change-Id: I9c6597178168aa3848b21930f33be698dd2ce545
2020-04-29 19:07:38 +02:00
Vadim Yanitskiy 98bb2d5eea library/GSM_RR_Types: do not duplicate Mobile Identity records
All the records related to Mobile Identity IE (see 3GPP TS 24.008,
section 10.5.1.4) are defined in [1], so there is no real need to
dumplicate them. Moreover, most of the related templates in
library/L3_Templates.ttcn are based on these records.

[1] titan.ProtocolModules.MobileL3_v13.4.0/src/MobileL3_CommonIE_Types.ttcn

Change-Id: I27c2743c59db770d6f7e9447dc8c1f539b228ced
2020-03-28 03:29:22 +07:00
Daniel Willmann 69cfc5e417 SGSN_Tests_Iu: Enable Iu tests that made the SGSN crash
Depends: osmo-sgsn I3fc614da6ba137e871ee0fe86ca22b6a4a354dd2
Change-Id: I96851c7c06c8f95ad280a275c2b83d825f0c88cb
Related: OS#3727
2020-01-28 14:44:39 +01:00
Daniel Willmann 1c1161119d SGSN_Tests: Wait for RAU Accept after receiving SecurityModeCmd
We don't want to pass the test or return from this function before
receiving a RAU accept. With Iu we expect a Security Mode
Command/Complete before the routing area is updated, but we do want to
wait for the actual RAU Accept or fail when receiving a RAU Reject.

Change-Id: Id89e2c6dae8cbdb5e8dee1c92960dc3346590a95
Related: OS#3727
2020-01-28 14:41:57 +01:00
Daniel Willmann 1c2ff0fa93 SGSN_Tests: Only call f_bssgp_client_llgmm_assign for Gb RAN
Calling this function with Iu RAN (ran_index > 2) does not work because
BSSGP_PROC[ran_index] doesn't exist.

Change-Id: Ieef654e3886759a40763ece3903de9127ba8d9c6
Related: OS#3727
2020-01-28 14:39:25 +01:00
Pau Espin ce571b5cc4 sgsn: Introduce test TC_attach_req_id_req_ra_update
The scenario in this test triggers a crash in osmo-sgsn fixed by
osmo-sgsn.git I64fa5cf1b427d3abb99e553e584897261a827ce6.

With that osmo-sgsn patch applied, the process doesn't crash anymore but
the test still fails due to an XID message being sent with a new
yet-not-seen-by-ttcn3 TLLI and as a result TTCN3 BSSGP_Emulation fails:
BSSGP_Emulation.ttcn:390 setverdict(fail): none -> fail reason: "Couldn't find Component for TLLI 'FE791757'O", new component reason: "Couldn't find Component for TLLI 'FE791757'O"

Other than that, the test runs fine. It still needs to be clarified
whether the new TLLI sent by osmo-sgsn is expected and test needs to be
fixed, or whether it's an sgsn bug.

Related: OS#3957, OS#4245
Change-Id: Id5554a91a8bda712e282c5a3e9e30fb0ca1ec0e8
2019-11-23 08:00:46 +00:00
Pau Espin 0361193a55 Update README.md of several TTCN3 test suites
Some stuff was wrong and some was missing after new features being
implemented in tests over time.

Change-Id: I7a279592a68ffc76408a8e728e76151534265cc0
2019-11-15 18:49:09 +00:00
Alexander Couzens 42d3cadb05 sgsn: delay f_gmm_attach() by 50ms
Packets sent by f_gmm_attach() might take too long via layers to reach
the SGSN. The GMM_ATTACH_COMPL in f_gmm_attach() took soo long,
that it arrived after packets, which has been sent after calling f_gmm_attach().
This behaviour was found in TC hlr_location_cancel_request_update().

Change-Id: I0209c86e16fe616284d753e9e003f2e4d9ec9ea5
2019-10-08 23:12:01 +00:00
Alexander Couzens ed61ae81e2 Require to receive RANAP_CommonId after RANAP_SecurityModeComplete
The SGSN will send a CommonId after it has sent SecurityModeComplete
to support paging coordination in the RNC.

Change-Id: I82a05cab2aeea25eec699f726b2f5c4b3eef7560
2019-09-16 17:54:37 +00:00
Alexander Couzens be76d9cd79 sgsn: replace variable bssgp with ran_index
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-16 13:57:01 +00:00
Alexander Couzens b1ce118daa sgsn: replace variable gb_idx with ran_index
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-16 13:57:01 +00:00
Alexander Couzens 0507ec3f70 sgsn: replace variable gb_index with ran_index
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-16 13:57:01 +00:00
Alexander Couzens b22e8cee77 sgsn: replace variable bssgp_index with ran_index
Since bssgp_index also been used for Iu connection,
rename the variable to ran_index.

Change-Id: Iec2e8510b749602f0ebb9b4976957c9c5ce3f307
2019-09-16 13:57:01 +00:00
Pau Espin 4b290a2e3a sgsn: TC_attach_check_complete_resend: Expect LU sent to HLR
SGSN is expected to submit an LU after initial GMM Auth

Change-Id: Ie2e8f5b9740c7429f5f0bf28e35707a61f23b565
2019-09-16 08:30:36 +00:00
Alexander Couzens 6da25e36e6 sgsn: add TC_geran_attach_iu_rau
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-12 20:57:03 +00:00
Alexander Couzens e5f4a91576 sgsn: add TC_iu_attach_geran_rau
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-11 12:18:32 +02:00
Alexander Couzens 5d56f5251b sgsn: extend f_routing_area_update() to support Iu
Allow Iu tests to use f_routing_area_update()

Change-Id: Ic03952a04c00a4fc437ef39c5ee046549c122c8b
2019-09-11 12:18:32 +02:00
Alexander Couzens 1552e79637 sgsn: make the ranap interface optional
Allows to use the test cases without STP

Change-Id: I43df456c2d5aa3ba3ea9e34da3f0f96b55f7c9a1
2019-09-11 12:18:32 +02:00
Harald Welte 900d01ad34 sgsn: add Iu Attach Request
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-11 06:19:10 +00:00
Alexander Couzens 4444b5a7f6 sgsn: introduce f_send_l3() to allow one function for Gb & Iu
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-11 06:19:10 +00:00
Pau Espin ce0d615e12 sgsn: Proper shutdown of RAN_Adapter components
Otherwise TTCN3 errors sproadically during shutdown:
""""
SCCP_Emulation.ttcn:5661 Receive operation on port SCCP_SP_PORT succeeded, message from SGSN_Test_0-RAN(414)
...
SCCP_Emulation.ttcn:5293 Sent on MTP3_SCCP_PORT to SGSN_Test_0-M3UA(415) @SCCP_Types.ASP_MTP3_TRANSFERreq_sccp
SCCP_Emulation.ttcn:5293 Outgoing message was mapped to @MTP3asp_Types.ASP_MTP3_TRANSFERreq
SCCP_Emulation.ttcn:5293 Dynamic test case error: Sending data on the connection of port MTP3_SCCP_PORT to 415:MTP3_SP_PORT failed. (Broken pipe)
SCCP_Emulation.ttcn:5293 setverdict(error): none -> error
"""

Similar shutdown is already done in f_cleanup() of SCCP_Tests.ttcn.

Related: OS#4176
Change-Id: I471eb851e5d41de5d8d974ec81be27024d7d313a
2019-09-02 09:04:53 +00:00
Oliver Smith aac9b9ceca BSSGP_Emulation: add BssgpDecodeDepth
Make the decoding level (BSSGP, LLC, SNDCP, L3) configurable, so the
existing PCU tests, that expect messages only decoded to the BSSGP
level, can pass again. Move the SNDCP decoding in f_dec_bssgp above the
L3 decoding, so f_dec_bssgp goes through the layers in the reverse order
of f_send_bssgp_dec.

I have verified, that all testsuites using the BSSGP Emulation (SGSN,
PCU, PCU-SNS) are still working with this patch.

Related: OS#4180
Fixes: 955aa94504 ("BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure")
Change-Id: I8f76385528c1de98c557cee451c0e0dfd182b605
2019-09-02 09:15:33 +02:00
Oliver Smith 0167c2aecf sgsn: update configs for running without docker
Base on docker-playground.git's ttcn3-sgsn-test/*.cfg files, change IPs
to 127.0.0.* (keep last octet), log to stderr. The reasoning behind the
IP change is, that using almost the same IP as in the docker configs
makes it easier to compare the configs.

Change-Id: I15b5a943e9c665dfd4eb6b30bff84afc8adeb4a2
2019-08-30 13:23:34 +02:00
Pau Espin fcec914a8e sgsn: Introduce test TC_attach_echo_timeout
This test verifies sgsn drops all GGSN related pdp context when that
GGSN stops answering echo requests.

Change-Id: Ic31748924e7bf05ea2ccf2b1be0c460eefed5782
2019-08-28 19:16:50 +02:00
Pau Espin 2a3302a0cd sgsn: Add test to verify duplicate DeactPDPCtx crashing osmo-sgsn
osmo-sgsn sends 2 DeletePdpCtxReq on gtp, Confirmation received on first
one frees cbp associatd to pdp and the second one accesses the already
freed cbp.

Related: OS#3956
Change-Id: Ie1cc9fdf91b18b0b7fb3d5fb33b6dcf6f46a393f
2019-08-23 16:16:29 +02:00
Harald Welte 26fbb6e017 sgsn: Integrate RANAP
Integrate RANAP support to SGSN_Tests.ttcn.

Related: OS#2857
Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
2019-08-18 17:12:46 +00:00
Harald Welte 955aa94504 BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure
It originally seemed like a great idea to define a custom record
which aggregates the decoded BSSGP, LLC, L3 and/or SNDCP and passes
it to the individual ConnHdlr.  However, particularly with testcase
interoperability for IuPS in mind, this seems bogus.  Also, we
never really took advantage of this.

Let's now decode as far as we can decode any PDU, and then send the
decoded version of that PDU via the ports between the BSSGP_Emulation
and the ConnHdlr component.

Change-Id: I8c1082880902dd9a04935945f0293895f4d0c53a
2019-08-18 17:12:46 +00:00
Oliver Smith bc690ffcd3 sgsn: add osmo-sgsn.cfg, SGSN_Tests.cfg
Base on the docker-playground.git's config, but with 127.0.0.*.
All tests passing in jenkins are passing locally with this config.

Change-Id: I6da479e35fbe9f861a8bd8e578badcd1563e740f
2019-06-18 13:09:26 +00:00
Pau Espin acc5119bac lib/IPA_Emulation: Build IPA_CTRL conditionally based on define
Change-Id: I4d1eca6b0008a395b7f7449e6ea3f9b6d41133c7
2019-06-13 16:33:49 +02:00
Alexander Couzens 4630e74bb8 SGSN_Tests: f_detach_mo(): fail when receiving any unhandled layer 3 message for normal detach
Merge the case with the fail when doing a power-off detach.

Change-Id: I957994376583959758417dccf419a55c43a0c61b
2019-06-11 14:53:46 +00:00
Pau Espin e6f071fe57 sgsn: Add tests to check GTP retransmit queue
Change-Id: I3c4a3573482bb1fa1549c732a0f78c2d00eadd86
2019-06-04 08:38:13 +00: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
Alexander Couzens 6bee087573 SGSN_Tests: add test case TC_attach_pdp_act_gmm_detach
MS  -> SGSN: Attach Request
MS <-> SGSN: [..]
MS  -> SGSN: Attach Complete
MS  -> SGSN: PDP Activate Request
MS <-  SGSN: PDP Activate Accept
MS  -> SGSN: GMM Detach Request
MS <-  SGSN: GMM Detach Accept

Related-to: OS#1881
Change-Id: Ibafbbb8ed99357d1e2e13d576b2624939388e85b
2019-05-11 06:00:43 +00:00
Alexander Couzens 44aa077bbd SGSN_Tests: fail when receiving any layer 3 package for a power off station
Change-Id: I27d798c1866ed7ae9b03b9c0ffdd7400431551f9
2019-05-11 06:00:01 +00:00
Alexander Couzens 8e0fd46a27 SGSN_Tests: correct verdict failure message in f_detach_mo()
Change-Id: I5c03ef7dd7486025d35d4482a7fe150dd36de907
2019-05-11 05:58:59 +00:00
Alexander Couzens ad35222d3a SGSN_Tests: fix regression in f_send_l3_gmm_llc() which breaks TC_attach_rau_a_b
The gb_index was forgotten to given to the new function f_send_l3().
All testcases which only used the default BSSGB connection #0 continued
to work, but the TC_attach_rau_a_b is the only testcase which uses #0
and #1 at the same time.

Fixes: a05b807922 ("sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet")
Change-Id: Ie3dd8c613d3b3440447a282dc4545078cb927274
2019-05-11 05:57:39 +00:00
Harald Welte 2fa771f90d SGSN_Tests: Introduce NUM_GB to avoid '3' as magic value
Change-Id: I28b7dd26c5c129ec41c6349de9ddc9ef0ffee8ac
2019-05-10 22:38:17 +00:00
Harald Welte f7191679aa SGSN_Tests: Make more helper functions gb_index aware
The gb_index indicates through which Gb link (simulated
RAN/PCU) a given message shall be sent.

Change-Id: I3825634f581897f6951d9673984f138e977cc7ac
2019-05-10 22:38:17 +00:00
Harald Welte ca36246737 SGSN_Tests: Make f_gmm_attach() and f_gmm_auth() work on gb_idx != 0
Let's make sure the related functions can be used on other gb_idx,
i.e. via another Gb interface (and hence simulated RAN/PCU) than
the first one.

Change-Id: Ie88cbf0c70269cc3e2c2fd2a0c65c8f2130ec2b1
2019-05-10 22:38:17 +00:00
Harald Welte 2aaac1b1d1 sgsn: Add initial XID handshake related tests
Change-Id: I5d4b3cba2fe05dffe10c843f16cfec343bc67b5f
2019-05-02 10:03:32 +02:00
Harald Welte 645a151f69 sgsn: Add test cases to verify SABM handling on LLGMM + LL5
As OsmoSGSN doesn't implement ABM, the correct resposne to any SABM
is DM.

RelateD: OS#3953
Change-Id: Ib0d371a3356d6cb481b794945476ab40f5e0f02a
2019-04-25 20:06:15 +00:00
Harald Welte a05b807922 sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet
This test case reproduces a bug in OsmoSGSN where it would crash
as a result to sending LLC NULL frames.

Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd
Related: OS#3952
2019-04-25 20:06:15 +00:00
Alexander Couzens c7dddbd7d0 Ensure BcdMccMnc is encoded as 24.008 10.5.5.15
PCU is using BcdMccMnc as it's encoded as 24.008.
But SGSN code is using it as it would be byte by byte
sorted.

Fixes: OS#3878
Change-Id: Ie8f67f16f18e4c5090bc5a4c46a866a7e7e00206
2019-04-12 15:10:24 +00:00
Harald Welte 5e514fa3db NS_Emulation: Add minimal support for SGSN-side SNS handling
Change-Id: I1edf739d6fd39478f662a28a7d9334ca51c270a3
2019-03-27 11:17:49 +00:00
Neels Hofmeyr 2caf349752 update expected results
Change-Id: Idacaf8343bed4a37878eacdf338c4d5eb46bf7a7
2019-01-23 12:44:42 +01:00
Daniel Willmann d93047434b Add Misc_Helpers.ttcn to centralize TTCN3 shutdown handling
This function can now be called from anywhere to try and safely shutdown
a testcase. It is not optimal as we can't call "all component.stop" from
outside the mtc, but without any proper and orderly shutdown handling of
all our emulation components I believe this is the best we can do.

To use it:

import from Misc_Helpers all;

in your module and then call

Misc_Helpers.f_shutdown(__BFILE__, __LINE__);

You can also pass the function a verdict and a message and it will take care
of calling setverdict, but beware of the following:

While setverdict would accept any number of arguments as log message
and convert them to a log string f_shutdown expects one charstring.
It's possible to use the log2str function to use the log arguments in
setverdict for f_shutdown, for example

setverdict(fail, "Template didn't match: ", tmpl_foo);
would become
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Template didn't match: ", tmpl_foo));

Change-Id: I84d1aa6732f6b748d2bfdeac8f6309023717f267
2018-10-24 15:10:13 +02:00
Alexander Couzens 9a75ab43ce sgsn: update expected-results
Change-Id: Ie08fb0b5a94728640f65f56430a217b51aea3dde
2018-10-03 08:16:09 +00:00
Alexander Couzens 0c6324ff12 sgsn: implement TC_attach_usim_resync
Test the UMTS AKA resync procedure with USIMs.

MS -> SGSN: Attach Request
MS <- SGSN: Identity Request IMSI
MS -> SGSN: Identity Response IMSI
MS <- SGSN: Identity Request IMEI
MS -> SGSN: Identity Response IMEI
HLR<- SGSN: SAI Request
HLR-> SGSN: SAI Response
MS <- SGSN: Auth Request
MS -> SGSN: Auth Failure (with AUTS)
HLR<- SGSN: SAI Request (with AUTS & RAND)
HLR-> SGSN: SAI Response (new key material)
MS <- SGSN: Auth Request (new key material)
MS -> SGSN: Auth Response
MS <- SGSN: Attach Accept
MS -> SGSN: Attach Complete

Change-Id: I52a8dc45bb67d4ca9f3efade278d3308bb0da73d
2018-09-14 16:37:04 +02:00
Neels Hofmeyr 873ae201bd update expected results
Change-Id: I32c29e62ca317937db771f8fb1540bb1fe9da2ab
2018-09-06 14:13:34 +02:00
Alexander Couzens cf3c93d959 sgsn: add TC_attach_gmm_attach_req_while_gmm_attach
Testing the corner case of receiving an Attach Request
while not (yet) sent an Attach Accept.

MS -> SGSN: Attach Request IMSI
MS <- SGSN: Identity Request IMSI (optional)
MS -> SGSN: Identity Response IMSI (optional)
MS <- SGSN: Identity Request IMEI
MS -> SGSN: Attach Request (2nd)
MS <- SGSN: Identity Response IMEI
MS <- SGSN: Attach Accept
MS -> SGSN: Attach Complete

Change-Id: I0bac50dc5a72ba8f9010b05bcb98aa7ff0b81cf6
2018-09-04 18:24:52 +02:00
Alexander Couzens 03d1224474 sgsn: rework TC_attach_closed_add_vty to be executed in a single BSSGP_ConnHldr
When stopping and starting BSSGP_ConnHdlr multiple times, there
are Port connecting problems. Using a single iteration of
BSSGP_ConnHldr.start() works around this problem.

Change-Id: I8e5ae832f3908a172b9beb6d936074b806e0c799
2018-09-04 18:24:52 +02:00
Alexander Couzens fa0a75fc37 sgsn: fix TC_attach_check_complete_resend
TC_attach_check_complete_resend tests if the SGSN sends out the SGSN
Attach Accept multiple times. If the MS disappear,
there is no need for a ATTACH REJECT.

Change-Id: I3fa5c100b8389e184acf1e71e2792e5474c22dec
2018-09-04 18:24:52 +02:00
Alexander Couzens d81876a3ff sgsn: increase the timeout of some TC
Because of multiple BSSGP connections, the tests need more time to complete.

Change-Id: I12baf4b2425d0d862755d03d16127b18968e28f2
2018-09-04 18:24:52 +02:00
Alexander Couzens 1d1744fe9e sgsn: use vty cmd `reset sgsn state`.
Cleans most of the sgsn state.
Depends on the SGSN commit I92096f3f6ea49e75676e30e9921d00210bac5382.

Change-Id: Idff3de6f1b8f5cb503edc5c6256ce2bf7ec7aaa2
2018-09-04 18:24:52 +02:00
Alexander Couzens be837bdd69 sgsn: introduce TC_attach_rau_a_b
MS <-> SGSN: Successful Attach
MS  -> SGSN: Routing Area _a_ Update Request
MS <-  SGSN: Routing Area _a_ Update Accept
MS  -> SGSN: Routing Area _b_ Update Request
MS <-  SGSN: Routing Area _b_ Update Accept
MS  -> SGSN: Detach (PowerOff)

Change-Id: Ie636778628c216e315bd6f5bc11e0e5bd9c218a5
2018-09-04 18:24:52 +02:00
Alexander Couzens 90fe6a2bf7 sgsn: add optional bssgp index for f_upd_ptmsi_and_tlli f_bssgp_client_llgmm_assign f_process_rau_accept
f_process_rau_accept can send the RAU Complete over the correct BSSGP

Change-Id: Ib9a65f0d09d3689911843a1b40e2a4114710e5b5
2018-09-04 16:22:24 +00:00
Alexander Couzens f3c1b41fe4 sgsn: don't re-use the same NS for all 3 BSSGP
Create for every BSSGP a new NS instance.

Change-Id: I3448fe837eaa8efab65dccc32bacaaacd73a2f09
2018-08-28 14:27:08 +02:00
Alexander Couzens cdfb7515ba BSSGP_Emulation: move LLC layer out of BSSGP
The LLC layer needs to be accessed by the SGSN tests
in order to do multi-BSSGP tests.
Otherwise the sgsn will see LLC frame with wrong sequence
numbers and drop them.

Change-Id: Ie9e9d7da0a78a96f4f431c9085b9e273a39535f1
2018-08-14 13:26:47 +00:00
Alexander Couzens 8950870d40 sgsn: add f_cellid_to_RAI()
Returns a RoutingAreaIdentificationV from GbInstance. This will be useful
when using multiple BSSGP and the g_pars.ra field is not the needed ra.

Change-Id: Ide96213ab2f210590b86deaf370486c8a0a78058
2018-08-14 13:26:47 +00:00
Alexander Couzens bfda92144f sgsn: introduce TC_attach_rau_a_a()
MS <-> SGSN: Successful Attach
MS  -> SGSN: Routing Area Update Request
MS <-  SGSN: Routing Area Update Accept
MS  -> SGSN: Routing Area Update Request
MS <-  SGSN: Routing Area Update Accept
MS  -> SGSN: Detach (PowerOff)

Change-Id: Id76b4792c07816bcbe5e965f23c2b526df0923c3
2018-08-14 13:26:47 +00:00
Alexander Couzens 5dce90da14 sgsn: introduce f_routing_area_update()
Will be used by future RAU tests

Change-Id: I4064e013f73319f24bb893a9047c8b9eb7d6aac2
2018-08-14 13:26:47 +00:00
Alexander Couzens 51114d1d9b sgsn: create 3 instances of BSSGP at the same time
Allows to use different BSSGP connection within a single
test.

Change-Id: I01d7f264a0a52e248d6e754485c807266c0b14bf
2018-08-14 13:26:47 +00:00
Alexander Couzens 0e510e693d BSSGP_Emulation.ttcn: extend BSSGP_Client_CT to hold 3 instances of BSSGP
Change-Id: Ibd7abba826a08b582361e9c255e9c44185e14067
2018-08-14 13:26:47 +00:00
Alexander Couzens 2c12b24a47 NS_Emulation: support multiple instances at the same time
The NS_Emulation has configuration values hardcoded or bound
to module parameters which prevents multiple instances.
Replace the module parameter based configuration with configuration
given when starting the NS_Emaulation.

Change-Id: I9128f9ad5c372779c38799269393137ba52576cd
2018-08-13 16:23:50 +00:00
Alexander Couzens 5e2ba75b48 sgsn: fill g_gb configs for the remaining Gb interfaces
When testing with multiple Routing Areas, multiple Gb
interface are required.

Change-Id: I7f56618110f04d99b1b43e69d89167e384b61a34
2018-08-09 03:26:43 +02:00
Alexander Couzens 5e71c14750 sgsn: f_pdp_ctx_deact_mt: rework test behaviour to workaround shutdown problems
When introducing multiple BSSGP instances, this
tests has problem when shutting down the test.

Change-Id: I0cd1adf072f8ba40343e51e41f23a1de6a2bd62c
2018-08-07 18:12:52 +00:00
Stefan Sperling 23b45974ce detect VTY TELNET port connection failures (attempt #2)
Pass the CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT parameter to
the TELNET port by default. This allows tests to make progress
into an error handling path if they are started while the osmo-*
program they want to connect on VTY is not running.

Observed with osmo-ggsn tests, where if the one test runs
into a VTY connection failure the subsequent test would get
stuck forever in a map() call on the VTY TELNET port.

Teach the function f_vty_wait_for_prompt() about connection
reports by the TELNET module. We may now receive an integer which
represents the socket file descriptor for the telnet connection.
This case was not handled by the previous change made in
commit cb111b21ab. As a result,
BSC tests started failing with "VTY Timeout for prompt" because
the alt-statement in f_vty_wait_for_prompt() would not progress
past the integer sitting on the VTY port's receive queue.

Change-Id: I56925f93af6c55e93f3f417099db135744da6a40
Related: OS#3149
2018-07-27 17:20:38 +02:00
Neels Hofmeyr bf3cf5c8bc Revert "detect VTY TELNET port connection failures in TTCN3 tests"
With this patch, I see all ttcn3-bsc-tests failing with
"Verdict: fail reason: VTY Timeout for prompt"

This reverts commit cb111b21ab.

Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140
2018-07-27 13:01:26 +00:00
Stefan Sperling cb111b21ab detect VTY TELNET port connection failures in TTCN3 tests
Pass the CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT parameter to
the TELNET port by default. This allows tests to make progress
into an error handling path if they are started while the osmo-*
program they want to connect on VTY is not running.

Observed with osmo-ggsn tests, where if the one test runs
into a VTY connection failure the subsequent test would get
stuck forever in a map() call on the VTY TELNET port.

Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1
Related: OS#3149
2018-07-27 07:40:10 +00:00
Daniel Willmann afce86630c Stop tests after failures
Call mtc.stop after setverdict(fail), add reasons to most failures and
fail with verdict error for internal errors.

Change-Id: I9b618235939fa41160b9be6677b121963d3ec857
2018-07-24 14:19:42 +02:00
Pau Espin 482dde66cb sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd
Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433
2018-07-21 17:54:35 +00:00
Pau Espin 8be4d1920d sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo
It's not needed for the functionality/scenario of f_gtpu_xceive_mo. It
probably was left in when creating it from f_gtpu_xceive_mo.

Change-Id: Ide226f8501c4598e2bfaa5f1ea62c3ff20807ce4
2018-07-21 17:54:35 +00:00
Pau Espin 940134537a sgsn: Add Test to verify Recovery procedure during CreatePdpResp
Change-Id: Ic81b854967492194367b7ce8a667c29c777791bf
2018-07-21 17:54:35 +00:00
Pau Espin 72edc8ad7f sgsn: Add Test to verify timer t3395
Change-Id: I9ec0863603692045b0d8da376e65080150066173
2018-07-21 17:54:35 +00:00
Pau Espin bcddb8c9b8 sgsn: Fix TC_attach_pdp_act_user_deact_mt
Expect to receive a TearDown Indicator.

Change-Id: I37dafb5e93ac06b3bd9cab2c06aa3735a8429f2f
2018-07-16 13:24:10 +02:00
Pau Espin dc27e483c8 sgsn: Add test to verify restart_ctr during echo req/reply.
Currently test doesn't fully work because it doesn't match the PDP CTX
DEL REQ correctly.

Change-Id: I1dcb250dba2079c14b857c0b89a02ac21d1c591f
2018-07-13 19:16:22 +02:00
Pau Espin 8466722f3f sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg
According to
"""
If a GSN receives a Delete PDP context without a Teardown In
dicator or with a Teardown Indicator with value set to
"0" and only that PDP context is active for a PDN connection, then the
GSN shall ignore the message.
"""

Change-Id: Id5d4774d719685631e4b467dff833ae886c90145
2018-07-13 19:16:22 +02:00
Pau Espin a4cecf5af7 Add README.md file for several suites
Content grabbed from [1] and converted to markdown as it's more probable
to have it displayed correctly on popular git repo hosting platforms.
Syntax for embedded graphviz taken from [2].

[1] http://git.gnumonks.org/laforge-slides/plain/2018/osmodevcon2018-ttcn3_test_suites/osmodevcon2018-ttcn3_test_suites.adoc
[2] https://github.com/stlehmann/markdown-graphviz

Change-Id: I9aad03e605569e9613665a7585d60bf308bcb54f
2018-06-14 18:55:36 +02:00
Alexander Couzens 0085bd7148 sgsn: add TC_attach_check_complete_resend()
MS -> SGSN: Attach Request IMSI
MS <- SGSN: Identity Request *
MS -> SGSN: Identity Response *
MS <- SGSN: Attach Complete 5x

Change-Id: I9bbbda01f3c41a2f8acf13042d6bcc86f18d74ce
2018-06-14 01:55:31 +02:00
Alexander Couzens 0ca0d9caf1 sgsn: f_TC_attach_closed_foreign: fail on recv an Attach Accept
The test expect a reject. Recv an attach accept should fail then.

Change-Id: I8a4ae6aaaa71dabb1d8a2ee7585e624b962a3500
2018-06-14 01:55:31 +02:00
Alexander Couzens f9858658f9 sgsn: add TC_attach_closed_add_vty
Check acl policy closed.

VTY-> SGSN: policy close
MS -> SGSN: Attach Request
MS <- SGSN: Identity Request IMSI
MS -> SGSN: Identity Response IMSI
MS <- SGSN: Attach Reject
VTY-> SGSN: policy imsi-acl add IMSI
MS -> SGSN: Attach Request
MS <- SGSN: Identity Request IMSI
MS -> SGSN: Identity Response IMSI
MS <- SGSN: Identity Request IMEI
MS -> SGSN: Identity Response IMEI
MS <- SGSN: Attach Accept

Change-Id: I1832c339a9d54c0038433ad44e292031a8905e20
2018-06-14 01:55:31 +02:00
Alexander Couzens cf81896465 sgsn: add TC_attach_check_subscriber_list
MS <-> SGSN: Attach
VTY -> SGSN: Check if MS is in subscriber cache

Change-Id: If19073ef4a5b1e2219bd5184ae30d55ffb71844a
2018-06-12 19:23:17 +02:00
Alexander Couzens 09040eff01 sgsn: TC_hlr_location_cancel_request_update: remove superflous Update Location Response
There shouldn't be any update location pending

Change-Id: I94b9307311a8095065212e1820cacc6cd2be0a3a
2018-06-12 19:23:14 +02:00
Alexander Couzens 49bb4b499f sgsn: add TC_attach_detach_check_subscriber_list
MS <-> SGSN: Attach
MS ->  SGSN: Detach Req (Power off)
VTY -> SGSN: Check if MS is NOT in subscriber cache

Change-Id: I0956d54760f19ca556fa0d16ea4c5b96ac13f2fa
2018-06-12 19:22:52 +02:00
Alexander Couzens 53f2056571 sgsn: add TC_attach_no_imsi_response
Ignores Identity Request IMSI.

MS -> SGSN: Attach Request TMSI (unknown)
MS <- SGSN: Identity Request IMEI (optional)
MS -> SGSN: Identity Response IMEI (optional)
MS <- SGSN: Identity Request IMSI
MS -x SGSN: no response
MS <- SGSN: re-send: Identity Request IMSI 4x
MS <- SGSN: Attach Reject

Change-Id: I4f41d59cfe6b0168b5e0874082fd700b56a7f0da
2018-06-12 19:22:50 +02:00
Alexander Couzens 667dd7fa84 sgsn: add TC_attach_no_imei_response
Ignores Identity Request IMEI.

MS -> SGSN: Attach Request IMSI
MS <- SGSN: Identity Request IMSI (optional)
MS -> SGSN: Identity Response IMSI (optional)
MS <- SGSN: Identity Request IMEI
MS -x SGSN: no response
MS <- SGSN: re-send: Identity Request IMEI 4x
MS <- SGSN: Attach Reject

Change-Id: Ie50c75e62e31e01c5b17969fb067664e44fd68a5
2018-06-12 19:21:16 +02:00
Alexander Couzens 234c588b72 sgsn: TC_hlr_location_cancel_*: 5 seconds timeout is to short
These tests failed on jenkins.

Change-Id: I56a62e70763b7c331fc528cd7e4064a5ec9f2a04
2018-06-12 13:51:14 +02:00
Alexander Couzens ace6fc65be SGSN: fix spaces/tabs in TC_hlr_location_cancel_request_unknown_subscriber_{withdraw,update}
Fixes: 6c47f29495 ("SGSN: add TC_hlr_location_cancel_request_unknown_subscriber_{withdraw,update}")
Change-Id: I5074dadf53ec75a9c709b28ff324e23fdcd13bfa
2018-06-12 13:51:14 +02:00
Alexander Couzens 02496257f6 *.default: change logging filemask from ERROR | WARNING to += PARALLEL | VERDICTOP
PARALLEL | VERDICTOP will log when the port is dying or when other
components will change to fail. This helped to find a timeout in the
SGSN tests where a function call message timed out.

Change-Id: I770ac964dc37e2752e7d35e493f707b091c739b0
2018-06-12 13:51:14 +02:00
Neels Hofmeyr beb58a6020 update expected results: bsc, sgsn
Change-Id: Icc8bb648b3c79b2e29450ca38dd95bad1d2d09aa
2018-06-07 15:47:26 +02:00
Alexander Couzens 5e307b49ab SGSN: add TC_hlr_location_cancel_request_update
MS <-> SGSN: GMM Attach
HLR -> SGSN: Cancel Location Request
HLR <- SGSN: Cancel Location Ack

Change-Id: I5d3a818eb0a4eb3b0d4bd7bd88874bd2ac6adb11
2018-05-29 16:08:23 +00:00
Alexander Couzens 6c47f29495 SGSN: add TC_hlr_location_cancel_request_unknown_subscriber_{withdraw,update}
Cancel Location using an unknown IMSI.

HLR -> SGSN: Cancel Location Request
HLR <- SGSN: Cancel Location Error

Change-Id: Iad90c3cc25d72b9ab40e358fe60aa6f62163f146
2018-05-26 21:03:54 +00:00
Alexander Couzens c87967a022 SGSN: add TC_hlr_location_cancel_request
MS <-> SGSN: GMM Attach
HLR -> SGSN: Cancel Location Request
HLR <- SGSN: Cancel Location Ack
MS  <- SGSN: Detach Request
SGSN->   MS: Detach Complete

Change-Id: Id5d6b018a5a4389eefa8f5d950324aab91709f5a
2018-05-26 21:03:54 +00:00
Alexander Couzens 5844d5b2ec sgsn: fix a typo in comment
Change-Id: I061aba5af1e466b33472c9f829b982823bcff71e
2018-05-15 20:54:37 +00:00
Alexander Couzens 80ec1ea42d sgsn: fix RAU_ATTACH not to interact with following testes
TC_attach_rau will interact with the following tests, because the sgsn
is continuing sending RAU_ACCEPTs until it timed out or received a
RAU COMPLETE

Change-Id: Idac92bd61ee7145b7542e60c24e0a66b4ff7ddd4
2018-05-15 18:59:14 +02:00
Harald Welte 8e8cd67b81 update expected results
Change-Id: I65f72e9a8a9031a9715c7c2237824a45d7d8bef1
2018-05-10 23:11:54 +02:00
Alexander Couzens 187ad5da87 sgsn: add test for attach_second_attempt
Do an attach direct after an attach succeeded.
Relates: OS#2958

Change-Id: I767c3e3b0af6e7c6a1f9436fd17e2f515b0bbd05
2018-05-03 04:25:10 +02:00
Alexander Couzens 8f0fb009b7 sgsn: fix typo in comment of BSSGP_ConnHdlrPars:imsi
Change-Id: I544a626d914075c0fcf13017553017b898525e8c
2018-05-03 04:25:08 +02:00