aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2018-04-17use osmo_init_logging2Pau Espin Pedrol4-7/+9
Change-Id: Iab9d111aba8f9b423e6a541e928f68b38d561067
2017-11-13Add SPDX-License-Identifier to all source filesHarald Welte1-1/+3
Change-Id: I9f2bc8c5d8a2c0bb0dd6caa4de5e2cb11be210e7
2014-08-29test: Fix the compilation of the testHolger Hans Peter Freyther1-1/+1
This test didn't compile as it called the wrong method. It is a manual test anyway and tend to bitrot. I didn't execute the resulting test binary. Hmm, now I did and it segfaults on something that appears to have been introduced a long time ago. Manual tests are as good as no tests (besides they take more time than writing no test). ;)
2014-08-28Support for multiple RSL connections with ABIS/ipaccess (BTS side)Andreas Eversberg1-1/+1
In order to support multiple TRX, multiple RSL connections can be establised. e1inp_ipa_bts_rsl_connect() requires an additional parameter to set the TRX number. The ts[] array (member of struct e1inp_line) refers to OML and RSL. ts[0] refers to OML link, ts[1] to RSL link of first TRX, ts[2] to RSL link of second TRX (if exists) and so on. The code was successfully tested with osmobts-trx and UmTRX with two transceivers. The user of e1inp_ipa_bts_rsl_connect() (which is osmo-bts) can use the new function like this (backwards compatibility function provided): src/common/oml.c - rc = e1inp_ipa_bts_rsl_connect(oml_link->ts->line, inet_ntoa(in), port); + rc = e1inp_ipa_bts_rsl_connect_n(oml_link->ts->line, inet_ntoa(in), port, + trx->nr);
2014-08-20move various generic IPA related functions to libosmocoreHarald Welte1-0/+1
libosmo-abis is about forming A-bis interfaces/lines by means of E1 or the IPA multiplex (or possibly other link layers). The IPA multiplex is used in other contexts, such as the Control interface, or the A interface. In that context, it makes sense to have generic IPA related functions in libosmocore.
2014-03-31ipa: Change ipa_msg_recv() to support partial receiveJacob Erlbeck2-18/+64
Currently ipa_msg_recv() fails, when messages are received partially. This patch provides a new function ipa_msg_recv_buffered() that uses an additional ** to a message buffer to store partial data. When this happens, -EAGAIN is returned. If NULL is used, the function behaves similar to ipa_msg_recv() and fails on partial read. In addition in case of errors the return value is now always -EXXX and the contents of errno is undefined. Note that this feature needs support by the calling code insofar that *tmp_msg must be set to NULL initially and it must be freed and set to NULL manually when the socket is closed. Note also that ipa_msg_recv() is then a wrapper around ipa_msg_recv_buffered() which mimics the old error behaviour by setting errno explicitely to -rc and returning -1 when an error has happened. Ticket: OW#728 Sponsored-by: On-Waves ehf
2014-03-24ipa/test: Add test program for IPA message receptionJacob Erlbeck4-2/+254
This patch adds tests for ipa_msg_recv(), where messages are sent either complete or partitioned. Sponsored-by: On-Waves ehf
2013-11-11ipa-proxy/vty: Removed enable/ipa nodeJacob Erlbeck1-22/+0
This was basically a link to configure/ipa which is not cleanly supported by the current VTY framework. The test program uses the default implementation for go_parent_cb/vty_go_parent() and is_config_node, since config-ipa is a top level config node which is assumed by default.
2013-10-06Don't establish RSL at same time as OML link on IPA type linesHarald Welte1-0/+1
If we have a BTS-side e1inp_line, we can only establish OML at the time of line_update. We have to wait with RSL until the BTS explicitly tells us the RSL destination IP and port (received via OML from BSC). This is now handled in a new function called e1inp_ipa_bts_rsl_connect().
2013-07-04hsl: Remove the input handling for the HSL BTSHolger Hans Peter Freyther3-524/+0
I have removed HSL support from OpenBSC, the E1/Abis code is now unused and can be removed. Fixes: Coverity CID 1040693
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2012-12-26tests: Don't delete atconfig in cleanDaniel Willmann1-1/+2
This file is created in ./configure so we shouldn't remove it with make. Otherwise ./configure && make clean && make check fails with: make[3]: *** No rule to make target `atconfig', needed by `check-local'. Stop.
2012-10-12Test parsing of GSM 08.60 frame sync headerTobias Engel2-0/+190
Tests if the frame synchronization header is correctly recognized. The problem tested for is the following: The sync header consists of 16 zero-bits followed by 1 one-bit. Before, subchan_demux only tested for the 16 zero-bits. But if the previous frame ended in one or more zero-bits these were then already counted as belonging to the sync header, leading to a frame that was shifted by one or more bits.
2012-10-12tests: Add a test stub for the subchan_demux testsHolger Hans Peter Freyther4-2/+74
Tobias has worked on CSD support and Dieter has helped with a CSD trau fix. This is a stub that should allow to easily write a test case for the syncing issue observed by Tobias. Run the tests: $ make check In case of failure: $ vi tests/testsuite.dir/1/testsuite.log Add the actual content: $ edit tests/subchan_demux/subchan_demux_test.c Update the test result: $ ./tests/subchan_demux/subchan_demux_test > tests/subchan_demux/subchan_demux_test.ok
2012-10-11tests: Add boilerplate to be able to have tests in libosmo-abisHolger Hans Peter Freyther2-0/+54
2012-08-30tests: e1inp_ipa_*_test: fix leak of msgb in ->sign_link pathPablo Neira Ayuso2-0/+2
Fix a leak in the tests: The ->sign_link callback is reponsible for releasing the msgb.
2012-08-30tests: e1inp_ipa_*_test: add signal handling for process terminationPablo Neira Ayuso2-3/+30
This patch adds signal handling to release memory in the exit path of the tests. This is good to check what memory we are leaking in the exist path of the tests.
2012-08-30tests: fix CPU suckup e1inp_ipa_bts_test after test finishPablo Neira Ayuso1-1/+6
We have to read from the eventfd, otherwise select keeps returning the file descriptor as ready to read.
2012-08-30tests: e1inp_ipa_bts_test: fix compilation warningsPablo Neira Ayuso1-3/+4
CC e1inp_ipa_bts_test.o e1inp_ipa_bts_test.c: In function ‘sign_link_up’: e1inp_ipa_bts_test.c:47:8: warning: variable ‘dst’ set but not used [-Wunused-but-set-variable] e1inp_ipa_bts_test.c: In function ‘test_bts_gsm_12_21_cb’: e1inp_ipa_bts_test.c:211:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] CCLD e1inp_ipa_bts_test
2012-08-30tests: e1inp_ipa_bsc_test: fix crashPablo Neira Ayuso1-2/+6
The sequence to trigger the crash was: 1) establish a full A-bis IPA link (both OML and RSL correctly established and ID_RESP received from BTS). 2) nc 127.0.0.1 3002 # establish OML link only I forgot to set to NULL the oml and rsl links we're using. Otherwise, the test calls e1inp_sign_link_destroy(rsl) which does not exists.
2012-07-01build: only build tests during make checkDiego Elio Pettenò1-1/+1
Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2011-10-16misc: Linker fix for Ubuntu 11.10Holger Hans Peter Freyther1-1/+2
--as-needed was default in Natty and somehow got more strict in this version of Ubuntu. Link to osmo vty.
2011-09-09tests: remove reference to internal headers in ipa_proxy_testPablo Neira Ayuso1-3/+1
This example has to compile out of the tree, including internal.h is not required and using PACKAGE_VERSION here, which is internal to the library, does not seem to me like a good idea.
2011-08-19e1_input: rework configuration of virtual E1 line operationsPablo Neira Ayuso4-10/+26
struct e1inp_line_ops { - enum e1inp_line_role role; - char *addr; - void *data; + union { + struct { + enum e1inp_line_role role; /* BSC or BTS mode. */ + const char *addr; /* IP address .*/ + void *dev; /* device parameters. */ + } ipa; + struct { + const char *port; /* e.g. /dev/ttyUSB0 */ + unsigned int delay; + } rs232; + } cfg; Now this structure contains the configuration details for the virtual E1 line, instead of using a pointer. This also get the line_update callback to its original layout: + int (*line_update)(struct e1inp_line *line);
2011-08-17test: use site_id 1801 in ipa BTS examplePablo Neira Ayuso1-1/+1
Thus we can use it with the example file for openBSC under doc/examples/nanobts/openbsc.cfg.
2011-07-19update to comply with libosmocore namespace fixesHarald Welte1-3/+3
This updates the code and brings it in sync to libosmocore git commit 892e621fec571c7cba3573caa0d328ed1b25d8ee
2011-07-18talloc: revert to use talloc inside libosmocoreHarald Welte5-5/+5
It's not a good idea to confuse the two changes with each other. Moving the Abis part into a separate library is independent from the question whether we have talloc inside libosmocore or use a stand-alone talloc library.
2011-07-08tests: add missing hsl examplesPablo Neira Ayuso2-0/+506
Hm, it seems I forgot to git add them :-(.
2011-07-08tests: convert IPA BTS example to use event-oriented approachPablo Neira Ayuso1-21/+53
Like the HSL BTS example. We use an event file descriptor which is used to call the GSM 12.21 based function for handling.
2011-07-08hsl: BTS supportPablo Neira Ayuso1-0/+10
This patch adds the BTS support for the hsl driver. It includes two examples under the tests/ directory.
2011-07-08tests: close OML and RSL if set for the BSC examplePablo Neira Ayuso1-2/+4
We only close the OML and RSL links if they are indeed up.
2011-07-08tests: example BTS now sends an OML SW ACT REQPablo Neira Ayuso1-2/+130
This allows to test that the write path works and it allows you to get an idea on how to implement the BTS side by means of libosmo-abis.
2011-07-08tests: use the virtual E1 line used by OML for RSL linkPablo Neira Ayuso1-3/+13
The ipaccess driver is tricky. Since it uses two ports for OML and RSL links, the link for RSL needs to be done in the same line that the OML link. Now the BSC examples uses the virtual E1 line where the OML link is for the RSL one. This patch also verifies that the OML link is up before the someone tries to get the RSL link up.
2011-07-05tests: support OML software activate request ack messagePablo Neira Ayuso1-2/+118
This patch steals some code from openBSC to implement the OML software activate request ack message which is delivered to the BTS. This allows to test the ->sign_link(...) path.
2011-07-05logging: use new harald's logging infrastructure in libosmocorePablo Neira Ayuso3-3/+3
I can send patches to improve it later, better not to waste much time at it by now so port libosmo-abis upon it.
2011-07-05e1_input: change prototype of ->sign_link(...)Pablo Neira Ayuso2-2/+2
This patch removes the struct e1inp_sign_link parameter since this is already available in the msgb->dst field of the message.
2011-07-02tests: use logging infrastructure to display messagesPablo Neira Ayuso2-23/+35
instead of using printf
2011-07-02ipaccess: put the ID_GET logic for the BTS mode into the driverPablo Neira Ayuso1-136/+13
This patch moves the ID_GET logic from the example file to the ipaccess driver in BTS mode.
2011-06-30major updates in e1_input callback ops and IPA infrastructuresPablo Neira Ayuso2-45/+218
This patch is a major update of the callback infrastructure, now the e1input_ops looks like the following: struct e1inp_sign_link * (*sign_link_up)(void *unit_info, struct e1inp_line *line, enum e1inp_sign_type type); void (*sign_link_down)(struct e1inp_line *line); int (*sign_link)(struct msgb *msg, struct e1inp_sign_link *link); The sign_link_up and sign_link_down will be used by the A-bis over IP input drivers. The sign_link_up callback is used if we receive a ID_RESP message, in that case, we have to set up the sign link for the corresponding new OML/RSL signal link. The pointer to unit_info provides a data structure that contains the BTS device details if we run as BSC, and the requested device information from the BSC if we run as BTS. The sign_link_up callback must return the new sign_link created. The sign_link_down callback is invoked if the line does down, which means that the counterpart has closed the socket. The sign_link callback is used to handle all RSL/OML messages. I have also added the following callback to the e1inp_driver: + void (*close)(struct e1inp_ts *ts); Which is invoked if you call e1inp_sign_link_destroy(). This callback is used to close the socket that is linked to that timeslot. This is useful for A-bis over IP drivers since sockets are closed if the OML/RSL signalling link is destroyed. As you can notice, I have also added all the ID_RESP parsing into libosmo-abis for both ipaccess and hsl drivers. This patch also contains a rework of the ipa_client_link whose integration with the e1_input infrastructure was broken (the transmission path was broken). This patch also contains more develop examples that act as BSC and BTS for the ipaccess driver. Sorry, I know it would be better to split all these changes into logical pieces but many of them are tightly related. This is under heavy development stage, it's anyway hard to track changes until this becomes more stable.
2011-06-25e1_input: minor API changes to adapt it to openbscPablo Neira Ayuso2-10/+23
While working on the openbsc over libosmo-abis port, I noticed several API changes that we need to perform for better adaptation.
2011-06-23ipa-proxy: add A-bis over IP generic proxy commands for VTYPablo Neira Ayuso2-1/+86
This patch adds VTY commands to route IPA flows. The following example allows to add a new route: $ tests/./ipa_proxy_test & <0000> ipa_proxy_test.c:74 entering main loop $ telnet localhost 4260 ipa-proxy-test> enable ipa-proxy-test# ipa instance input-oml bind 127.0.0.1 tcp port 8888 ipa-proxy-test# ipa instance output-oml connect 127.0.0.1 tcp port 3002 ipa-proxy-test# ipa route instance input-oml streamid 0xfe instance output-oml streamid 0xfe ipa-proxy-test# ipa instance input-rsl bind 127.0.0.1 tcp port 8889 ipa-proxy-test# ipa instance output-rsl connect 127.0.0.1 tcp port 3003 ipa-proxy-test# ipa route instance input-rsl streamid 0xfe instance output-rsl streamid 0xfe I'm using this to initially test this code [*]. [*] note that this requires a minor hackish patch for the src/input/ipaccess.c driver which changes the default OML and RSL ports to listen in 8888 and 8889 instead of the default ports, thus, I can initially test everything from the localhost.
2011-06-21e1input: add address as parameter to e1inp_line_update(...)Pablo Neira Ayuso2-2/+2
This patch adds a new parameter to e1inp_line_update that allows to specific the address for A-bis over IP BSC/BTS.
2011-06-14input: ipaccess: add preliminary BTS-side for A-bis over IPPablo Neira Ayuso2-2/+95
This patch adds the BTS-side for the ip.access driver for A-bis over IP communications. This patch adds one example under test/ so you can test the existing BSC and BTS sides over ip.access. Still incomplete, it requires to allow to register some callback in the BTS side to perform some action once we receive some message. This will come in next updates.
2011-06-12src: add support for logging infrastructure in libosmo-abisPablo Neira Ayuso1-2/+25
This patch uses the new libosmocore logging infrastructure that allows to invoke log_init(&my_log_info) multiple times so we can register categories from libraries and applications.
2011-06-07e1input: rework generic (virtual and real) E1 line operationsPablo Neira Ayuso1-23/+16
struct e1inp_line_ops { int (*sign_link_up)(struct msgb *msg, struct e1inp_line *line); int (*sign_link)(struct msgb *msg, struct e1inp_sign_link *link); int (*error)(struct msgb *msg, int error); }; The description of the operations is the following: * sign_link_up is invoked if the signalling link becomes up. In A-bis over IP, we have to wait until the other peer identifies itself as a BTS/BSC device, then this function is invoked. This function is not used by ISDN drivers, the signalling link can be set up just after the line is created. * sign_link is called if we receive OML/RSL message. This function is used both by ISDN and A-bis over IP drivers. * error is called if we receive a malformed message. It is used both by ISDN and A-bis over IP drivers.
2011-06-07src: add libosmo_abis_init(void *ctx) to set the talloc contextPablo Neira Ayuso1-1/+6
This function is called during initialization, so we can set what's the talloc context for the application and the library.
2011-06-07src: use include/osmocom/abis instead of include/osmocom/gsm/abisPablo Neira Ayuso1-1/+1
Harald prefers short paths. This patch also remove commented includes in several files.
2011-06-05initial commit of libosmo-abisPablo Neira Ayuso2-0/+79
still many things to get fixed