Commit Graph

570 Commits

Author SHA1 Message Date
Harald Welte bd194720ad sgsn: Integrate VTY access into SGSN_Tests
Change-Id: I661963368a285ab9358d7f4845b42dc70c35a553
2018-02-18 10:23:41 +01:00
Harald Welte 872ce17d35 move f_vty_config() from MSC_Tests to Osmocom_VTY_Functions
Change-Id: Ie7373c28b1d2b76f8d637ac6c86976fd341e3e2c
2018-02-18 10:23:41 +01:00
Harald Welte 1967d47ea1 sgsn: Ensure ATTACH is always only for GPRS, not combined
OsmoSGSN doesn't do combined GPRS+IMSI Attach.

Change-Id: Ib11f5d720a0e4e1d574982d1f33ba9aaa6b3a3cf
2018-02-18 10:23:33 +01:00
Harald Welte 3823e2ea77 sgsn: Add TC_attach_combined
Change-Id: I87700d89389f4adb60a056d139674bb5f5addf7b
2018-02-18 10:18:14 +01:00
Harald Welte 5b7c812e03 sgsn: TC_attach_*_timeout test cases
Change-Id: If8cd9e4387588e8299b7675b8b57392d7da66bd9
2018-02-18 10:18:14 +01:00
Harald Welte 62e2958e49 sgsn: Introduce global guard timer
Change-Id: I0c1fd2a38a4f412079b5f28302b15124d9fd3b3d
2018-02-18 10:18:14 +01:00
Harald Welte 5a4fa04ec4 sgsn: Use Random RAI when performing attach request
Change-Id: Id349c7cd0899d6b87114a3ece8bc2ee625f64116
2018-02-18 10:18:14 +01:00
Harald Welte 14a0f94881 sgsn: Use random TLLI when performing ATTACH
Change-Id: If104add9a6d029b674e46e01af71f2e336aa35f0
2018-02-18 10:18:14 +01:00
Harald Welte 5ac3149d99 First actual SGSN test case
Change-Id: Id66ddf8dbe1c5cfa96a087235588ba67763b7f05
2018-02-18 10:12:31 +01:00
Harald Welte 519db89960 L3_Templates: Fix ts_MI_TMSI_TLV / ts_MI_IMSI_LV / ts_MI_IMEI_LV
It seems not all encoder paths properly set typeOfIdentity, so
let's make sure we set it correctly.

Change-Id: Ie35dcf7fec901b786eb2127c1a23f5c161c5778c
2018-02-16 20:03:47 +01:00
Harald Welte b0386dfd30 L3_Templates: More GMM related templates
Change-Id: Idf305731afb9a4c316e7320553705946c3edb633
2018-02-16 20:03:47 +01:00
Harald Welte 78d9f275c2 Osmocom_Gb_Types: Add ts_BSSGP_UL_UD and tr_BSSGP_PS_PAGING
Change-Id: I0504ee9137eef08c2ab0c710d1b57b2c19bf0db8
2018-02-16 20:03:47 +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 158a7ca881 Add L3_Common for shared L3 functions between MSC and SGSN testing
Change-Id: I16e80df610235849180dc946f9457302deafb9d2
2018-02-16 20:03:47 +01:00
Harald Welte e5695f5544 msc: move f_gen_{imei,imsi,msisdn} to L3_Templates.ttcn
This allows them to be reused in upcoming SGSN tests.

Change-Id: I0459eeb44e58342da656f2312560466698374b72
2018-02-16 20:03:47 +01:00
Harald Welte 38575a753b L3_Templates: Add various GMM related templates
... needed for upcoming SGSN testing

Change-Id: I2026c5db3d709566dc3764515d3711b361d82a06
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 853c0ada1d BSSGP_Emulation: Remove one level of indent (like most other code)
Change-Id: I1d6de5404dbf907f663ec89b1847c6de84d5d858
2018-02-16 20:03:47 +01:00
Harald Welte 96a33b00c9 sgsn: Skeleton of a SGSN test fremwork
Based on the exsting NS/BSSGP emulation as well as the VTY, GSUP and
CTRL implementations, we are now building a test framework skeleton
for osmo-sgsn.

Change-Id: Icce90f9d8a680c7a523163e2c0bc03d12ff857e2
2018-02-16 20:03:47 +01:00
Harald Welte e0abc47d32 Migrate Gb (NS/BSSGP) code over to Ericsson NS/BSSGP modules
When we started out, Ericsson hadn't released yet their NS and BSSGP
modules.  Let's port our logic over to their encoder/decoders, as they
are more complete (but less regular / more difficult to use).

Change-Id: Icbc4f5d24f3419f99c9a4805f836bddd2849f492
2018-02-16 18:35:44 +00:00
Philipp Maier 2f8eed0aac BSC: Update BSC_Tests.cfg
The provided BSC_Tests.cfg, which contains as a commented line for
local debugging, does not contain all tests from the control section.

- Update BSC_Tests.cfg so that it contains all tests from the
  control section

