| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The test is now fully deterministic, so include all detail in stdout, to check
for.
Change-Id: Iecf6387f1d25253fcf1260777673853030c1d326
|
|
|
|
|
|
| |
This way we can check the output in timer_test.ok.
Change-Id: Ia3bba1c650be3558d370e0f59d4ee7f36ef97506
|
|
|
|
| |
Change-Id: I9833031407e99f5d7a1144c26b68a7e320b2020d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use osmo_gettimeofday_override* to decouple the timer test from real time. No
longer call osmo_select_main(), since select() actually waits for real time.
This reduces the timer_test to the osmo_timer_* logic and excludes the real
time and osmo_timers_nearest() accuracy testing with actual waiting involved.
This may be seen as a loss, but is more fit for a test suite.
The main point here is to get deterministic results in jenkins, so that we
don't have to retrigger jobs based on timing failures; added bonus is that the
test runs much faster now.
Change-Id: Ic5649512df86dd17070daa2f314159eafaf8feb8
|
|
|
|
|
|
|
| |
This allows feeding a custom time for unit tests by overriding
osmo_gettimeofday.
Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
|
|
|
|
| |
Change-Id: I1570b7096c757d63d23e0950feeeb7230f8a5c9f
|
|
|
|
|
|
|
|
| |
When a timer was late, show the timing details.
Also count whether timers fired early, for completeness' sake.
Change-Id: Id3942637d77a28b5092ffffcc3e6d9d67c2b8e68
|
|
|
|
|
|
|
|
|
|
| |
The timer_test schedules timers and records the desired stop time. Also store
the usec value of the desired stop time, because scheduling at e.g. sec N usec
999999 but recording sec N usec 0, and then receiving a timer at sec N+1 usec 0
is only 1 usec late, but records as 1000000 usecs late. This might have been
the main cause of the timer test not working well on the osmocom build server.
Change-Id: I13bb60f7d341a397f95d13d9c63c40188b6cd5a0
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add src/gsm/libosmogsm.la explicitly to some test linkages, because otherwise
the linker would pick the libosmogsm already installed on the system instead of
the one that was just built in the source tree.
I noticed because a libosmogsm needing some more symbols from libosmocodec was
still installed, while the patch that cause it was already removed. Thus I
caught all(?) test binaries that linked libosmogsm from $PREFIX.
Change-Id: Ie61d60e1506f16de20add70fd0f44ebfa7a00a75
|
|
|
|
|
|
|
|
|
|
|
|
| |
Keith of Rhizomatica has an issue of a unrejected interrogateSS.
Start with just decoding the message and printing the empty test
and the code.
What is kind of missing is the classification between invoke,
returnResult and returnResultLast that we need to add in the
long run.
Change-Id: Iadfa156707a96f2a34f3948c7cc9a74435f17114
|
|
|
|
|
|
|
|
|
|
|
| |
Corresponding test code include both official test vectors from the
specs and data from over-the-air tests.
This obsoletes libosmo-crypt-a53 as it was last missing piece
unimplemented in libosmogsm.
Change-Id: I939e4f6b91b4a7c591ef3761fe2d46ed1c2fb2d3
Related: OS#1582
|
|
|
|
|
|
|
| |
Check if library actually support Milenage, COMP128 v2 and v3 algorithms
instead of just printing enum values or nothing.
Change-Id: I2b98481f56a8381058d4b29db5e8a36eb193eee9
|
|
|
|
|
|
|
|
|
| |
The actual code is from OsmoBTS' tch.c by Harald Welte. Add unit tests,
doxygen annotation and extra memory safety check. Those functions are
used in several BTS implementations but seems generic enough to be
generally useful.
Change-Id: I2b1901c4161e8035f059585901dca593b661556d
|
|
|
|
|
|
|
|
|
|
| |
This code is supposed to formalize some of the state machine handling in
Osmocom code.
Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466
Reviewed-on: https://gerrit.osmocom.org/163
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Add functions which check if given FR or HR frame (packed in RTP)
contains SID (SIlence Descriptor) and corresponding tests.
Related: OS#22
Change-Id: I4051e3c0d4fb9ee93d7e9e0ef4abaf9f18e227ca
Reviewed-on: https://gerrit.osmocom.org/160
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add functions to encode/decode various codec paramters from RTP payload with
AMR frame according to RFC 4867
* those functions are extended version based on code from osmo-bts'
amr.c by Andreas Eversberg
* add corresponding enum types and strings for logging
* add regression tests
It's useful both to replace manual parsing in osmo-bts with fuctions
covered by test suite and as a debugging helpers for issues related to
AMR.
Change-Id: Ia217679a07d3fbc970f435e20f6eac33d34bd597
Related: OS#1562
Reviewed-on: https://gerrit.osmocom.org/118
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
|
|
|
|
|
|
|
| |
Move those routines from OpenBSC to libosmogsm, so they can be
re-used from other programs. I think it was a mistake to add them only
inside the openbsc repository in the first place. We need to pay more
attention to this in the future.
|
|
|
|
|
| |
These routines have nothing to do with specifically the BSC, so import
them to the TLV parser we keep in libosmogsm.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add python utility to generate .c code with convolutional
encoder/decoder based on polynomial description of the code. If argument
given it'll be interpreted as intended output directory, otherwise
current working directory is used.
Codes for *CCH, CS2/3 and TCH/AFS are generated. Corresponding manual
implementations are removed from tests. This introduce build-time
dependency on python.
The main work for this patch was generously contributed by Sylvain
Munaut.
Fixes: OS#1629
|
|
|
|
|
| |
Move functions for conversion between soft and unpacked bits to main
library as they are generally useful.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Add function which adds specified number of bits from each element of
array to the bit vector prefixing each addition with one and finishing
entire sequence with adding 0. This is very common patter for various
repetitive data structures described with CSN.1 in 3GPP standards.
Corresponding test vectors and doxygen headers are added too.
|
|
|
|
|
|
| |
There doesn't seem to be a reason not to check the filter. Update
and extend the test. Currently the filter function will be called
once for the log check and once for the output of it.
|
|
|
|
|
|
|
|
| |
This commit adds OSMO_ASSERTs for mandatory conditions related to
log_check_level, and fprintfs for optional conditions, since it is
always safe for log_check_level to return != 0.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
| |
It's sometimes handy for debugging to be able to immediately see which
bits are set in a given byte. Generalize macro used for that in bitvec
tests and make it available for the rest of the library.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function originates from openbsc/src/gprs but is just specific
to BSSGP/Gb on the same level like bssgp_msgb_alloc.
This commit puts the former gprs_msgb_copy function beside
bssgp_msgb_alloc.
Renamed function:
gprs_msgb_copy -> bssgp_msgb_copy
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add bit map encoder and decoder functions: decoder is fully functional
while encoder is good enough for testing - no backtracking to find
the best possible compression is implemented. If somebody is willing to
implement MS side of EDGE than this has to be expanded.
Add corresponding tests.
N. B: the encoding is implemented according to ETSI TS 44.060 which is
slightly different from T4 used for fax according to CCITT G31D (RFC 804).
Ticket: OW#2407
Sponsored-by: On-Waves ehf
Signed-off-by: Max <msuraev@sysmocom.de>
|
|
|
|
|
| |
Add bit filling, shifting and other functions necessary for bit
compression implementation. Add corresponding tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
osmo_hexdump_nospc/osmo_hexdump is an old school C routine with a
static internal array. This means that printf will most likely one
of the two strings twice. For Linux/glibc this is the first string
(for whatever reason?) and for FreeBSD it is the last call of the
osmo_hexdump_nospc. We could have noticed by both strings being
of the same length besides the different length input. The second
issue is that we cast a hexstring to uint8_t and dump the string
as hex. So the two strings should not match at all.
Fix it by printing the hex string as plain hex and separating the
two printf calls. Update the test output.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bitvec_read_field/bitvec_write_field in the PCU used a C++ reference
and when porting to C it was decided to pass the parameter by value
and this lost the "back propagation" of the new index. Change the
parameter to be an in/out parameter and this way do not have a silent
semantic break in the osmo-pcu (where we copy the reference in csn.1
by value) and have a true compile failure.
Add Max's simple test for bitvec_unhex function leaving the checking
of bitvec_read_field and the side effect in the datastructure about
the number of bits still open.
|
|
|
|
|
|
| |
Use %td to print ptrdiff_t use %zu to print size_t,
include time.h on FreeBSD. Some more compiler warnings are
left but they require more thinking.
|
|
|
|
|
| |
GCC 5 has changed inline semantics (https://gcc.gnu.org/gcc-5/porting_to.html)
and apparently that now fails to link.
|
|
|
|
|
|
| |
Include a test for msgb_trim.
Sponsored-by: On-Waves ehf
|
|
|
|
| |
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the msgb error handling cannot be fully tested, since in
many cases osmo_panic will be called. This will in turn call abort().
Using an osmo_panic_handler that just returns will not help, since
many msgb functions rely on MSGB_ABORT to not return at all.
This commit uses an alternative osmo_panic_raise handler that just
calls longjmp to return to the test function.
Since some of this activity is logged to stderr where the strings may
contain variable parts like pointer addresses, stderr checking is
disabled in testsuite.at.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
| |
This tests several API functions of the msgb by checking the
invariant and by dumping resulting message buffers as hex.
Sponsored-by: On-Waves ehf
Conflicts:
tests/Makefile.am
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new functions bitvec_get_bytes and bitvec_set_bytes copy
byte sequences from bitvecs to uint8_t arrays and vice versa.
While the bytes in the bitvecs do not need to be aligned, the uint8_t
arrays always are. In case the bytes in the bitvec are aligned, the
implementation uses memcpy.
Note that the implementation like the other existing functions assume
MSB first encoding.
[hfreyther: Squash the comment fix into this commit as well]
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions are currently part of openbsc but also needed by
other projects.
The function have been renamed as follows:
gprs_apn_to_str -> osmo_apn_to_str
gprs_str_to_apn -> osmo_apn_from_str
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the state is assumed to remain the same while the reset
procedure is active. While this works correctly in general, a single
unexpected BLOCK_ACK or UNBLOCK_ACK can change the state but will not
stop the reset procedure. The leads to repeated RESET messages, where
the corresponding RESET_ACK is ignored. This is a stable state which
can only be left by manual intervention or by reception of a RESET
message from the peer.
This commit changes the RESET timeout handler to set the state to
BLOCKED/RESET when sending the new NS RESET message.
Note that this should ensure a clean restart even if the state has been
screwed up. It does not fix the handling of BLOCK_ACK or UNBLOCK_ACK
in abnormal cases.
Addresses:
gprs_ns.c:349 NSEI=8895 Tx NS RESET (NSVCI=8895, cause=O&M intervention)
gprs_ns.c:878 NSVCI=8895 Rx NS RESET ACK (NSEI=8895, NSVCI=8895)
gprs_ns.c:887 NS RESET ACK Discarding unexpected message for NS-VCI 8895 from SGSN NSEI=8895
Ticket: OW#1551
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
| |
Shipping our own private copy of talloc was a good idea in 2008,
when it was not readily available on most target platforms. Today,
the situation is quite different, as it is a standard library on
major Linux distributions.
|
|
|
|
|
|
| |
Adds a rudimentary leak check for the counters and stat items.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This tests uses a dedicated test reported to check several aspects of
the value reporting.
- addition/removal of stats reporter
- addition/removal of counters/items
- setting of max_class
- initial value flush
- updating single counters/items
- reporter retrieval
- enable/disable
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
| |
This commit adds tests to verify the stats related VTY configuration
commands.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
| |
Currently this is part of the only test function that uses the
vty directly.
In preperation for more such test cases, this commit moves this code
into separate functions.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
| |
The addition of libosmovty.la to several test cases as done in
commit 738d9e22108a8e47245 (stats: Add vty_out_stat_item_group)
is not needed.
This commit removes them.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
| |
Since the the stat_item and stats functions and data types are meant
to be exported, they get an osmo_ prefix.
Sponsored-by: On-Waves ehf
[hfreyther: Prepended the enum values too. This was requested by
Jacob]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit provides stats configuration similar to the log
configuration.
The following vty commands are added to the config node:
stats reporter statsd Create/Modify a statsd reporter
no stats reporter statsd Remove a statsd reporter
To actually configure a reporter, the config-stats node is entered
when the "stats reporter" command has succeeded. The following new
vty commands are available there:
local-ip ADDR Set the IP address to which we bind locally
no local-ip Do not bind to a certain IP address
remote-ip ADDR Set the remote IP address to which we connect
remote-port <1-65535> Set the remote port to which we connect
prefix PREFIX Set the item/counter name prefix
no prefix Do not use a prefix
enable Enable the reporter
disable Disable the reporter
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently each stat item has a separate index value which basically
counts each single value added to the item and which can be used by
a reporter to get all new values that have not been reported yet.
The drawback is, that such an index must be stored for each stat
item.
This commit introduces a global index which is incremented for each
new stat item value. This index is then stored together with the item
value. So a single stored index per reporter is sufficient to make
sure that only new values are reported.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
| |
This functions dumps a whole stat item group to the VTY.
Sponsored-by: On-Waves ehf
|