Commit Graph

73 Commits

Author SHA1 Message Date
Andreas Eversberg 6e182087f4 Fix: LAPDm contention resoltion must acknowledge subsequent SABM
After reception of SABM, the network responds with UA and enters the
establised multiframe state. If UA is not received by mobile, the SABM
is transmitted again, and the network must respond with UA again, unless
it is from a different mobile.

Add LAPDm collision test (contention resolution on network side).
2013-04-06 23:23:52 +02:00
Holger Hans Peter Freyther 1c83e36cc9 tests: Verify that all tests exit with status=0. 2013-03-25 12:06:36 +01:00
Katerina Barone-Adesi 008e53baae utils: Introduce OSMO_ASSERT in the utils and use it in the unit tests
The tests should unconditionally assert, regardless of debug settings.
This uses the OSMO_ prefix as it's in the global namespace.
2013-03-09 23:52:29 +01:00
Katerina Barone-Adesi 3309a43ef5 Added a ring buffer log target to store the last N log messages.
The log target can be used via log alarms and show alarms.
Why? This feature was proposed/requested at
http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget
All messages use the same amount of space, prioritizing simplicity.
2013-02-27 15:13:45 +01:00
Holger Hans Peter Freyther efd2bd691f Revert "Added a ring buffer log target to store the last N log messages."
I noticed some more issues and it is the easiest to revert and include
the fixed version.

This reverts commit 73377229bb.
2013-02-27 14:51:33 +01:00
Katerina Barone-Adesi 73377229bb Added a ring buffer log target to store the last N log messages.
The log target can be used via log alarms and show alarms.
Why? This feature was proposed/requested at
http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget
All messages use the same amount of space, prioritizing simplicity.
2013-02-27 14:45:48 +01:00
Holger Hans Peter Freyther 49f4e5be9f fr_test: Speculative build fix for FreeBSD 2013-01-15 21:18:02 +01:00
Holger Hans Peter Freyther 97602d9734 fr: Begin with a GRE/FrameRelay test due the recent regression
The framerelay code is seldomly used and the socket clean ups introduced
a regression. Create a testcase that will work as a user not having the
right capabilities to create raw sockets.

We have to make sure that this test is working even when not ran as root.
The easiest way to do this is to provide our own socket implementation.
This is done with dlopen/dlsym to convert the raw socket request to an UDP
one.
2013-01-15 20:06:40 +01:00
Alex Badea 695e5fb049 tests/timer: tweak path to config.h
When building out-of-srcdir, "../../config.h" fails to reach config.h
because the compiler is invoked in $builddir/tests/, not
$builddir/tests/timer/.  Use "../config.h" instead; this also works
for in-srcdir builds.

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
2013-01-06 00:42:26 +01:00
Daniel Willmann 13bb169d71 tests: Don't delete atconfig in clean
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-12-26 10:56:14 +01:00
Holger Hans Peter Freyther af723a4ed4 lapd: Fix compiler warnings in the lapd code
lapd_test.c: In function ‘ms_to_bts_l1_cb’:
lapd_test.c:192:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
lapd_test.c:199:1: warning: no return statement in function returning non-void [-Wreturn-type]
lapd_test.c: In function ‘main’:
lapd_test.c:355:2: warning: implicit declaration of function ‘osmo_init_logging’ [-Wimplicit-function-declaration]
2012-12-26 10:51:00 +01:00
Daniel Willmann e523392c2c lapd: Check in rslms_rx_rll() if lapdm context was initialized earlier
This was found while implementing handover on a sysmobts. When we
receive a channel release request for a channel that was never really
activated (set_lapdm_context() was not called) we segfault in
lapd_recv_dlsap().

We now return early with -EINVAL in rslms_rx_rll() if we receive a
message that assumes set_lapdm_context() was already called.

These are:
* RSL_MT_UNIT_DATA_REQ
* RSL_MT_DATA_REQ
* RSL_MT_SUSP_REQ
* RSL_MT_REL_REQ

