Commit Graph

1858 Commits

Author SHA1 Message Date
Harald Welte f400151003 pgw: Add support for PCRF emulation (CCR/CCA)
If mp_pcrf_local_ip is set to a non-empty string, the PGW testsuite
now emulates a PCRF and expects the PGW to perform the related
transactions - so far Credit-Control-Request INITIAL_REQUEST
at session creation, and TERMINATION_REQUST at session deletion.

Change-Id: I5f0c7a66d38e5c8b5f36b45717d49648a14ed7b2
2020-04-26 22:08:34 +02:00
Harald Welte d01b5d0af0 DIAMETER_Emulation: Notify user of CapabilityExchange
During start of the test case, we must wait until the IUT has
established a DIAMETER/SCTP connection to the testsuite.  Implement
this by means of a message on the DIAMETER_UNIT port and an associated
helper function.

Change-Id: I95434307efc67025ee6d373561f6d22398f959c5
2020-04-26 22:08:34 +02:00
Harald Welte 61f73d553b DIAMETER: parametrize CEA template
So far, we hard-coded the Capabilities-Exchange-Answer for
HSS emulation.  As we want to emulate other DIAMETER network
elements, let's parametrize the template as well as the respective
parameters for the emulation component.

Change-Id: Ie30ff1bac40ab3dc6058587f0586b643ff2b0cb6
2020-04-26 22:08:34 +02:00
Harald Welte f9fb63ec98 DIAMETER_Emulation: Add support for IMSI in Subscription-Id
Ths IMSI on the Gx interface is encoded into a different AVP than
on the S6a/S6d interfaces.  Let's make sure our DIAMETER_Emulation
knows both formats.

Change-Id: I299fcc2e01e908914df32fda4fb93b1114402c77
2020-04-26 22:08:34 +02:00
Harald Welte 24de8caffd DIAMETER_Types: Add IETF RFC4006 CreditControl + related
This adds more DIAMETER types to our TTCN-3 module, specifically those
encountered on Gx between PGW and PCRF.

./AVP.sh Base_IETF_RFC3588.ddf BaseTypes_IETF_RFC3588.ddf AAAInterface_3GPP_TS29272_f10.ddf GxInterface_PCC_3GPP_TS29212_f10.ddf S6Interfaces_3GPP_TS29336_f00.ddf MobileIPv6_HA_IETF_RFC5778.ddf RxInterface_PCC_3GPP_TS29214_f20.ddf NetworkAccessServer_IETF_RFC4005.ddf CreditControl_IETF_RFC4006.ddf CxDxInterface_3GPP_TS29229_c30.ddf GiSGiInterface_3GPP_TS29061_d70.ddf

Change-Id: Ibe7321e695337ff62fdc912270f6e13e6c6d6cf2
2020-04-26 22:08:34 +02:00
Pau Espin 1860bf8391 library/Osmocom_Gb_Types.ttcn: Fix typo presece->presence in function name
Change-Id: I50f1c23e83e9b87de09844226b110d2c48b7cfdb
2020-04-26 14:44:35 +00:00
Harald Welte 71117b689d pgw: Use bash to reliably support += syntax in shell scripts
Change-Id: Id93e83456380ade0617fe9a17eb2b92c685c749e
2020-04-26 15:29:35 +02:00
Pau Espin 55cb2ce675 L3_Templates.ttcn: Fix trailing whitespace
Change-Id: I46ff86b981ef649c89073f155566af35848aef8d
2020-04-22 17:09:25 +02:00
Harald Welte fe595e495c pgw: Add TC_createSession_ping4_256 to test 256 parallel sessions
Change-Id: I38cfaddfb60952f17846fbf87b1a29c32e646438
2020-04-21 22:57:31 +02:00
Harald Welte 8cfdc7cd57 pgw: Don't wait for 10s timeout if starting a ping that takes 10s
rather, dynamically wait 5s longer than the theoretical time it
should take.

Change-Id: Ife2b7b8d03ee6808cfa73bb860cc63c46c451499
2020-04-21 22:57:31 +02:00
Harald Welte 4526da9a22 pgw: Initial testsuite for a PGW (Packet Gateway in the EPC)
Change-Id: I1c0ea207c9191479fd8f581377855f78f36bc635
2020-04-21 22:57:31 +02:00
Harald Welte 88b3ccbf5b Add GTPv2_Emulation component
Change-Id: If73aa453e44ebf28032c60d207feb03e8061dc0c
2020-04-21 22:57:31 +02:00
Harald Welte e53a23db70 HACK: avoid compilation error with TITAN > 6.5.0
it seems TITAN no longer supports 'ifpresent' in certain situations,
see https://www.eclipse.org/forums/index.php/m/1826175/#msg_1826175

