Commit Graph

747 Commits

Author SHA1 Message Date
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
Harald Welte 33ec09bf34 msc: Mobile Terminated Voice Call test
Change-Id: I4fa353623991ac98726217559fea9f83f64715ea
2018-02-11 11:49:48 +01:00
Harald Welte 49518bf842 BSSMAP: Fix L3 sequence number for ComplL3(Paging Response)
The existing code generating L3 sequence numbers in MO direction
made the assumption that the L3 message inside ComplL3 would always
be MM/CM, and increment the sequence number.

However, in case of a paging response, it is actually RR, which
does *not* have L3 sequence counters.  So we must make the sequence
counter increment dependant on the L3 protocol discriminator.

Change-Id: I25a5dd0c180c9acfa870984c6b122ac0c46383b3
2018-02-11 11:49:47 +01:00
Harald Welte 1823cb18a1 MNCC: Fix encoding of non-signal MNCC PDUs
Change-Id: I0b673f16daeccfdd2c9b5a4ee119c71f87a9644b
2018-02-11 11:46:32 +01:00
Philipp Maier e8f38ed2b3 BSC: do not flush RSL queue early in TC_chan_rel_a_reset()
When f_expect_chan_rel() is called after receiving the BSSMAP
RESET and DISC.ind f_expect_chan_rel() is called. The flush
parameter is not set, which means the default flush = true is
valid. This leads into an early flush of the RSL Queue and
tosses the RSL RELEASE REQUEST we expect, so the test can not
pass, even when the BSC sends the RLEASE REQUEST.

Looking further up in the code. IPA_RSL[0].clear is called,
so the Queue is flushed to get rid of unwanted messages from
the IMMEDIATE ASSIGN. There is no need to flush the queue
a second time anyway.

- Do not flush the RSL queue, set flush=false when calling
  f_expect_chan_rel()

Change-Id: I2962f741e0b13dec08ac6c918d326828beb65a6a
2018-02-10 10:09:28 +00:00
Harald Welte 0bef21e645 msc: Add Emergency call to f_mo_call() and use it from TC_emerg_call_imsi
This fixes TC_emerg_call_imsi with current osmo-msc master. The old
implementation was broken as it didn't deal with MGCP yet.

Change-Id: Ic35797931387b078205269365421ad730db7af15
2018-02-10 11:06:55 +01:00
Harald Welte 081b19a791 msc: Unify channel establishment for CM SERV REQ + PAGING
Change-Id: I24e3dfa1ef88c48c39bf0248074e88e682bc8404
2018-02-10 11:06:55 +01:00
Philipp Maier c0375167da MGCP: remove hack to fake SDP
A problem with the parameter ordering inside the mgcp-client
(osmo-mgw) prevented TTCN3 from accepting the SDP data that
was generated by the IUT. The problem is now fixed and the
hack can be removed.

- remove hack

Change-Id: Ic37f78c2676e7c98144f10e9f3b55bc9651a4f7c
Related: OS#2818
2018-02-08 17:25:03 +01:00
Philipp Maier b20c3dcced msc: convert bssmap chipher to rsl chiper representation
The representation of the chiphering algorithm is different bssmap
and RSL. BSSMAP uses a bitmask and RSL a numeric value. For A50 and
A51 the values match up by coincidence, from A5/2 onwards they differ.

- Add a function to convert the BSSMAP representation to the RSL
  representation and use the converted value to set up the temlate
  for the expected RSL message

Change-Id: I274c1ff0b5636c48411f994f918e783b468cb3be
2018-02-08 15:17:30 +01:00
Philipp Maier 86f3920e5b bsc: fix f_establish_fully() for expected assignment failures
The altstep guard statements are to restrictive so they do not
match on an expected assignment failure anymore.

- Add a new altstep for expected assignment failures.

