aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2019-12-12osmoappdesc.py, tests: switch to python 3Oliver Smith1-16/+16
Make build and external tests work with python3, so we can drop the python2 dependency. This should be merged shortly after osmo-python-tests was migrated to python3, and the jenkins build slaves were (automatically) updated to have the new osmo-python-tests installed. Related: OS#2819 Depends: osmo-python-tests I3ffc3519bf6c22536a49dad7a966188ddad351a7 Change-Id: I344c49001fba23bdcfdef06ab174c52b60edd01c
2019-12-01check for osmo_fsm_register() failures and propagate errorHarald Welte2-2/+2
Change-Id: Id8861144e4880383a173b7e6ae7860beebac09d9
2019-11-14osmo_ss7_vty.c: implement 'active' filter for show_cs7_as_cmdVadim Yanitskiy1-1/+0
Change-Id: I356d90642a500be6a70f60c8240ce1211fd0d934
2019-11-12xua: Avoid multiline log in xua_msg_dump()Pau Espin Pedrol1-50/+11
In general we want to avoid multiline log messages since they make parsing more difficult. Also output in VTY over telnet looks strange (indentation incremented at each new line). Change-Id: Id9084d0e0f976bb374186db93d6ff8062b99e238
2019-11-07tests/sccp/Makefile.am: use sccp.o from $(top_builddir)Vadim Yanitskiy1-2/+5
This change suspends the warnings about option 'subdir-objects', by using the existing object file from the build directory. Change-Id: I4dc2abb19c58fce0a12cc9799019878194c667d1
2019-11-05vty: Permit configuration of ASPs in SCTP client modeHarald Welte1-0/+2
The M3UA specification states that either of the two roles should be the SCTP client and the other the server. It also states that the default for the SGP is to operate as server. However, it permits other configurations. Let's allow this to be configured by the VTY. We need to ensure that while in ASP role, we don't send any NOTIFY messages to the peer SG. Change-Id: I7452a862d45da35dcd58654ca17222eb52d26f1f Closes: OS#2005
2019-11-05Allow ASP role to be configuredHarald Welte1-0/+2
So far, we had a static role model: * SCTP servers (listening, such as OsmoSTP) are role SGW * SCTP clients (connecting, such as OsmoMSC) are role ASP While this is customary, it is not actually required by the specification. The SGW can establish the SCTP connection to an ASP but still remain "SG" role. Let's make things more flexible by having the role configurable. Related: OS#2005 Change-Id: I2df9cd9747ad5c9a05d567d9a71bab6184c53674
2019-10-24ss7: Set default traffic-mode to overridePau Espin Pedrol1-5/+5
Change-Id: I8570ed6634eb20c0f9e4b712de6592b6c3b77227
2019-10-23vty: Print traffic mode during show cs7 instance asPau Espin Pedrol1-23/+23
Change-Id: Ief6b03f50751b8d8f4021e94d54f079681b64d51
2019-10-22tests: Introduce test for multi-homing STP featuresPau Espin Pedrol2-2/+186
Config file sets omo-stp instance to bind on 2 IP addresses, and then the test verfies through linux /proc/net/sctp/* that binding is done correctly and that it can be reached from another remote address to one of the configured addresses. Change-Id: Ifa11b1fc882dff415405f62024e94bed67228866
2019-10-22ss7: Support multiple addresses in SCTP connectionsPau Espin Pedrol1-14/+14
After this patch, Several "local-ip" and "remote-ip" lines are accepted under "listen" and "asp" VTY nodes, allowing to configure an SCTP connection with multiple connections, hence allowing control of SCTP multi-homing features. libosmo-sccp clients such as osmo-bsc and osmo-msc also gain support for this feature with this commit. Related: OS#3608 Depends: libosmocore.git Ic8681d9e093216c99c6bca4be81c31ef83688ed1 Depends: libosmo-netif.git I0fe62f518e195db4e34f3b0ad1762bb57ba9d92a Change-Id: Ibd15de7a4e00dbec78ff2e2dd6a686b0f3af22de
2019-10-19ipa: VTY config option to explicitly enable/disable SCCP patchingHarald Welte1-0/+1
When receiving SCCP messages from an IPA peer/ASP, osmo-stp so far unconditionally inserted origin/destination point codes int the SCCP called / calling party addresses. This behaviro is now made optional with the introduction of the following per-AS configuration: "point-code override patch-sccp (disabled|both)" The default behavior is switched from 'both' to 'disabled' at the same time. Change-Id: I535e2170adadfe755d2bcbf5bbf4556bebb77737 Closes: OS#4219
2019-08-05Remove undefined param passed to {logging,osmo_stats}_vty_add_cmdsPau Espin Pedrol1-1/+1
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However, definition in C file doesn't contain "(void)", which means number of parameters is undefined and thus compiler doesn't complain. Let's remove parameters from all callers before enforcing "(void)" on it. Related: OS#4138 Change-Id: Iedd11f816002b686f0ddb54c0cf7ba4e229e21e3
2019-05-01xudt: Implement address and data extractionHolger Hans Peter Freyther1-0/+38
The cellmgr-ng unfortunately looks at the data being sent and can't handle the presence of XUDT at all. Add the structure definition and refactor extraction code to work on offsets. Add a unit test. Change-Id: I45a7447cc1be432fff34849e0e35abc0410cf153
2019-04-12add osmo_sccp_addr_cmp(), osmo_sccp_addr_ri_cmp()Neels Hofmeyr2-0/+271
osmo-msc identifies its BSC and RNC peers by SCCP address, and compares those by memcmp(), which is not really accurate. Rather provide a meaningful osmo_sccp_addr_cmp() API to determine whether SCCP addresses are identical. Go for a full cmp that would also allow sorting. Change-Id: Ie9e2add7bbfae651c04e230d62e37cebeb91b0f5
2019-03-15Fix output of route destination in 'show ss7 instance <0-15> route'Harald Welte2-0/+9
We were printing the mask of the route, but not the point code itself. Best would probably be to print both? Closes: OS#3835 Change-Id: Ifa4fdbad953d40f222beb470a082eed8c20991ef
2018-10-21build: move include/{mtp,sccp} to include/osmocom/Neels Hofmeyr2-2/+2
Anywhere else in the Osmocom code base, we arrange headers in include/osmocom/foo/ and pass -I ${root_srcdir}/include/. This way including an osmocom header always has the format #include <osmocom/foo/bar.h> whether we are including from the local source tree or from $prefix. For some reason not clear to me, the mtp and sccp folders, even though they are being installed to $prefix/include/osmocom/, were kept *next* to the osmocom/ dir, instead of inside it. Fix that weird situation. The motivation is that I wanted to use a definition from sccp_types.h in a public-API header. That is impossible if it requires #include <sccp/sccp_types.h> in a local build, but #include <osmocom/sccp/sccp_types.h> for any other source tree using libosmo-sccp. After this patch, both are identical and including works without quirks. (The other patch that needed this has changed in the meantime on and no longer needs this, but this still makes sense for future hacking.) The installed result does not change, since both mtp/*.h and sccp/*.h have always been installed to $prefix/include/osmocom/{mtp,sccp}/. This merely changes their position in the source tree. The most curious situation before this is that any patch #including <osmocom/sccp/sccp_types.h> might not get a notice that the header didn't exist, but might instead include an older system-installed file. Change-Id: I1209a4ecf9f692a8030b5c93cd281fc9dd58d105
2018-09-27make SCCP timers configurableNeels Hofmeyr1-0/+59
The previous hardcoded SCCP timers may cause SCCP connection releases, if the peer is configured with far lower timers than libosmo-sccp. Testing with a specific SCCPlite MSC, I experienced an iar of just over three minutes, meaning that calls would be cut off by the MSC, since the osmo-bsc failed to send an Inactivity Timer message until seven minutes have passed. With this patch, SCCP timers are configurable by the user. Define constant global default timers, and variable user-configurable timers with each osmo_sccp_instance. Add VTY UI to configure the timers. Users must call osmo_sccp_vty_init() to get the sccp-timer config nodes under the 'cs7' node. Show the new UI in ss7_asp_test.vty. Note that even though this function is not new at all, until recently, all of our SCCP users (osmo-bsc, osmo-msc, osmo-sgsn, osmo-hnbgw) failed to call osmo_sccp_vty_init(), and thus also missed out on the various 'show' commands defined in sccp_vty.c. In other words, to benefit from the timer configurability, the patches to call osmo_sccp_vty_init() must first be merged to the corresponding master branches. If a 'sccp-timer' config command occurs, the cs7 instance must allocate an SCCP instance in order to store the timer config. Do that by calling the recently added osmo_ss7_ensure_sccp() function. Hence remove the limitation that the SCCP instance must not be populated from the "simple" setup function. If we want to configure SCCP timers beforehand, there must be an SCCP instance for that, and there is no hard reason to require a NULL SCCP instance, besides the desire to prevent this function from being invoked twice. Change-Id: I28a7362aa838e648ecc9b26ee53dbcade81a9d65
2018-09-27sccp_vty: fix doc strings for show ... ssn,connectionsNeels Hofmeyr1-3/+3
For 'show cs7 instance 0 ssn', fix doc string for 'ssn', and add missing one for the SSN arg. This fixes depending builds that see VTY test failures due to the missing doc string. For 'show cs7 instance 0 connectsion', fix doc string for 'connections'. Change-Id: I214ea51fc6bfa2a9a4dd7c34b43add0c77ffe22e
2018-09-27vty: install 'show cs7' for sccp addrs on _ve nodesNeels Hofmeyr1-2/+8
The 'show cs7 instance 0 sccp-addressbook' command should not be inside the 'cs7' node. That defies the point of naming the instance again, and it falls out of place of all the other 'show cs7' commands on the VIEW and ENABLE nodes. Drop the old command within the 'cs7' node without substitution or deprecation. At the same time, drop dash from 'show cs7 i 0 sccp-addressbook' There are various other show cs7 commands already defined in sccp_vty.c, which have 'sccp' as a separate string. Conform to that. Change-Id: I80e0bc0a91bcd3fb75372045db34592d2d663d41
2018-09-27vty: tweak two printed stringsNeels Hofmeyr1-2/+2
Fix typo "to long". Say 'cs7 instance' instead of 'ss7 instance': we are interacting with a user on the telnet VTY, and that user is configuring a 'cs7 instance'. Especially a lowercase 'ss7' is potentially confusing ("is there an 'ss7' node?"). Changes show in ss7_asp_test.vty. Change-Id: Iebb976531576268d58338895a4baadbca6137b80
2018-09-27sccp_vty: define SCCP_STR onceNeels Hofmeyr1-1/+1
Define SCCP_STR in sccp_internal.h, because I know that I want to also use it in osmo_ss7_vty.c. Fix "Signaling" to "Signalling" upon copying the old string. Change-Id: Ic93e4771147070a9222c73f80b5f7c29ae7eec35
2018-09-27add tests/vty: VTY UI transcript testingNeels Hofmeyr4-1/+602
Add ss7_asp_vty_test, a shim test program with the sole purpose of exposing the cs7 VTY nodes. Add ss7_asp_test.vty, transcript for verifying VTY nodes using above program. Add --enable-external-tests to configure. Run jenkins.sh with --enable-external-tests. Change-Id: I6a28684fa24d6e7de568623444297028eba2ab8c
2018-05-16tests: xua_test: Fix array len computationPau Espin Pedrol1-10/+10
As warned by gcc 8.1.0: In file included from libosmo-sccp/include/osmocom/sigtran/osmo_ss7.h:7, from libosmo-sccp/include/../src/xua_internal.h:3, from libosmo-sccp/tests/xua/xua_test.c:21: /include/osmocom/core/utils.h:13:34: error: division ‘sizeof (const uint8_t (*)[12] {aka const unsigned char (*)[12]}) / sizeof (const uint8_t[12] {aka const unsigned char[12]})’ does not compute the number of array elements [-Werror=sizeof-pointer-div] #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) ^ libosmo-sccp/tests/xua/xua_test.c:371:45: note: in expansion of macro ‘ARRAY_SIZE’ #define PARTARR(x, data) { .tag = x, .len = ARRAY_SIZE(data), .dat = (uint8_t *) data } Change-Id: Iad5703d68fee26fc83958741512820d2539e604e
2018-05-16tests: xua_test: Fix use of wrong buffer for dest addrPau Espin Pedrol1-1/+1
All the others parts use that buffer as its name indicates. Change-Id: Ide7fe148cc762153330b08f66737816ceed96cb2
2018-04-17use osmo_init_logging2Pau Espin Pedrol1-2/+3
Change-Id: I0d45b9381125c496a691ac5da68190b7b3479fc3
2017-12-24osmo_sccp_addr_name / _dump: drop 'NO_GT' outputNeels Hofmeyr1-8/+8
Do not print the GTI if gti is set to OSMO_SCCP_GTI_NO_GT and no GT is present in the address. If addr->gt.gti is set to OSMO_SCCP_GTI_NO_GT, i.e. currently always, osmo_sccp_addr_name() and osmo_sccp_addr_dump() output ",GTI=NO_GT" in every address dump, which is useless clutter. Drop that. However, if a Global Title is flagged in addr->presence, still output the GTI to highlight situations where GTI might mismatch the presence of a GT. Change-Id: I9f87b2b703223ecb5d0442b6199c5b779fe544a1
2017-11-18xua_test: sanitize: fix msgb leakNeels Hofmeyr1-0/+3
Change-Id: Ie57e803bb6361f39042084a21cada754a6506606
2017-11-18sccp_test: sanitize: don't memcmp NULL pointersNeels Hofmeyr1-4/+6
Change-Id: I0159a875c1e11f4f9728d9e09f5c365b8174673a
2017-11-18sccp_test: sanitize: fix msgb mem leaksNeels Hofmeyr1-0/+4
Change-Id: I6d5ff3e4c053db5a2af9d548250f0307e00317bb
2017-11-12initialize msg->l2h in sccp_msgb_alloc()Harald Welte1-11/+11
Change-Id: I5fb11075593696b110bfd3e0541e3aa790029903
2017-10-27implement unit tests for osmo_sccp_addr_{parse,encode}()Harald Welte5-2/+259
The recent bug with chopped-off point codes in SCCP Address handling has shown that this code could need proper test cases. This patch adds a testsuite for SCCP address encoding and decoding. Related: OS#2441 Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86
2017-08-09fix osmo_sccp_addr_dump(): actually print RINeels Hofmeyr1-6/+6
Adjust xua_test accordingly. Change-Id: I93e0aa706867e7b1de7f7a6071e3c8af89772af0
2017-06-29fix compiler warning: xua_test: hexdump pointer typeNeels Hofmeyr1-2/+2
Was recently introduced by a70b4599f63b50c4d654eb9e1b1a099a7c8cdc36. Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851
2017-06-23fix sanitize make check: xua_test: initialize gt_out.Neels Hofmeyr2-1/+5
The sanitize build fails because gt_out is not initialized to zero, but is later mem-compared to a zero-initialized struct. Zero-initialize gt_out. Also print in the test output both byte dumps. It helped to figure out the test failure and might as well stay. Change-Id: Ice8ee9c2a6bde4924f3ae6d95aa9268ebef9f070
2017-06-22xua_test.c: remove useless keyword in struct declarationPau Espin Pedrol1-1/+1
Fixes following warning: warning: useless storage class specifier in empty declaratio Change-Id: I5cea7b6ec2cc755ad8cec69b771f6e3b297e607d
2017-04-27ss7_test: Fix '=' that should have been '=='Harald Welte1-1/+1
Change-Id: I1be4529c73992cb342a62aa19ba79be25e982620 Fixes: coverity CID#166944
2017-04-27ss7_test: Avoid possible NULL pointer dereference in test caseHarald Welte1-0/+1
Change-Id: If2a7b2c988d06e8bbd2a63f3a5ceeb403bfb34ed Fixes: coverity CID#166992
2017-04-14SCCP: Add VTY interface for SCCPHarald Welte2-4/+4
Change-Id: I100daaa947dbab6a4528c4e9fbd0d30790288f63
2017-04-10xua_msg: Add xua_from_nested() helper function for nested IEsHarald Welte2-0/+34
... and add a test case to ensure it continues to work. Change-Id: Iee434886598b528d23ddce0490dcc782e0f5d6ae
2017-04-10remove tests/sigtran: it's not a test caseHarald Welte6-265/+1
in tests/* we have unit tests that are run as part of the autotest suite during 'make check'. The code in tests/sigtran is an example, but not a test. As the API is changing anyway, let's remove it for now and re-introduce actual tests and examples after the changes in API required by the upcoming new SCCP core. Change-Id: Ie471a197856c875eb4987bf9858d757312de24fb
2017-04-10Add tests for xUA code + SCCP/SUA transcodingHarald Welte7-1/+653
Change-Id: I7ce038d72dca18fb83d5a12519c9a48267e52ab8
2017-04-10Add new 'osmo_ss7' SS7 core code with M3UA, ASP/AS FSM, ...Harald Welte6-1/+416
This is what aims to be a rather complete/proper implementation of the SIGTRAN + SS7 protocol suite. It has proper abstraction between the layers with primitives, finite state machines for things like the AS and ASP state machines, support for point code routing, etc. What's not implemented at this point: * re-integration of pre-existing SUA (pending) * actual MTP2 and physical E1/T1 link support * different trafic modes like broadcast/fail-over/load-balance Change-Id: I375eb80f01acc013094851d91d1d3333ebc12bc7
2017-01-27allow user to give private data to osmo_sua_user_create()Harald Welte2-2/+2
... which can be resolved from the primitive call back prim_cb() by calling osmo_sccp_link_get_user_priv(). Change-Id: If4c0f96f0621fb2adf4c78dc5994d3398431d92f
2016-11-11mtp_parse_test: Comment out unused but defined packetsHarald Welte1-7/+9
Change-Id: I837eee6cc6e2bdea65988b19d9e15601eda44589
2016-07-06cosmetic: rename osmo_sua_link and osmo_sua_user to osmo_sccp_*Neels Hofmeyr4-7/+7
hwelte requested this change for the addition of libiu in openbsc. In a conversation we came to the conclusion that a rename of these two opaque structs would suffice. This is the "upstream" rename and will require adaptation of: * the sysmocom/iu branch in this repository * the iu related branches in openbsc.git * the hnbgw and dummy_cn code in osmo-iuh.git See https://gerrit.osmocom.org/#/c/192/2/openbsc/src/libiu/iu.c@57 Change-Id: Icbf64dd96f8e0e27695df73d1144519b88360b94
2016-04-16sua_test_common.c: use global RANAP SSN definitionNeels Hofmeyr1-4/+2
The test 'hardcoded' a local define for RANAP SSN as 142, instead use the proper OSMO_SCCP_SSN_RANAP define from sccp_sap.h
2016-01-06fix format string compiler warnings (%zu for size_t)Harald Welte1-2/+2
2015-12-26sua: Attempt to fix make distcheckHolger Hans Peter Freyther1-0/+1
2015-12-23fix some recently-introduced compiler warningsHarald Welte2-1/+2