Let's make the tests fail if we actually run in those cases, but at
least compile fine and be able to execute all the other tests.

Change-Id: Ia401c2d696979c0062872bca8da62c2ea153427b
2020-04-20 18:02:45 +02:00
Harald Welte 885de1cdb5 CBSP_Templates: fix copy+paste error
Change-Id: Idd07dce8ccdbfa3d65a78ccfcaa9f43eb04979cd
2020-04-20 18:02:45 +02:00
Vadim Yanitskiy 3911d1177e library/RLCMAC_CSN1_Types: add EGPRS Packet Channel Request definition
For more details, see 3GPP TS 44.060, table 11.2.5a.2.

Change-Id: I762b932ed67d9e67a5e13290209cc9017dd650a7
Related: OS#1548
2020-04-20 02:56:41 +00:00
Harald Welte e735a3f6d1 Makefile: Add missing 'ccid' and 'mme' test suites
Only if they're part of the master Makefile, they will be built during
gerrit build verification.

Change-Id: I3c0b89eacadb12efc1e946d8eaff7864a8483c7a
2020-04-19 19:39:37 +02:00
Harald Welte af763aaef5 Fix/complete the partial GTPv2_CodecPort we already had
Change-Id: Idb9f492863d31e9decffeb0d71215fe581fdd4bb
2020-04-19 17:25:02 +00:00
Vadim Yanitskiy 8ae978cecb PCU: derive f_pcuif_rx_imm_ass() from f_establish_tbf()
Change-Id: I3b49927d0db49555e0bf2bb453449f614c7b9323
2020-04-14 23:19:27 +07:00
Philipp Maier 90ec22be5b mgw: use library version of RTP_CodecPort_CtrlFunct
The .cc and the .ttcn file of RTP_CodecPort_CtrlFunct is currently
copied into the mgw directory and then used. However, those files do
exist in the /library folder as well, lets just link them using
gen_links.sh

Change-Id: I14f80051f6a168b7a8155c6e523c085e974b62b5
2020-04-01 10:18:12 +00:00
Harald Welte 0ee2297e97 Initial SIMTRACE testsuite
This doesn't really do much yet in terms of test coverage, but it
adds all related infrastructure

Change-Id: If9fa66b6c5fbddd742ff61fa2c1345736d07accd
2020-04-01 10:16:02 +00:00
Harald Welte 49a61e66cb bsc: Ensure osmo-bsc.fg + BSC_Tests_CBSP.ttcn defaults match
We want to make sure that the tests + config match

Change-Id: I9d6ed0aed34bb983c8db225c7762ceffa642decd
2020-04-01 10:12:27 +00:00
Vadim Yanitskiy 36aa07cb89 BTS: fix as_l1_count_paging(): do not count PCH filling messages
Since build #842, both TC_paging_{i|t}msi_80percent started to fail:

  "BTS_Tests.ttcn:3051 : Expected 271 pagings but have 284"
      BTS_Tests.ttcn:6414 BTS_Tests control part
      BTS_Tests.ttcn:3051 TC_paging_imsi_80percent testcase

  "BTS_Tests.ttcn:3075 : Expected 543 pagings but have 553"
      BTS_Tests.ttcn:6415 BTS_Tests control part
      BTS_Tests.ttcn:3075 TC_paging_tmsi_80percent testcase

As it turns out, since If5339c7a91b4e0188194f1cd935798f153974e01
TITAN can decode PCH filling messages with no Mobile Identity.
We should not count them in as_l1_count_paging(), as they're
sent by osmo-bts itself.

Change-Id: I420f36ed000b1c2488fbe500c33a8161e27d20e3
Fixes: OS#4475
2020-03-31 15:50:33 +07:00
Vadim Yanitskiy fb3edf951d library/L3_Templates: remove tr_PAGING_REQ1_MI1_TMSI, use existing MI templates
Change-Id: Id35477ffc4a914e71100f129bbc4833b48ed5da4
2020-03-30 14:47:08 +07:00
Vadim Yanitskiy d665c23237 BTS: fix as_l1_count_paging(): use ispresent() instead of isvalue()
We actually need to check if a MI is present, i.e. not omit.

  ispresent(omit) => false
  isvalue(omit)   => true