Change-Id: I78b839f0bcb7e2da61bff0add3abc452bfea40a2
2018-02-07 18:45:08 +01:00
Daniel Willmann dcf9eb92f4 L3_Templates: Use tid parameter in ts_ML3_MO_CC template
Change-Id: I6c28b206625cb081a98a722b8c793ce02af74441
2018-02-06 16:23:36 +01:00
Daniel Willmann 4bd9955045 MSC_Tests: Make imsi suffix for f_start_handler unique per test
Change-Id: I02d1f2ac717fee278e3903d325942697637a5d28
2018-02-06 16:23:36 +01:00
Daniel Willmann ff6abf0f2d MNCC_Emulation: Initialize connection table
Change-Id: I903f6bf14a15abc6cae1d527195414c5f081c2df
2018-02-06 16:23:36 +01:00
Daniel Willmann 47fb0f4871 start-testsuite.sh: Pass a third parameter to ttcn3_start
The name of the parameters is a little misleading, since the second
parameter could just be a testname.

Change-Id: Ibe207a83c477c918a865a8a34cad7ca5d45c7eac
2018-02-06 16:05:04 +01:00
Daniel Willmann 12984ef36d deps: Ensure that branches are updated on make update as well
Don't just force-checkout the local master branch again, but reset to
origin/master

Change-Id: I7d5e0e3d7f92fc51fa438b92f00c79f63945e74f
2018-02-06 16:04:04 +01:00
Harald Welte 9dadc522d7 BSSMAP_Emulation: Send proper L3 N(SD) seuence numbers in MO
We have to make sure all mobile originated L3 messages carry
proper sequence numbers

Change-Id: Id8638673ad1a133f46893b2140970ec072022b3a
2018-02-06 13:43:36 +00:00
Max 6367d7b807 Don't symlink non-existent file
Change-Id: I10309f07fb207c027703f0b43a478c152a029b6d
2018-02-05 16:58:27 +01:00
Harald Welte d13700dd6c MNCC: Represent 'keypad' as one-character charstring, not int
The MNCC Unix Domain Socket encoding uses an int here, which is
a bit odd, given that it's an ASCII / IA5 char value on the actual
GSM L3.  Let's convert from/to something useful.

Change-Id: Id17ac502ca33f4962214a3d5938d0dc29ca6ec1b
2018-02-03 21:45:47 +01:00
Philipp Maier 8a3dc925da MGCP_Test: test illegal wildcarded DLCX and MDCX
- Add tests to check the behaviour on wildcarded DLCX and MDCX,
  both commands not supported by the MGW and should fail.

Change-Id: I140c6d9e337cd16d6147bb582a9474cf76b5170b
2018-02-02 16:14:37 +01:00
Philipp Maier dffa6a46e6 MGCP_Test: Clean up after TC_crcx_sdp
The testcase TC_crcx_sdp does not clean up the connection it
created. This can cause subsequent tests to fail.

- Use f_dlcx_ok() to clean up the connection once the test
  is done.

Change-Id: I4e0f5ce218fadc5debe0bbf548b69919584ab66c
2018-02-02 16:14:37 +01:00
Philipp Maier 5e06ceefbe MCGP_Test: Add tests for wildcarded CRCX
The wildcarded CRCX is not tested yet.

- Add a test function that executes a single wildcarded CRCX
  request

- Add a test function that exchausts all MGW resources using
  wildcarded CRCX requests

Change-Id: I70cf486dc21aef19e4199289f5a5509f6927713e
2018-02-02 16:14:37 +01:00
Philipp Maier bb7a01c696 mgw: add constants for mgw endpoint and domain name
The testcase for osmo-mgw hardcodes the mgw domain and also lacks
an endpoint identifier, which was deprecated recently.

- replace the hardcoded occurrences of the mgw domain name with
  a constant

- add a constant for the rtpbridge endpoint identifier

- add a testcase that still uses the old method without prefix
  on the endpoint identifier.

Change-Id: If4455c4cb521270b2fe24881ade9b578a5132205
2018-02-02 16:14:28 +01:00
Harald Welte e9e02e4556 bsc: Add TC_err_84_unknown_msg to check if unknown RR message triggers RR STATUS
... as declared in TS 24.008 Section 8.4

Change-Id: I4f81b955567d2a33ead350ed312c4c4f6dd7ed8a
2018-01-31 23:37:14 +01:00
Harald Welte e3bd658abf bsc: reduce code duplication; add new test case on too short messages
Change-Id: I8232ee58c14a4358a01b5428ff2b4e559491b185
2018-01-31 23:37:14 +01:00