Change-Id: I67f5906c3c67ae5793d88eee81b58ceac0bed658
2018-02-16 19:09:00 +01:00
Philipp Maier 70558e3780 BSC: add codec-list to osmo-bsc.cfg
The provided osmo-bsc.cfg does not contain any codec list, this
causes failure of the assignment related tests.

- add missing codec list

Change-Id: Id2509bcac4c54c910efd2db749eaa2085daa358d
2018-02-16 19:09:00 +01:00
Philipp Maier b8e8a1da0e BSC: remove obsolete loglevels from osmo-bsc.cfg
The provided osmo-bsc.cfg contains obsolete log levels.

- Remove obsolete loglevels

Change-Id: I00001c949b69ecaef8a8ed0163779a470378ab08
2018-02-16 19:09:00 +01:00
Philipp Maier 779a7923c7 BSC: add TC_paging_counter to control section
The testcase TC_paging_counter is missing in the control section.
This means that if it is not started explicitly, it is not executed.

- Add TC_paging_counter to control section

Change-Id: Ie37b8cb554ea1db64a8d7927eb300d368ce67137
2018-02-16 19:09:00 +01:00
Philipp Maier 956a92f036 BSC: Do not access unbound BTS objects
BTS[1] in function f_start_handler() is not always populated.

- Check BTS[1] before accessing it.

Change-Id: I37fdf7e6ef521677613f4eadc6f1ea236c04ce8e
2018-02-16 19:09:00 +01:00
Harald Welte 23b774ea48 Move f_hex_is_odd_length from BSSMAP_Templates to GSM_Types
It's a quite frequent requirement in encoding IMSI/BCD numbers, so
let's move it to the more generic GSM_Types module.

Change-Id: I6fb8d9a6f37c990f6901fb48b15312a157954fda
2018-02-16 17:50:35 +00:00
Harald Welte 73489404fd General_Types: Add INT18b_BO_LAST type
Change-Id: I9611cad26bf9a447e63462caa608da1f5888a9d8
2018-02-16 18:43:47 +01:00
Harald Welte ecb8f68c0d gprs: Move BSSGP related code to library
Change-Id: I9e13c63cc12c88be82124a8e3ce3c315b7b3a1fa
2018-02-16 18:33:59 +01:00
Harald Welte fc5e1c85a4 gprs: Move NS Types/CodecPort/Emulation to library directory
Change-Id: I876ce0e981d70ff0e737175983002268fd690989
2018-02-16 18:33:55 +01:00
Harald Welte 6bef5dd781 Makefile: Add 'deps-update' target to update the deps-repository
Change-Id: Idc165425b45872d2eb958a662d03e69aaf60669d
2018-02-15 18:32:28 +01:00
Harald Welte 4c294b6d46 deps/Makefile: Separate 'distclean' from 'clean'
'distclean' removes the actual git clones, while 'clean' now simply
ensures that there are no local changes between to index.

Change-Id: I5de68644b397ff7fbca0595a8900b41508d59bde
2018-02-15 18:32:28 +01:00
Harald Welte 981be73b1c deps/Makefile: Use "git remote set-url" to catch URL changes
In the past, we sometimes had to switch a repository URL (e.g. from
official git repo ot osmocom fork with patches/fixes).  The existing
Makefile didn't pick this up during "make update".  Let's use "git
remote set-url" to always update the remote URL before doing the "git
fetch".

Change-Id: I1d699ad5087f438e64b84c2e5c6e7320cb9457f6
2018-02-15 18:32:28 +01:00
Pau Espin dada4c5a55 ttcn3-tcpdump-stop.sh: Wait to receive last packets before stopping tcpdump
There's a time delay between packets are sent through the system and
tcpdump reads, buffers and stores them into the pcap file. We need to
give it more time to process everything before killing it, otherwise
last (or all) packets from the test are not captured.

Change-Id: I240d8f1bdb2ca6ad353e60ef15937dc2bd4cbebd
2018-02-15 17:22:52 +00:00
Pau Espin 8fdd3130fe ttcn3-tcpdump-start.sh: Wait for tcpdump to start recording
We generate some fake transit and we wait until we catch tcpdump already
saved some packet into the pcap file, this way making sure it is already
recording before starting the test.

The -U flag (--packet-buffered) is added to increase the chances to
sleep less time waiting for stuff being saved into the pcap file.
According to tcpdump manual:
"""
If  the  -w option is specified, make the saved raw packet output ``packet-buffered''; i.e., as each packet is saved, it will
              be written to the output file, rather than being written only when the output buffer fills.
"""

Change-Id: I91cfd84ff5356857a13af1901abfe2204a93f76d
2018-02-15 17:22:52 +00:00
Pau Espin b01d313b83 ttcn3-tcpdump-start.sh: Wait for pcap file creation to start test
It was spotted in the jenkins artficats that pcap files for some tests
are missing. It is probably due to the fact that tcpdump is started in
the background and immediately after the test is started. Some tests are
really quick, which means they are executing before tcpdump starts
creating the file and recording.
While still having the file created doesn't mean tcpdump is already
recording, we at least ensure the file is created and we can see it's
empty at the end. Running this patch in my PC indeed shows that usually
the pcap file is not created immediately after and it waits for 1 second
to continue.