Change-Id: I0e24e2aaa1f0da7ffdbc93ea4a19491e5dfb39b4
2020-03-30 14:41:02 +07:00
Vadim Yanitskiy cc4623dff2 library/RSL_Types: use MobileIdentityLV for MS Identity IE
Change-Id: I5436dcbbc961d5b572e10e4f1a3f806d252d7818
2020-03-28 06:21:02 +07:00
Vadim Yanitskiy 9c51313c71 PCU: fix f_tc_paging_ps_from_sgsn(): also match received MI
Change-Id: Ia8c25ee74c711d8abc84b7d164b3d41abafc1da4
2020-03-28 05:36:09 +07:00
Vadim Yanitskiy a9a198dbd1 BTS_Tests_SMSCB: use existing tr_PAG_REQ1 and t_MI_NoIdentity
Change-Id: I018e1d875c85fe3958fd184fe0d2b0f56d1e343a
2020-03-28 05:28:59 +07:00
Vadim Yanitskiy 7e0022697c library/BSSGP_Types: use tr_MI_IMSI from library/L3_Templates
Change-Id: Ibb02c1c545418bef34ee1e42d34857bda655e12f
2020-03-28 05:20:41 +07:00
Vadim Yanitskiy c94c572698 library/L3_Templates: add more templates for Mobile Identity IE
Change-Id: Ife954becab8c51605da05618a721541e7a4de319
2020-03-28 05:17:23 +07:00
Vadim Yanitskiy 9781ecb4f9 library/GSM_RR_Types: Paging Request Type 1 may contain second MI
Change-Id: I1c443a875d048f51fcf8c5ea4d2a5ab8114d0a4f
2020-03-28 04:27:05 +07: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
Vadim Yanitskiy 35d3a159e2 deps/Makefile: bump titan.ProtocolModules.MobileL3_v13.4.0_commit
This revision has an important fix concerning the length limitations
of Mobile Identity IE (see 3GPP TS 24.008, section 10.5.1.4) when
no identity is present (see 'No_Identity' record).

Change-Id: If5339c7a91b4e0188194f1cd935798f153974e01
2020-03-28 00:46:06 +07:00
Vadim Yanitskiy 7b2242157b PCU: also test GSGN originated PS/CS Paging containing TMSI
This additional couple of test cases reveals several bugs:

  1) the IUT encodes a erroneous RR Paging Request message
     containing P-TMSI, so TITAN fails to decode it;

  2) the IUT prints an invalid P-TMSI in its log output
     due to load of misaligned address (found by UBSan).

[1] I97fd5ffc15a4a58112d7c37c69b7ac42b0741a0e
[2] Icf8836f216793e342b239c8e6645aac1e82bf324

Change-Id: I7fbec5b2c5c3943a7413417b623f55c135c152d7
2020-03-26 16:27:50 +07:00
Vadim Yanitskiy cca15a388f pcu: cosmetic: fix formatting of 'execute' statements
Change-Id: Ia5a0eca1be13cc6580329b272ed9f663938f1e60
2020-03-24 21:27:00 +07:00
Pau Espin dc9666ff9c pcu: Verify CodingScheme of received data blocks
Change-Id: I0a5247650548f8a03f7b025aae65652fb424c156
2020-03-20 20:03:59 +01:00
Pau Espin 2422d1fa82 pcu: Introduce TC_mt_ping_pong_with_dl_racap
Allows checking how pcu parses MS RA Capabilities coming from SGSN.

Change-Id: Iedd8ab278547471b72252743d93a0f9e11d7e787
2020-03-18 15:53:17 +01:00
Pau Espin e7cabe6f54 pcu: Introduce TC_mt_ping_pong
Change-Id: I0cbf4ac78e4c89f21b8c2b92eba1783667501e64
2020-03-18 13:27:45 +01:00
Pau Espin c04c69e689 ggsn: Terminate immediately on pipong altstep failure
Change-Id: I1ae66afc562c6bf968b0b3bfa9a254fac0bd7404
2020-03-03 16:48:34 +01:00
Pau Espin 123ec855a0 gitignore: Add *.d files
my ggsn_tests directory becomes bull of those files after make
ggsn_tests.

