Commit Graph

2321 Commits

Author SHA1 Message Date
Neels Hofmeyr cb11a97aaf bsc CBSP: fix tr_CBSP_KILL_FAIL, no lengthof() on record-of with '*'
Keep a local next_idx so that lengthof() doesn't fail after adding a '*' entry.
Fixes this error in BSC_Tests_CBSP.TC_cbsp_write_then_kill:

 Dynamic test case error: Performing lengthof() operation on a template of type @CBSP_Types.CBSP_IEs with no exact length.

Change-Id: I4d95a8ca311f145fa5ea371b6aed099db771d7b8
2020-08-13 19:31:23 +00:00
Daniel Willmann ebdecc0309 bsc: Add statsd checker and use it in TC_assignment_sign
Related: SYS#4877
Change-Id: I8526b645dc4af59adcc1855699421a026f505c1d
2020-08-13 15:02:15 +00:00
Daniel Willmann 742372880b Add parsing and checking of StatsD metrics
Change-Id: Icd1317b5f192d98e6cdc6635788d450501992bf1
Related: SYS#4877
2020-08-13 15:02:15 +00:00
Neels Hofmeyr 62d5da3949 bsc CBSP: fix TC_cbsp_write_then_replace
Change-Id: I62bbce6b9cc48c968fb9e80abe54ae8bed8432a6
2020-08-13 05:38:07 +00:00
Neels Hofmeyr f514848769 bsc CBSP: fix TC_cbsp_write_lai
bts 2 matches the described scenario, not bts 0.

Change-Id: If8408df207176704db0d0ce9d75ae13d500d31ae
2020-08-13 05:38:01 +00:00
Neels Hofmeyr 4e63a01c6e bsc CBSP: introduce g_cbsp_msg_id and g_cbsp_ser_no
For each CBSP test, define one global set of CBSP msg id and serno for use by
that test.

Each CBSP test should use a distinct message id and serial nr, to not get mixed
up with previous state. But keeping those numbers manually is a confusing pain,
and as a reader it is hard to follow how these numbers change (if they do).

In f_cbsp_init_server(), require a preset of msg id and serno to be used in
that test, and from then on only use g_cbsp_msg_id and g_cbsp_ser_no instead of
magic numbers. If they change, write it out explicitly, making it easy to
follow what is expected to happen, and also making it easy to copy-paste code
snippets without having to manually adjust magic numbers.

Choice of numbers: pick a simpler scheme where both msg_id and ser_no share a
common "prefix" in the 1000s range, and for a ser_no add 500 to keep distinct
numbers (that avoid confusion when reading the logs):

test     prefix   msg_id   ser_no  next-ser_no
1        1000     1001     1501    1502
2        2000     2001     2501    2502
3        3000     3001     3501    3502
...

E.g. the first test has the prefix of 1000.
msg_id: 1001, ser_no: 1101.

Change-Id: I43ba196974614d1aea2b6055be2fe82059b38974
2020-08-13 05:37:54 +00:00
Neels Hofmeyr 90a07524d1 bsc CBSP: cosmetic: rename f_cbsp_init_tail() to f_expect_cbsp_restart()
It might be part of initialization, but what this function does is expect to
receive a CBSP RESTART, period.

Change-Id: Ieffe70cf43eb79b798d93717bbce294ee809f0e2
2020-08-13 05:37:44 +00:00
Neels Hofmeyr a16afdc4c6 bsc CBSP: TC_cbsp_write_bss: run a fixed series of payload lengths
Recently fixed errors in the last_block counting as well as encoding ask for a
proper test coverage of various lengths, which also verifies the expected
blocks count explicitly.

Implement this in TC_cbsp_write_bss():

Run f_tc_cbsp_write_bss() multiple times with differing fixed payload lengths,
at all block count transitions, plus some arbitrary lengths in-between.

Before this patch, TC_cbsp_write_bss() would pick a different random payload
length for every test run, which, until recently, then sporadically hit
last_block value errors. That's not good for reproducability.