The hack to make sure tcpdump is already recording before starting the
test is to create some traffic (ie ping 127.0.0.1) and then check the
following condition: $(tcpdump -r file.pcap | wc -l) -gt 0

Change-Id: I17a456a27c8e33571f333f4b7efdf61161ebb174
2018-02-15 17:22:52 +00:00
Pau Espin ef59855ac7 ttcn3-tcpdump-start.sh: Log tcpdump output to file
This can be useful in case there was an error in tcpdump, or to make
sure no packets were lost while capturing.

Change-Id: I8d7570bba3c21c017ba38d36185f6ae042967599
2018-02-15 17:22:52 +00:00
Daniel Willmann 90829d6eff MSC_Tests: Set verdicts from inconc to fail
Channels not being closed/cleared at the end of the test is a clear
failure, so don't mark the test as inconc.

Change-Id: Ie9188111da744f0aafaac02841d36a957bfc8d86
2018-02-15 17:45:14 +01:00
Daniel Willmann 5868e62e21 MSC_Tests.f_tc_mo_crcx_ran_reject(): Send release complete to release
Change-Id: I8a19541f3276b994ed34a1d3f9920010660a2ddd
2018-02-15 17:42:59 +01:00
Daniel Willmann 92f662789d BSSMAP_Emulation: Parameter to skip seq no patching
This is needed to check that duplicated messages will actually be thrown
away by the MSC.

Change-Id: I0a6914067ec8daa8903f0ef0c877f178cfd61659
2018-02-15 10:29:01 +01:00
Daniel Willmann 8b084374b5 MSC_Tests: Add CC sequence no. test with DTMF
Change-Id: I9674343acc18187b9e016bd8e0be470d5424046f
2018-02-15 10:29:01 +01:00
Harald Welte 84a2807822 ggsn: Switch over to new shared/common configuration file layout
Change-Id: I491819c8bad8efa45cee161ea6f47c3f97941a17
2018-02-14 21:40:12 +01:00
Harald Welte 7f5825807d BSSMAP_Emulation: Sleep 1s to wait for M3UA/AS/ASP to come active
We don't have a good way to make the BSSMAP code wait for the lower
SIGTRAN layers to be up and running.  To avoid the RESET being
sent before the lower layers are up, introduce a sleep of 1s.

This is ugly, but appears to work for now.  A more proper solution
is more than welcome.

Change-Id: I7a43b3e381405f3af30b3ffe04bc50e64ec66f57
2018-02-14 20:21:26 +01:00
Harald Welte e057146df7 re-organize configuration files; add tcpdump integration
Let's make sure we share common configuration between the test
suites and split the config file into a "default" part which is
used (but not copied) in the Docker images, and a "local" part
which is basically those overrides that the user (or docker image)
wants to do from the default.

Change-Id: I3db452e24e5238aa05254d903739c64d202e61db
2018-02-14 18:50:16 +01:00
Harald Welte 261af4b501 WIP: Intra-BSC handover testing
Change-Id: Ic47e639a7c8640c736c84a44780fc8e111a64b52
2018-02-13 08:15:33 +01:00
Harald Welte c20b1c4207 MSC_ConnectionHdlr: Add telnet to VTY to each ConnHdlr
This allows each ConnHandler to issue telnet commands to the VTY

As a side-effect, it puts some more stress on the VTY interface,
as each [parallel] DchanHdlr now has its own telnet connection.

Change-Id: Ibd726af53219d829286da80b44ea4d9fb2ffdf3d
2018-02-13 08:15:33 +01:00
Harald Welte 70b52c9d4b RSL_Emulation: Add procedure calls to suspend/resume dchan handling
We introduce a procedure by which any DchanHandler can globally
disable all receiving/processing of DChan related messages.  This is
required in upcoming handover code, as we need to block handling
of messages such as RSL IPAC CRCX on the new Dchan before we have
processed the RR HANDOVER CMD and raised an associated expect here in
the RSL emulation code.

Change-Id: Ibef65f87d0d481accbc0e019874dd43b3f9a5dbc
2018-02-13 08:15:33 +01:00
Harald Welte 421e4d4eee RSL_Emulation: Add second RSL/RSL_PROC port for hand-over cases
Also, extend RSLEM_{register,unregister}() with an optional third
argiment, so the RSL_DchanHdlr can register 'expect' also for
that secondary BTS/port during hand-over

Change-Id: Ic22778f17dc4b93ef54837cf400ddd7d1732ae7e
2018-02-13 08:15:33 +01:00
Harald Welte bc03c7693f bsc: Add VTY module to BSC_Tests
Change-Id: Ia78f1231f56fc5f3b003bccc850ea109ed4ed2d8
2018-02-13 08:15:33 +01:00
Harald Welte a4ca446034 WIP: Prepare MSC_Tests for ability to emulate two BSCs
Change-Id: Ibe3ae6ed4181c6ba7501f5443b4f22e3c8abeb3e
2018-02-13 08:15:33 +01:00