A test case was added to trigger the issue.
2012-12-26 10:48:01 +01:00
Sylvain Munaut 5689a3b744 build: Don't use the deprecated INCLUDES in the various Makefile.am
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-11 23:59:31 +01:00
Holger Hans Peter Freyther 779d2f42a4 logging: Modify the testcase to excercise Nico's fix 2012-09-27 16:31:29 +02:00
Holger Hans Peter Freyther 4b54cab476 logging: Move the logging test from OpenBSC into libosmocore
Add a testcase for the logging facility. The test is coming from
the OpenBSC code.
2012-09-27 16:29:54 +02:00
Holger Hans Peter Freyther c302eca2c6 tests: Make the gb test work with srcdir != builddir
* Disable color and printing the filename of the stderr log target,
  update the results
* Add the .ok, .err and .sh files to the extra_dist
* Execute the shell script from the source directory
2012-09-11 11:49:35 +02:00
Harald Welte d8b476988d BSSGP: make bvc_ctx->fc a dynamic talloc allocation
this ensures that we can talloc the flow-control queue entries
as siblings off the bvc_ctx.
2012-09-07 12:07:54 +02:00
Harald Welte 04f0989d11 GPRS BSSGP test: integrate into autotest
we use a smalle shell script to iterate over multiple tests
2012-09-07 12:07:54 +02:00
Harald Welte 57e5b94e90 BSSGP flow-control: Add unit test for algorithm tests 2012-09-07 12:07:54 +02:00
Holger Hans Peter Freyther 8c589d2f51 misc: Fix make distcheck of libosmocore by adding the result to the dist
Add the new result file to the EXTRA_DIST.
2012-08-25 22:03:42 +02:00
Harald Welte c8a0b93939 GSM 04.08: Add support for parsing CSD related bearer capabilities
Also adds a test case for both encoder and decoder of this IE
2012-08-24 21:37:59 +02:00
Harald Welte b53717f418 Add missing includes to timer_test.c and osmo-auc-gen.c
This fixes the build with -Werror-implicit-function-declaration.

taken from malformatted patch of Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org>
2012-08-02 08:42:59 +02:00
Diego Elio Pettenò ea0e1eca2b build: simplify test handling and speed up build.
Instead of using a ./configure parameter to decide whehter to build
tests or not, use the check_PROGRAMS variable so that the tests are
only built when running `make check`.

To avoid slowing down the test phase itself, collapse the declaration
of the test targets in the tests/Makefile.am file, this way they can
be built and linked in parallel before the testsuite is executed.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:42 +02:00
Holger Hans Peter Freyther 00a12feae6 timer: Increase the imprecision we accept in this test
On a loaded server we might not be able to reach 10ms precision
in the test configuration and this is not a high precision timer
anyway.
2012-04-05 09:53:38 +02:00
Holger Hans Peter Freyther 13b07de36a auth: Update test result with the new OP/OPC output 2012-03-21 20:54:44 +01:00
Harald Welte 042afe7fe7 milenage: Add function to compute OPC from OP and K 2012-03-21 08:19:47 +01:00
Harald Welte 07b625dd2c GSM 08.08: change gsm0808_create_classmark_update() prototype
The caller explicitly specifies CM2 and CM3, rather than one blob
containing both.
2012-01-26 22:42:16 +01:00
Holger Hans Peter Freyther 97510814d8 tests: Introduce a very basic gsm0808 test
This tests verifies the content of the GSM 08.08 messages, it does
not verify the remaining headroom (which the SCCP/IPA code relies
on being plenty to prepend the header). More to come in the future.
2012-01-22 13:46:58 +01:00
Holger Hans Peter Freyther 3a5f08c221 lapdm: Make sure that the msgb_l3len(msg) == length...
This code should not play with the internals of the msgb like this,
this code got introduced in af48bed556 and is breaking the
osmo-bts usecase of forwarding an RSL message.