Change-Id: I3cace19f9e5adc8ebab13ef2328a36dc150b2b31
2020-08-13 05:37:35 +00:00
Neels Hofmeyr 63e2e1886a bsc CBSP: f_page2rsl(): allow expecting specific nr of blocks
Subsequent patch I3cace19f9e5adc8ebab13ef2328a36dc150b2b31 adds a test with
specific payload lengths. To verify the correctness of the number-of-blocks
calculation (recently fixed), allow pinpointing the expected blocks count.

Change-Id: Ie58a6175e55ab2679dc69f9e191d0efc0e84cde0
2020-08-13 05:37:28 +00:00
Neels Hofmeyr 4c365329a9 bsc CBSP: f_gen_page(): allow passing explicit payload len
Keep the default of using a random payload length, but also allow picking one
specifically. TC_cbsp_write_bss() will use this in a subsequent patch.

Change-Id: I259da42cbcbfdfe930aabb45c9de8a2b67c69629
2020-08-13 05:36:26 +00:00
Neels Hofmeyr ba9c51b223 bsc CBSP: f_gen_page(): fix generated payload size range
Fix the length calculation to provide a range of [1..82].

f_rnd_int() generates [0..max[ (i.e., < max), so f_gen_page() so far has a
payload len range of [0..81]. We want no zero payload, and we want a maximum of
82 bytes (page max of 88 minus 6 header bytes).

Change-Id: Id521b6038a23dc8e71ea25475bcdef7bc8917531
2020-08-13 05:36:26 +00:00
Neels Hofmeyr f793a7e464 comment: Osmocom_Types.ttcn: clarify f_rnd_int() return val
Change-Id: I0841b037d39fcadb75e1c13cf97d22917b68e2aa
2020-08-13 05:36:26 +00:00
Neels Hofmeyr df65951d5c bsc CBSP: f_page2rsl: fix nr of blocks calculation
When dividing the payload by 22, the initial 6 header octets must also be taken
into account.

And, the last_block value indicates 4 as 0, which is not encoded correctly
before this patch. Add a separate f_cbsp_block_count_enc() to fix the
calculation.

Change-Id: I06cc144bd92e94d461dac3f56a738da8e055b73a
2020-08-13 05:36:26 +00:00
Neels Hofmeyr 289c36a6e3 bsc CBSP: quick-fix f_cbsp_init_client()
Expecting a CBSP RESTART when connecting as CBSP client does not work, osmo-bsc
doesn't send any. Let's ignore this to get the CBSP tests running at all first.
We should clarify expected behavior and apply that, later (OS#4702).

Related: OS#4702
Change-Id: Ib93530691344c6dc4c0a8318bee2edf87e309a42
2020-08-13 05:36:26 +00:00
Neels Hofmeyr 74083c2f84 bsc CBSP: fix osmo-bsc.cfg to contain 3 BTS with a CBCH
The bsc/BSC_Tests_CBSP.ttcn rely on a configuration where the first three BTS
carry out SMSCB messaging, and the fourth BTS does not. That requires a CBCH
channel config on bts 0, 1, 2.

Side effects:

- adjust the number of available SDCCH (for TC_chan_exhaustion).

- there now is a CBCH channel description in SI4, add this to
  SystemInformationConfig_default.

Related: Idbcc703ace7012fb395f0eef3e445df28b368d74 (docker-playground)
Change-Id: Iac46ee2cc5bc0978d5f5baa550baf493a7c56b1b
2020-08-13 05:36:26 +00:00
Neels Hofmeyr 8f57671960 bsc: fix f_vty_msc_allow_attach(): do not create new empty mscs (fix latest)
In the ttcn3-bsc-latest tests, there are no 'msc 1' and 'msc 2' configured, so
stepping into 'msc 1' and '2' creates two new, empty MSC configurations.
osmo-bsc latest actually still tries to use them and fails 2/3 Compl L3.

So do not step into 'msc' config scopes if no such MSC is mentioned in the
running config yet.

This should finally fix the bsc latest tests after I broke them in
I02ad58ed7d0d0aac61e393b415e09c6c5c8a70ca and
Ibd5adb359b3fb302e2c70700d911878aef605ff3 and
I75295d638072df9f5213a7e74e4a960c009c2865.
Yes, I know :/

Change-Id: Ibfeeea98c2a962dec58ad03beb35bb7f83cad228
2020-08-12 22:54:09 +00:00
Philipp Maier 2609c750d5 MGCP_Test: add E1 related testscases
osmo-mgw recently added support for E1 trunks via libosmoabis. While the
actual E1 plane may be difficult to test, there is some functionality
that can already be tested without having E1 support in TTCN3.

Lets add three testcases:
- TC_e1_crcx_and_dlcx_ep:
  Does a CRCX to an E1 endpoint followed by a DLCX
- TC_e1_crcx_with_overlap:
  Not all E1 endpoint combinations are possible at the same time. This
  test verifies that invalid endpoint combinations are prevented.
- TC_e1_crcx_loopback:
  Opes an E1 endpoint and tests if RTP loopback works (NO E1 traffic
  involved)

Change-Id: I673eeffcb3012b42f039789960c54d99282e1aad
Related: OS#2659
2020-08-12 18:21:49 +00:00
Neels Hofmeyr 95a5edc308 bsc: test RR Channel Release cause codes from Clear Command cause codes
Invoke Clear Command with various Cause codes and verify that the RR Channel
Release reflects them.

Depends: I734cc55c501d61bbdadee81a223b26f9df57f959 (osmo-bsc)
Change-Id: Ie6c99f28b610a67f2d59ec00b3541940e882251b
2020-08-12 18:21:24 +00:00
Neels Hofmeyr 0edf4ac242 bsc: test RR Channel Release EARFCNs
Add a DCHAN and release to recently added SI2quater tests (because these tests
already configure various amounts of EARFCNs in osmo-bsc).

Verify that the RR Channel Release for CSFB contains all configured EARFCNs.

In GSM_RR_Types.ttcn, add coding for "Cell selection indicator after release of
all TCH and SDCCH IE".

In f_expect_chan_rel(), add optional arg csfb_expect_cells, and, if present,
decode the RR Channel Release message's L3 part, and in turn the Cell Selection
Indicator Value contained. Match against csfb_expect_cells.

In f_tc_si2quater_n_earfcns(), also compose a list of EARFCNs as found in the
RR Channel Release, and pass to f_expect_chan_rel().

Depends: I59e427e4ebb1c6af99b27a15c40fed82457ac8ab (osmo-bsc)
Change-Id: I882c5e1f70bcc4833fc837a95c900ce291919cc5
2020-08-12 18:21:24 +00:00
Philipp Maier 606f07d113 BSC_Tests: Make sure CHAN RQDs for emergency are denied
Test that a CHAN RQD that indicates an emergency call is rejected if
emergency calls are disabled.

Change-Id: I9084df86e8f808e3c1d948ab88e07e7458761a71
Related: OS#4548
2020-08-12 17:37:44 +02:00
Philipp Maier af58db2db9 BSC_Tests: fix TC_chan_act_ack_noest_emerg
The testcase TC_chan_act_ack_noest_emerg tests if an emergency causes a
channel assignment. This can only work if emergency calls are allowed,
but the testcase does not make sure that this actually is the case.

Related: OS#4548
Change-Id: I0ddac0ba8ed4afe993d566dcbea87cdc62ed9fe4
2020-08-12 17:37:44 +02:00
Neels Hofmeyr 5c59a8f04a another fixup for "fix mscpool cleanup (fixes LCLS tests)"
During patch grooming of the previous fixup, one patch line went missing, which
breaks the ttcn3-bsc-test-latest completely. Add that change now.

Change-Id: I75295d638072df9f5213a7e74e4a960c009c2865
2020-08-12 11:19:23 +00:00
Philipp Maier 783681ce42 BSC_Tests: test handling of EMERGENCY SETUP
The EMERGENCY SETUP is an L3 message that normally gets passed through
transparently to the A interface. Nomrally the BSC will not look into L3
messages. However if EMERGENCY CALLS are allowed on a BTS or not is set
in the system information. Also osmo-bsc has the option to deny
EMERGENCY CALLS globally for all BTSs.

Since EMERGENCY CALLS are a crucial application, the BSC should not only
send the appropiate sysinfo messages that forbid emergency calling. It
should also make sure that any attempt to make an emergency call is
rejected early if emergency calls are denied.

Lets add some checks to verify that the allow/deny mechanisms for
EMERGENCY CALLS are working as expected.

Depends: osmo-bsc Ia6eb38370ce4165d221d2ffbe1cd105c0628313c
Change-Id: I486d99953529a1ce9f0a3950c9a97900922eee92
Related: OS#4548
2020-08-12 10:22:29 +00:00
Philipp Maier 4ce978ca5d MSC_ConnectionHandler: check template before using isvalue()
The function f_establish_fully may be called with template ass_tpl set
to "omit". In this case we must make sure that we do not pass ass_tpl on
to isvalue().

Change-Id: Ie094e5b56a851351671327b475d5e597a5a94bf6
2020-08-12 10:22:29 +00:00
Neels Hofmeyr 345a15f213 log: for VTY Unknown Command, fix weird log message
In f_vty_wait_for_prompt(), this:

   testcase.stop(fail, "VTY: Unknown Command")

outputs:

   failVTY: Unknown Command

The first stop() argument 'fail' is not actually a test verdict, but gets
rolled into a log output string, becoming "failVTY".

Fix that by simply using the normal pattern of setverdict() followed by
mtc.stop().

Change-Id: Id09986444de02c10b4fba582d454d54568b6e8a2
2020-08-12 01:05:59 +00:00
Neels Hofmeyr e4b0a662ca fixup for "fix mscpool cleanup (fixes LCLS tests)"
For the VTY "Unknown Command" code path, we must actually call 'repeat', to
avoid racey VTY behavior from cruft stuck in the VTY pipe.

The missing 'repeat' caused massive random fallout in the 'latest' builds,
which often hits the 'Unknown Command' code path; fixed by this patch.

Change-Id: Ibd5adb359b3fb302e2c70700d911878aef605ff3
2020-08-12 01:05:48 +00:00
Philipp Maier 9c60a6228b BSC_Tests: extend TC_chan_act_ack_noest with emergency call
TC_chan_act_ack_noest requests a channel and then releases it again.
However, this does not test yet what happens if the requestor (BTS) uses
a request reference that indicates an emergancy call. Depending on the
configuration the BSC should reject or allow the channel to be
established.

Change-Id: If828c0f5786d89efa7608f38d648e2a2b8f6f675
Related: OS#4549
2020-08-11 17:07:41 +00:00
Neels Hofmeyr a460f1f9ba fix mscpool cleanup (fixes LCLS tests)
osmo-bsc takes a while to notice that a connected MSC is no longer connected.
Once the mscpool tests have run, the additional msc 1 and msc 2 still linger
around even though the BSSMAP link is no longer served by the bsc-tester.

The easiest way to ensure that only expected MSCs are contacted is to set
'no allow-attach' for each MSC that should not be in use.

So, the default setup is 'allow-attach' on msc 0, and 'no allow-attach' on mscs
1 and 2. In f_init(), allow attach on those MSCs indicated by the nr_msc
amount. The entire vty transaction to configure attach/no attach for all three
MSCs takes about 4 micro seconds in my test setup, so it is fine to do this
during f_init() for each BSC test.

After this, tests running after the MSC pooling tests (the LCLS tests) no
longer round-robin their subscribers across disconnected MSCs.

NOTE: it would be good to somehow detect more reliably in osmo-bsc that an MSC
is gone and not use it anymore. That is however not so trivial. To get the LCLS
tests back online, this is a workaround to avoid that complexity for now.

Change-Id: I02ad58ed7d0d0aac61e393b415e09c6c5c8a70ca
2020-08-10 20:16:09 +00:00
Neels Hofmeyr 2fe5ad171d f_vty_transceive: allow to ignore unknown vty commands
When a new test uses a VTY configuration that may not yet be available in the
'latest' build, it can be useful to ignore the "Unknown VTY Command" error.

To be used by f_init() for multiple MSCs, setting a default 'allow-attach' flag
per MSC implicitly -- such vty config is not yet supported in the latest build.

Change-Id: I284c42e10c0cb282c8410db87959b471867edef6
2020-08-10 20:16:09 +00:00
Vadim Yanitskiy 7faef076ab BTS_Tests: verify hopping parameters in the INFO.ind message
Change-Id: I9bb164fd2c7c48b91e0d7bd1abaf3cfec155342c
Related: I04782222b499d0488269544910fbd4ed9929c05d
Related: SYS#4868, OS#4546, OS#4547
2020-08-09 20:03:38 +07:00
Vadim Yanitskiy 4fa7425b14 BTS_Tests: compose the MA bitmask in f_resolve_fh_params()
Change-Id: Ic0a07d9deb60712347a42d9aa7813c684eaccd01
Related: SYS#4868, OS#4546
2020-08-09 20:03:38 +07:00
Vadim Yanitskiy 94fe83e8ab PCU_Tests: verify handling of frequency hopping parameters
Change-Id: I1beda9224998848f9243237413e5ae3e0ddab8a5
Related: SYS#4868, OS#4547
2020-08-09 20:03:38 +07:00
Vadim Yanitskiy 355604cbcf library/PCUIF_Types: add receive templates for PCUIF_InfoTrxTs
Change-Id: I062079de4440d2c9c0a079cc4cc4328ea0ea37dd
2020-08-09 20:03:38 +07:00
Vadim Yanitskiy 9e1206c791 library/PCUIF_Types: version 10: add frequency hopping parameters
This change introduces new version 10 specific extensions, in
particular: the frequency hopping parameters of each timeslot.
These parameters are used to compose Channel Description IE
in the packet resource assignment messages.

In order to maintain backwards compatibility with version 9 of
the PCUIF, and thus to still be able to run test cases against
the latest release of osmo-pcu, I kept the old parts of the
INFO.ind and gruoped them together with the new records
into union 'PCUIF_InfoTrxs'.

During decoding, the content of this union is resolved by the
TITAN's RAW codec itself, depending on value of the 'version'
field.  During the encoding, it's the responsibility of the
API user to set a proper field of the union.  I implemented
both f_PCUIF_ver_INFO_{Trxs,PDCHMask} helpers for that.

Version 9 is kept as default, so this change can be merged
independently of the actual implementation.  We can bump
it and remove the compatibility glue once the new versions
of both osmo-bts and osmo-pcu are released.

Change-Id: Idf11bc4ba3ff0b00b32f2beab8fd020c67119d05
Related: SYS#4868, OS#4547
2020-08-09 19:58:25 +07:00
Harald Welte c097755992 stp/STP_Test.cfg: Add M3UA and IPA tests
Change-Id: Ib8a874d842854cd919edbc1929352fcc3fc1ad97
2020-08-06 16:48:38 +00:00
Neels Hofmeyr 579bfa8e33 bsc CBSP: allow passing guard_timeout to BSC_Tests.f_init()
An upcoming patch adds a test series (of various payload lengths) to
TC_cbsp_write_bss(), which then needs a bit longer than 30 seconds to run
through those. That test will pass a longer guard_timeout.

Change-Id: I54e1b3994074f4d0caf5b201588fce0ec41dda89
2020-08-04 11:40:38 +00:00
Vadim Yanitskiy 0d1511d96e BTS_Tests/SMSCB: enable test cases for CBCH on SDCCH/8
Change-Id: I15286bb784ce828bd9fa709945382af9b2b62b44
2020-07-31 06:45:31 +07:00
Vadim Yanitskiy f1c95c8b1c BTS_Tests/SMSCB: establish a dedicated channel in f_smscb_setup()
Change-Id: I3f061a4d48209b1aa5eaea2fd05fc4752de0c70f
2020-07-31 06:44:02 +07:00
Vadim Yanitskiy ffcd128f10 BTS_Tests/SMSCB: improve SDCCH8+CBCH handling and configuration
Change-Id: I130a028df7dc476ab765733261a1f007f19f39a8
2020-07-31 06:41:52 +07:00
Harald Welte 94528c7e58 CCID_Tests: Fix USB VendorID
The VendorID of the sysmoOCTSIM is 0x1d50, not 0x1df0.

Change-Id: Id0eda6e661bca6bed7367c3af1a38b795ea959b0
2020-07-30 22:12:30 +02:00
Harald Welte c6fde3f751 CCID_Tests: Ensure the response to "SELET MF" is two bytes (SW) long
we used to accept arbitrary length responses, which made us fail to
catch the bug described in OS#4684

Change-Id: I35721ce55b58a2f70ea30a0d1bd16d2ac58dfcab
Related: OS#4684
2020-07-30 22:12:30 +02:00
Pau Espin c6136cd4e4 Introduce test TC_si_acc_ramp_rotate
Change-Id: I29acf4f117ccea53028c780cc9feb1da1fc16739
2020-07-30 11:27:10 +00:00
Neels Hofmeyr 7944004f28 bsc CBSP: add log context for CBSP port errors
Change-Id: Ifd90e84ee65d0cb03eefc7ae1da2605650daf7ac
2020-07-29 20:03:50 +00:00
Neels Hofmeyr ee3b927ea4 bsc CBSP: add numerous mtc.stop after fail verdicts
I found that I had to wait 30 seconds after a failure verdict.

Change-Id: I8314c53037948fae51028119c81ea247baed44ec
2020-07-29 20:03:50 +00:00
Neels Hofmeyr 1011c01fb5 bsc CBSP: drop unused vars 'pages'
Change-Id: I252fed22cccfc77a4f9cfdd2a0e3070ceeefc547
2020-07-29 20:03:50 +00:00
Pau Espin 85a8443c3c bsc: Introduce test TC_si_acc_rotate
Related: SYS#4911
Change-Id: I18d0243353fce547d126d62c34415628a21cb52b
2020-07-24 11:05:44 +02:00
Pau Espin ffe4739a5b deps/Makefile: Update to newer titan.ProtocolEmulations.M3UA master containing build fix
For more info, see https://git.eclipse.org/r/c/titan/titan.ProtocolEmulations.M3UA/+/166637

Change-Id: I2550d6883464835e5977a8876c514c8ab707fac4
2020-07-24 11:03:55 +02:00
Vadim Yanitskiy 7431e9e8db GPRS_Components: s/f_ms_rx_imm_ass_pacch/f_ms_rx_pkt_ass_pacch/g
Immediate Assignment is sent on AGCH/PCH, while on PACCH we have
Packet Uplink/Downlink Assignment instead (see 11.2.29, 11.2.7).

Change-Id: I56473ae5dfa565d2c9d26984b14685a4163bf69a
2020-07-23 04:57:05 +07:00
Vadim Yanitskiy e2a6fdf304 fixup library/GSM_RR_Types: fix BYTEORDER in MobileAllocation
The following bitstring in TITAN:

   0                 N    // N = NF - 1
  -------------------->
   0001 1011 1110 0100    // '0001101111100100'B

needs to be be encoded as follows 'on the wire':

   N                 0    // N = NF - 1
  <--------------------
   0010 0111 1101 1000    // '0010011111011000'B

so it basically gets inversed => we need to use BYTEORDER(first).

Change-Id: Iea2e3a9a7a0557d1ab5d935877d2161ee0988077
Fixes: I70b1baf01859d0cf3b8cec1aed04d73fc097a9b1
Related: SYS#4868, OS#4547
2020-07-23 04:53:16 +07:00
Vadim Yanitskiy 06c416125e library/RLCMAC_CSN1_Types: fix length field in GprsMobileAllication
- Length of field 'MA_BITMAP' is specified in bits, not bytes;
  - The value range of field MA_LENGTH is 0..63, therefore:
    - value  0 means that field 'MA_BITMAP' is  1 bit long,
    - value  1 means that field 'MA_BITMAP' is  2 bits long,
    - value 63 means that field 'MA_BITMAP' is 64 bits long.

Change-Id: Iec19da18637febfa15bc09175bc51504c721c42f
Related: SYS#4868, OS#4547
2020-07-23 04:50:59 +07:00