Commit Graph

121 Commits

Author SHA1 Message Date
Philipp Maier 1298b09cb4 MGCP_Test: fix TC_dlcx_wildcarded
Due to the migration to a multithreading scheme the timing behavior of
the stats items has slightly changed. There is now a 1 sec update cycle
in which the stats items are regenerated. This means we have to wait 1
sec. before we can query the endpoints.used stats item.

Change-Id: I90613616f9ff85ca59464dfd45d331ed1a54d9c5
Related: OS#5316
2021-11-18 19:10:55 +00:00
Oliver Smith f8fe1329e2 regen_makefile.sh: set executable name explicitly
Set the executable name in each regen_makefile.sh explicitly with -e,
instead of having it set indirectly from the first .ttcn file. Make it
consistent by placing the name on top of each of these files.

Fix for warning:
ttcn3_makefilegen: warning: File `BSC_Tests.ttcn' was given more than once for the Makefile.

Related: OS#5252
Change-Id: I5ed03f8f3ed905483620dc7bae33b617bbb8507f
2021-10-13 11:12:22 +02:00
Oliver Smith 2e0e624060 regen_makefile.sh: files/flags in separate lines
Make all regen_makefile.sh more readable and diff friendly by moving
each entry in FILES and CPPFLAGS_TTCN3 into separate lines. Order
entries alphabetically.

Related: OS#5252
Change-Id: I6b6866eb9f6ec6232e4ae434517457a4c8c1c050
2021-10-12 16:35:01 +02:00
Philipp Maier 3560bd656a MGCP_Test: add control interface to MGW testsuite
The testsuite for osmo-mgw does not use the control interface yet.

Change-Id: I7324802bf6e692ce8b7d9b269dd2385a7d3d0d77
2021-08-19 11:52:23 +02:00
Philipp Maier 2ff3e66bf0 MGCP_Test: do not use module parameter mp_test_ip (statsd)
The module parameter mp_test_ip was added with the following commit:
Change-Id I61e23e264bc85eb36d07431c7839fb445c110947

There is already mp_local_ipv4, which has the same function, so we
should remove mp_test_ip again and use mp_local_ipv4 to set up the
receiving of statsd information.

Change-Id: I70f33aed4102c67118cc6701c2578a70c0dfe604
Related: SYS#5535
2021-08-19 10:58:25 +02:00
Philipp Maier 4268cd372f osmo-mgw.cfg: add missing statsd configuration
The recently added test TC_dlcx_wildcarded depends on statsd information
from osmo-mgw but in the osmo-mgw configuration no statsd is configured.

Change-Id: I35e07a6b1853234559ab4d7e044f3899e8d0a3e8
Related: SYS#5535
2021-08-17 12:14:06 +00:00
Philipp Maier 21c1cffcec MGCP_Test: test DLCX request to non existant endpoint
Since we now support wildcarded DLCX request, which so not necessarly
require a specific endpoint (the trunk is enough). We should also check
what happens when we send a DLCX request to a non existent endpoint. The
situation would be very similar. osmo-mgw will be unable to resolve the
endpoint, but the trunk will be resolved. However eventually the request
is not wildcarded and we expect that osmo-mgw is rejecting it.

Change-Id: I3d8c6f84404c1c95f97f113813528175523d36b8
Related: SYS#5535
2021-08-03 17:16:04 +02:00
Philipp Maier 55b905446c MGCP_Test: upgrade expected behavior for TC_dlcx_wildcarded
The testcase TC_dlcx_wildcarded expect osmo-mgw to reject wildcarded
DLCX requests but osmo-mgw now implements wildcarded DLCX

Depends: osmo-mgw I6d3a74f6087512130d85002348787bffc672de81
Depends: docker-playground I693cc17dbf6836e7a74b34111671b6e589744a63
Change-Id: I61e23e264bc85eb36d07431c7839fb445c110947
Related: SYS#5535
2021-08-03 17:16:04 +02:00
Neels Hofmeyr cb8d9894af update expected-results.xml files
Change-Id: Idcf764cd2d251210bb123d2a5ea782cda0d670b7
2021-07-05 13:11:14 +02:00
Philipp Maier 37965088d5 MGCP_Test: avoid crash in latest (TC_one_crcx_loopback_rtp_implicit)
The testcase TC_one_crcx_loopback_rtp_implicit triggers a bug in older
osmo-mgw version that eventually leads into a crash of osmo-mgw. This
also means that all tests after TC_one_crcx_loopback_rtp_implicit will
also fail. Lets move TC_one_crcx_loopback_rtp_implicit to the end of the
control section to postpone the crash to the very end of the testrun.

Change-Id: I25abf30f8c49e580c46e7a61e887bd0add9a4cd4
Related: OS#5123
2021-06-02 18:54:26 +00:00
Philipp Maier c0ca42d119 MGCP_Test: add testcase TC_one_crcx_loopback_rtp_ipv6
There is an TC_one_crcx_loopback_rtp, an ipv6 variant can be added with
minimal effort.

Change-Id: If16ee5186fa697caa9cc404b7159be054cac5196
2021-05-17 20:32:09 +00:00
Philipp Maier eba70db649 MGCP_Test: fix TC_one_crcx_loopback_rtp_implicit
The testcase TC_one_crcx_loopback_rtp_implicit uses
f_TC_one_crcx_loopback_rtp, which creates the RTP flow with IPv4
addresses but since we do not send a local RTP IP address with the CRCX
to the MGW, the MGW will prefer IPv6, which means that we get an IPv6
address back while the RTP strem is IPv4 on the TTCN3 side.

Related: OS#5123
Change-Id: I80498737d5b32f28b62e0c17cce1969b54af948c
2021-05-17 20:32:09 +00:00
Philipp Maier 1ac1398d9f MGCP_Test: test LOOPBACK with implicit destination addr
Test what happens when the MGW gets a CRCX that creates a connection in
LOOPBACK mode but does not specify an RTP destination address. The MGW
is expected to deduct the destination address from the first incoming
RTP packet and loop it back to its originating address.

Change-Id: I7baf827fb0c3f33e13ccbaffd37ba0eb4e20c304
Related: OS#5123
2021-05-13 18:01:25 +00:00
Harald Welte 317c04f2ad mgw: osmo-mgw config should not try to set DSCP > 63
DSCP is a 6-bit value, it cannot be 184.

Change-Id: I9e023125d42ba350c924f2dd7055e84a1a6564cc
2021-04-28 19:27:37 +02:00
Alexander Couzens 7d8c0e3b35 update expected-results.xml
Change-Id: Ib4399aa488afd917e3eda5e79d56ea3797ef7c78
2021-01-14 21:40:30 +01:00
Neels Hofmeyr 929b406940 update expected results
Change-Id: Icb534a2b00fc48c3ead009a620e6061e595cb581
2020-10-01 06:48:55 +02:00
Pau Espin befd3aaca4 mgw: Introduce test TC_crcx_osmo_ign
Related: SYS#5063
Change-Id: I79415c385e89fe859854430bb20940f078fccea0
2020-09-22 19:32:11 +00:00
Pau Espin 9e0141aa84 mgw: Test IPv6 RTP streams in osmo-mgw
Change-Id: I2a47926757af84ffa190a954aac0dcc5369528b3
2020-09-09 18:13:37 +00:00
Pau Espin db2dc0494e mgw: Test IPv6 addresses in MGCP messages
These tests verify that osmo-mgw handles requests no matter of IP
version used in the remote address.

Change-Id: Ib134dda5a8f7c8f50968b6ce330f9986ae72575d
2020-09-09 13:54:42 +00:00
Pau Espin b604af09ea mgw: Rename IP address module parameter specifying IP version
Change-Id: Ia393d7175de277ec8fa524ba74bf3b150b74c766
2020-09-09 13:54:42 +00:00
Pau Espin 25f47a72dc mgw: Fix using incorrect IP version in TC_one_crcx_receive_only_rtp
Send the remote address to MGW so it knows which IP version to return
during CRCX ACK. This actually better suits the test, since there's less
point in checking whether we receive something if we never pass the
IP/port to MGW. In any case, the "recvonly" should still tell MGW to
refrain from sending stuff to us, so we are really testing that here.

Change-Id: Id3452cecf7fb281e5e46471f7f53983c08c6bfdf
2020-09-09 12:22:42 +00:00
Pau Espin e67b1c64ce mgw: Fix logic in test TC_two_crcx_mdcx_and_rtp_osmux
rtpem should be set to BIDIR at the same time where MDCX "sendrecv" is
sent, otherwise if MGW sends us RTP packets (because we set the conn to
sendrecv) they will be counted incorrectly in
stats[0].num_pkts_rx_err_disabled.

This issue doesn't trigger in current code because the MGW doesn't know
anyway the remote IP address of the other connection until an MDCX is
sent to it. However, if for whatever reason the IP address is known (for
instance because it is set during CRCX, which will be done in next
commits), then RTP messages would be sent and the error counter would
be > 0.

Change-Id: I8f2c4e497e522fc17e5cfe76987f802265c486ab
2020-09-09 12:22:42 +00:00
Pau Espin 89c76d2102 mgw: Fix logic in test TC_two_crcx_mdcx_and_rtp
rtpem should be set to BIDIR at the same time where MDCX "sendrecv" is
sent, otherwise if MGW sends us RTP packets (because we set the conn to
sendrecv) they will be counted incorrectly in
stats[0].num_pkts_rx_err_disabled.

This issue doesn't trigger in current code because the MGW doesn't know
anyway the remote IP address of the other connection until an MDCX is
sent to it. However, if for whatever reason the IP address is known (for
instance because it is set during CRCX, which will be done in next
commits), then RTP messages would be sent and the error counter would
be > 0.

Change-Id: I653eb75439321f9a488dc56dca5d3fc5a8811547
2020-09-09 12:22:42 +00:00
Pau Espin 71387aac71 mgw: Allow setting udp ip/port with wildcard osmux in f_flow_create_osmux()
This will be needed once IPv4+IPv6 support is used, since we want to set
the remote IP addr in CRCX for convinience to get an IP adr from ther
same family during CRCX, while still allowing for testing Osmux CID
wildcard value.

Change-Id: I3abd80b1c0053004aab3d03e09fada1129a59765
2020-09-09 12:22:42 +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
Philipp Maier c60e8477f5 MGCP_Test: fix test expectation in TC_crcx_wildcarded_exhaust
The testcase TC_crcx_wildcarded_exhaust assumes a wrong number of
endpoints. Since osmo-mgw has a wrongly solved off-by-one in its
endpoint allocation it allocates the wrong number of endpoints. This
is now fixed, lets now also fix the test expection.

(The failure of TC_crcx_wildcarded_exhaust also causes
 TC_crcx_dlcx_30ep to fail.)

Depends: Change id I73b31e3c236a61ea0a6f76ef5ff98ce589f52c77
Change-Id: I73344ef8793cc81df0a1815bb8d890e7849cdd20
Related: OS#2659
2020-07-21 09:29:15 +00:00
Philipp Maier 882843dc0f MGCP_Test: fix test vector in TC_amr_oa_bwe_rtp_conversion
The rtp payload test vector in TC_amr_oa_bwe_rtp_conversion is wrong, it
lacks the last byte which should be 0x00. Also the testvector is not
very well chossen since it after BWE conversion the actual payload does
not shrink (even if it looks like if it would because of the 0x00 byte
at the end). Lets pick a better payload from a real world trace that
actually shrinks by one byte when it is converted to BWE and use that
one.

Change-Id: Id4256049bbca49ad5c2eb0579128838ebae062f8
2020-06-02 14:13:57 +02:00
Neels Hofmeyr a4d2100431 update expected results
Change-Id: I37014274ee97f09985c31966e7cc9122fe11a856
2020-05-19 19:25:35 +00:00
Philipp Maier 4c2a1eaea2 MGCP_Test: do not use leading zeros in endpoint identifiers
The endpoint number of a virtual endpoint must not use leading zeros
but, but the testcase MGCP_Test.TC_crcx_dlcx_30ep does. Lets not do this
as it violates the spec. See also: RFC 3435, section E.3.

Change-Id: I99d2fa76cb60d0d671c9413f3dbd711ec68aeb77
Related: OS#2659
2020-05-15 18:42:20 +02: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
Pau Espin d19ba6dbbe mgw: Drop unneeded mp_enable_conn_timeout_test
Latest osmo-mgw release is 1.7.0, so this param is not needed at all.
Furthermore, the config can be moved to .cfg.

Change-Id: I537c0f5fd6f9e18e111c773c0e42e5f1120ce2f4
2020-01-05 11:21:07 +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
Philipp Maier faa1d2fd9a MGCP_Test: test rtp directions separately in TC_ts101318_rfc5993_rtp_conversion
The testcase TC_ts101318_rfc5993_rtp_conversion tests the RTP packet
format conversion of ts101318 to rfc5993 and vice versa. At the moment
the testcase sends RTP packets in both directions at the same time. In
order to simplify the test and to make race conditions less likely, lets
test both directions separately and add some guard time.

Change-Id: Id9b69587f7fb5f6b0da072ac5f4863fd4111e597
2019-10-07 20:02:21 +00:00
Philipp Maier 42b17cc5f2 MGCP_Test: Relax expected number of packets in TC_one_crcx_receive_only_rtp
The testcase TC_one_crcx_receive_only_rtp performs a short RTP
transmission that lasts about 1 second. Then it conuts out the number of
packets that are transmitted and checks against a fixed value. The
compare values are determined using experimentation and reflect the
number of bytes/packets that one could expect under normal conditions on
an average machine.

However, there may be load sitations on the test host that may cause that
a too little number of packets is transmitted and the test will fail. Lets
reduce the number a bit as the only thing we want to make sure with this
is that there are at least some (more than one or two) packets transmitted

Change-Id: Ie63445d61268d178940ce8d9cfa984519c42041a
2019-10-07 20:02:21 +00:00
Philipp Maier 9ff0f8afda MGCP_Test: Make RTP bwe/oa format conversation tests more robust
The following testcases are carried out using two bidirectional
connections on one MGW endpoint.

MGCP_Test.TC_amr_oa_bwe_rtp_conversion
MGCP_Test.TC_amr_oa_oa_rtp_conversion
MGCP_Test.TC_amr_bwe_bwe_rtp_conversion

The test is programmed in a way that the TTCN3 side of the RTP emulation
also works in bidirectional mode. This is prone to run into a race
condition when the RX side is activated but the TX side is already
transmitting.

However, in order to test if the RTP format conversion works we do not
need to test both directions at the same time. Its perfectly fine to do
the one direction first and then do the other afterwards. Lets also add
some guard time while switching the RTP flows.

Change-Id: Idf257cfc1ab45a7f0fb6e1a2f6426f1b3145879b
2019-10-07 20:02:21 +00:00
Oliver Smith 280536b782 mgw: add module param mp_enable_conn_timeout_test
Fix ttcn3-mgw-latest by not running "conn-timeout 0" during f_init_vty
at the start of every test case. The latest osmo-mgw release does not
have that command yet.

Change-Id: I8bbf15baa45679d5812a5a9184520ef9b9e73bba
2019-06-28 11:04:48 +02:00
Oliver Smith 021141e6dc mgw: add connection timeout test
Change-Id: I020b682b347045818fd28de240daa0aa33fe43b4
2019-06-26 16:16:20 +02:00
Oliver Smith 350eb681e2 mgw: add osmo-mgw.cfg
Change-Id: I3dd498902db4ea0233f43099ec5b6b4292714908
2019-06-25 13:45:25 +02: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
Pau Espin b2c6b38f3f Add Osmux support and tests for MGW
Depends: osmo-mgw.git Iac073f1db46569b46eddeaecc9934a2986bd50f1
Change-Id: Ibb58b2a4e08d6f30cfe347c217794d0d1310954f
2019-05-27 09:56:51 +00:00
Daniel Willmann 94e4e80ec0 mgw: Ensure TC_selftest passed if no error is encountered
Change-Id: Ie1601d57ac5bf9ddf99cbbd1cdb91160dc47c84d
2019-03-28 13:08:10 +01:00
Philipp Maier 4f764ce4f3 MGCP_Test: Test AMR octet-aligned/bandwith-efficient mode conversion
osmo-mgw now implements a conversion between the AMR octet-aligned
and banwith-efficient payload format. Lets add tests for this

Change-Id: I050bfeabfb5fdbf986d429eef3af69fe8158d56e
depends: osmo-mgw I622c01874b25f5049d4f59eb8157e0ea3cbe16ba
related: SYS#4470
2019-03-19 13:29:31 +00:00
Philipp Maier c8c0b40e1b MGCP_Test: allow setting of fmtp parameters
When creating an RTP flow, there is currently no way to set SDP fmtp
parameters. Lets add a template and a parameter in order to be able to
set those parameters.

Change-Id: Ic1840d5023cb3888a17980f4ed08c19175864896
Related: SYS#4470
2019-03-19 13:29:31 +00:00
Philipp Maier 6d4e094341 MGCP_Test: Add testcase to test ts101318/rfc5993 conversion
The MGW recentenly adds support to convert between ts101318 and rfc5993
when GSM-HR is used. Lets add a testcase for that.

depends: osmo-mgw Iceef19e5619f8c92dfa7c8cdecb2e9b15f0a11a1
Change-Id: I96df45fe45b53088e07b26f14173a75498a84143
Related: OS#3807
2019-02-26 09:10:41 +00:00
Philipp Maier 6137c32e05 MGCP_Test: Add VTY access
The MGCP_Test testsuite currenty lacks VTY access capabilities, lets
add them so that future testcases can access the VTY in order to change
options on the fly.

Depends: osmo-ttcn3-hacks Ife949c61156222de3026280071226ef6f5dbd959
Change-Id: If383f81af3306f8f5bdf50152498ae1303d390df
Related: OS#3807
2019-02-20 17:00:33 +01:00
Daniel Willmann a069d38b61 mgw: Tear down all RTP flows to avoid race condition on tear down
When stopping the test TC_two_crcx_and_unsolicited_rtp the unsolicited
RTP stream is not stopped. As a result it could happen that between
tearing down the other flows and stopping the test an unsolicited RTP
packet is sent to a closed socket.
The resulting ICMP destination unreachable packet translates to a
"Connection refused" error on the sending socket and fails the test.

Avoid this by making sure the unsolicited RTP sender is stopped before
stopping the test.

Change-Id: Ied839596589609e75fa487046a85db48991e4c73
2018-12-23 10:14:14 +00: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
Neels Hofmeyr 873ae201bd update expected results
Change-Id: I32c29e62ca317937db771f8fb1540bb1fe9da2ab
2018-09-06 14:13:34 +02:00
Daniel Willmann 43a1a0be9e mgw: Don't try to send packets while MDCX is underway
TC_two_crcx_and_one_mdcx_rtp_ho sometimes failed while trying to send an
RTP packet without a connected port. f_flow_modify re-bind()s the port,
sends the MDCX and then connect()s it after the MDCX ACK returned the
IP/port combination.
If the transmit timer fires off between the bind and connect the
resulting send call will fail.

Change-Id: Idf93ceb830a44dafa56430ab5178f05da6bdd6fb
2018-08-01 17:55:54 +02:00
Philipp Maier 7df85f63bf MGCP_Test: Test what happens when two ends use different PT
It is legal that two connections use the same codec but negotiate
different dynamic payload types for both connections. Then the MGW is
expected to receive packets with one PT and send them with the other PT.
This is currently not done in osmo-mgw so the two tests that this commit
adds are expected to fail for now.

- add testcase TC_two_crcx_diff_pt_and_rtp
- add testcase TC_two_crcx_diff_pt_and_rtp_bidir

Change-Id: Ib4606dfc08764410ee9e450949361544adb07cd3
Related: OS#3384
2018-07-25 18:51:06 +00:00