Add a test case that fails without the new code. I would prefer if
we could get rid of the manipulating the msgb like this, it is prone
to errors like this one.
2012-01-12 23:23:19 +01:00
Holger Hans Peter Freyther 90656dbd00 lapd: Warn if someone attempts to send an empty message
DATA REQ with a msgb_l3len(msg) == 0 message does not make any
sense, log an error and return immediately before attempting to
send an empty I frame in lapd_send_i.
2012-01-12 23:23:10 +01:00
Holger Hans Peter Freyther 4a075f82f0 lapd: Disable one part of the test as it fails on FreeBSD
I thought this number would be wrong in the same way but it depends
on OS/ARCH. Disable this part of the test for now.
2011-12-12 00:41:25 +01:00
Holger Hans Peter Freyther 15f740caa3 lapd_test: Look at the content of LAPD messages and compare them
Verify the output, accept two known errors in the generation of it.
2011-12-12 00:34:06 +01:00
Holger Hans Peter Freyther 72bd4eb3b9 lapdm: Create a simple test case to transmit data between both ends
This is testing the establishment of two ends (BTS, MS) one is in
the polling mode as used by osmo-bts. Transfer data between the two
ends. The sent data is not verified though. This should be followed
up soon.
2011-12-11 21:35:06 +01:00
Harald Welte aae2362455 auth_core: don't use anonymous unions to make certain gcc versions happy 2011-12-07 11:35:02 +01:00
Harald Welte 57143a4361 milenage_test: make sure test output is what .ok file expects 2011-12-07 03:12:44 +01:00
Harald Welte 9df00bb857 milenage_test: make sure test result matches expectations 2011-12-07 02:56:11 +01:00
Harald Welte 5c6032393b whitespace fixes in milenage_test.ok 2011-12-07 00:24:59 +01:00
Harald Welte e076ac087c add autotest script for milenage/auth testing 2011-12-07 00:10:18 +01:00
Holger Hans Peter Freyther 62cb457632 tests: Use the missing from the source directory
No need to keep a manual copy of the missing binary, use the one
that will be in the top_srcdir.
2011-11-29 22:20:34 +01:00
Sylvain Munaut 29eb92db02 core/conv: Add regression testing code
It tests both a given test vector encoding/decoding, and
some random coding/decoding cycles.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-24 17:48:42 +01:00
Sylvain Munaut a42e2f6fb6 tests/a5: Add a5_test.ok as EXTRA_DIST
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-17 21:31:01 +01:00
Sylvain Munaut fb19530f67 tests: fix cut & paste error
Damn ... I fixed it locally and didn't properly commit the fix before
push.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-17 21:16:51 +01:00
Sylvain Munaut 810c33483e tests/a5: Add a5 regression testing
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-17 20:33:19 +01:00
Holger Hans Peter Freyther f6c1d4cd81 tests: Fix the make distcheck of libosmocore with the tests 2011-11-14 14:37:46 +01:00
Holger Hans Peter Freyther bf12800c51 tests: Initialize log system to fix crash, update test result
Use osmo_init_logging to initialize the log system to fix crashes
when we attempt to parse broken ASN1 messages.

Ignore stderr with parse errors, update the test result. make check
is now passing.
2011-11-14 13:35:42 +01:00
Pablo Neira Ayuso 72eb44cc51 tests: timer: set maximum wait time to obtain test results
If the timer test takes more than 2 * (number of steps + 10), we
abort the test. This calculation is based on the maximum timeout
randomly set (10 seconds) plus the number of steps (some existing
timers may be reset in each step). We double this to have some
extra grace time to finish.
2011-11-14 13:35:42 +01:00
Pablo Neira Ayuso 7a0ca16eec tests: timer: use stderr for non-repeatable output
This makes happy gnu-autotest for the timer test.

We may still may fail if we run the test on a very heavy loaded
system, but given the amount of timers that we using for the
automatic test (only 32), this seems very unlikely to me.
2011-11-14 13:35:42 +01:00
Holger Hans Peter Freyther ad0e8859c2 tests: Reduce the iterations for the timertest, ignore stderr
Use one of the magic commands for the stderr, in this case we want
to log the output but ignore it for processing.

http://www.gnu.org/s/hello/manual/autoconf/Writing-Testsuites.html#Writing-Testsuites
2011-11-14 13:35:41 +01:00
Pablo Neira Ayuso f141837ea8 tests: timer: add parameter to select the number of steps
Holger likes having a parameter to set the number of steps in this
test. Now you can set it via `-s' option.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-11-14 13:35:41 +01:00
Holger Hans Peter Freyther f9eda7489b tests: Use GNU autotest to execute our tests and compare textual output
The output of make check is looking like this now:

Regression tests.

  1: bits                                            ok
  2: msgfile                                         ok
  3: sms                                             ok
  4: smscb                                           ok
  5: timer                                           FAILED (testsuite.at:38)
  6: ussd                                            FAILED (testsuite.at:44)
2011-11-14 13:35:41 +01:00