Change-Id: Iece4dc883db95c2ea3b6c50a55ff34022a4c0bd6
2020-03-03 16:48:34 +01:00
Harald Welte 9d09c4d3fd ttcn3_makefilegen: Generate gnu make files (we use Linux...)
Change-Id: I21de4dd375139ad24c742c12a948f7ba0b0ade76
2020-03-02 14:25:47 +01:00
Harald Welte 4895d7a1d3 BSSGP/IuUP: Fix license disclaimer copy+paste
The license disclaimer already stated GPLv2-or-later, it just stated
confusingly you should look at the AGPL for reference.  Fix that.

Change-Id: I673c5c177a8e4010921f1fed747ce376f274da54
2020-03-01 20:27:19 +01:00
Harald Welte b12a0ffc03 remsim: Add RemsimServer_Tests.TC_slotmap_add_out_of_range()
Validate if osmo-remsim-server permits out-of-range integers in REST.

Change-Id: I449541420a15826ed0d2f1460e3ca4b3468662c3
2020-02-20 18:48:22 +01:00
Harald Welte 3993c81b79 remsim: Add TC_slotmap_del_nonexistant()
Let's test that deleting a non-existant slotmap from server renders
HTTP status 404.

Change-Id: Ib74fea146017ffc68b75ec175472842b689891c3
2020-02-20 10:12:28 +01:00
Harald Welte b79bc601da remsim: Update TODO list
Change-Id: I1c6b1c7c1ced88db56940d2cef78193a13a15af6
2020-02-20 10:06:15 +01:00
Harald Welte 15be5d6866 remsim: Add global guard timer to client+bankd tests
Change-Id: I85d436a91d1c805f2fb66138ef7e2fb73107f2d1
2020-02-19 20:09:02 +01:00
Harald Welte 34b9da299c remsim: Add tests using stdin/stdout of osmo-remsim-client-shell
osmo-remsim-client-shell allows to send C-APDU via STDIN of the program
and receive R-APDU via STDOUT.  We can attach to that using the PIPEasp
TTCN3 port, and hence test a [local] osmo-remsim-client-shell
transceiving APDUs from/to a simulated bankd in the test case.

The only sad part about this is that we now will need to have the
implementation under test (osmo-remsim-client-shell binary) in the
same container as the TTCN-3 test, as it will fork/exec it.

This is why we disable it by default and a modulepar must be used to
enable those particular tests.

Change-Id: I3a69c692cf3e6bbe04ce58594050b20da0c37d16
2020-02-19 19:56:30 +01:00
Harald Welte 625faadb76 Native_Functions: Add f_str_to{lower,upper}()
TTCN-3 interestingly doens't seem to have any case-insensitive string
matching or functions to convert to uppwer/lowercase.

Change-Id: I2e6e0fd2da001a3cc6d9c31c9e766ae54bf17b2f
2020-02-19 19:52:22 +01:00
Harald Welte 8aefd11dd2 deps/Makefile: Call Github repositories ECLIPSEGITHUB
ECLIPSEGIT and ECLIPSEGIT2 are really difficult to distinguish,
let's call the former ECLIPSEGITHUB, i.e. the eclipse organization
at github.

Change-Id: I3a12164f76b85168c3afe85af2dd4be42f3e560b
2020-02-18 21:47:06 +01:00
Harald Welte 6effabbd62 DIAMETER: Add tr_DIA_AIR() to send AuthInfoRequest
Change-Id: Ib30fafaa2c660d32e864a57f4d3b0f50a158de6c
2020-02-18 21:39:59 +01:00
Harald Welte 9073295230 remsim: Integrate VPCD test port into RemsimBankd_Tests.ttcn
VPCD (specifically ifd-vpcd) is an ifd-handler (reader driver)
for a virtual smart card reader integrated with pcsc-lite.  It is
part of the virtualsmartcard project.   Using this ifd-vpcd, we
can implementa virtual smart card reader beneath osmo-remsim-bankd,
which allows us to implement both the smart card [reader] below
osmo-remsim-bankd as well as the osmo-remsim-server + client above
osmo-remsim-bankd - in other words a fully virtualized test fixture for
bankd.

Change-Id: I967f2d526f4ef1278bd2ac1d590a8dce732379d5
2020-02-17 22:47:11 +01:00