aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2019-03-07AMR: add functions to convert between bw-efficient and octet-alignedpmaier/amrmanglePhilipp Maier4-2/+492
RFC 3267 describes two different AMR frame formats. Octet Aligned and Bandwidth efficient mode. In Bandwith efficient mode the padding bits, which are used to align CMR, TOC and payload on octet boundaries are saved and the fielda are packed directly one after another. - Add functions to convert from one mode to the other and vice versa. - Add function to detect in which mode an AMR frame is encoded. Change-Id: I5b5a0fa644d8dbb1f04f9d7e35312683c7b3d196 Related: SYS#4470
2019-02-07Add stream client/server testMax5-1/+417
Previously stream client and server code were only used in examples which means regressions could be easily introduced unnoticed until they trigger bugs in external code which relies on osmo_stream_*() Fix this by adding basic client-server interaction tests with and without reconnection. Change-Id: I336f79970982ed8e1d73b73d54fa4c27ba8bce8e
2018-08-01Migrate from osmo_ipa_idtag_parse() to ipa_ccm_id_resp_parse()Harald Welte1-3/+4
In libosmocore Change-ID I1834d90fbcdbfcb05f5b8cfe39bfe9543737ef8f we have introduced ipa_ccm_id_resp_parse() as a bugfixed replacement of ipa_ccm_idtag_parse(). The main difference is that the returned "value" parts now have a correct reported "length", whereas before this commit they all reported a one-byte too-long "length" for each IE. Let's use this opportunity to remove the copy+pasted osmo_ipa_idtag_parse() function from the libosmo-netif codebase. Change-Id: I4626d247626543e032593bf226b6c233f6678562
2018-05-15jibuf: Fix out-of-order seq queue around syncpointsPau Espin Pedrol2-4/+3
Fixes: OS#3262 Change-Id: Ib8c61dbe6261cf73d6efcd7873e23b7656117556
2018-05-15tests: jibuf_test: Add scenario to show out-of-order bugPau Espin Pedrol2-0/+83
Related: OS#3262 Change-Id: I1e78cc44f8a04dcb983352b513f8de2574b2394b
2018-05-15tests: jibuf_test: Set some functions as staticPau Espin Pedrol1-2/+2
Change-Id: I3af6db3fd74d55c5e659132fc542f22478a55eb7
2018-04-19osmux: Move examples and tests to use new output APIsPau Espin Pedrol3-18/+13
Change-Id: Ie69c427308eb7d81aedab7fbb71f1bdaf43f0275
2018-04-19osmux: Set Marker bit on osmux frame loss detectedPau Espin Pedrol2-10/+17
Until this patch, we didn't notify in any way to the RTP reader when an Osmux frame was lost. Instead, we updated the seq&timestamp as if there was no lost, and as a result the RTP reader would only see a steady increase of delay every time an osmux frame was lost. As the batch_factor for the lost packet is unknown, we cannot assume any number of amr payloads lost, and thus we cannot simply increment seq and timestamp for a specific amount. Instead, the only viable solution seems to set the M marker bit in the first rtp packet generated after a non-consecutive osmux frame is received. The implementation may act differently with the first generated RTP packet based on the first osmux seq number used for the stream. In case 0 it's used as first osmux seq number, M will be set depending on request from original RTP packet having the M bit set. If it's not 0, the first RTP packer will unconditionally have the M bit. That's not an issue because it's anyway expect for receiver to sync on the first packet. Related: OS#3185 Change-Id: I2efed6d726a1b8e77e686c7a5fe1940d3f4901a7
2018-04-19tests: Add osmux2 testsuitePau Espin Pedrol4-1/+497
This test is aimed at testing several specific scenarios related to how osmux manages in/out of osmux/rtp packets over time. Change-Id: I3bf59276424ea87c4e66a6ff46de1e3e9a06a904
2018-04-17examples: use osmo_init_logging2Pau Espin Pedrol1-1/+3
Change-Id: I7f1f4503f254931edeebfbadf3953efa7b20f85f
2018-04-17Build jibuf_tool based on libpcap availabilityPau Espin Pedrol1-4/+9
Change-Id: I27cdb1b5175a5b02638e6d743b686bdf4b1be144
2018-04-17tests: use osmo_init_logging2Pau Espin Pedrol2-2/+6
Change-Id: Icc84bbd53e1589e26e445e3460024e77162bd76f
2018-04-13jibuf: Estimate src clock skewPau Espin Pedrol4-10/+972
Change-Id: Ifae633d53107417a8e2f9b0f200d2711db72d199
2018-04-13tests: jibuf_tool: Add seq.pltPau Espin Pedrol1-0/+50
Change-Id: I37bb3ab372b7ad7c3c1d09c8134827c932bf8bf8
2018-04-13jibuf: re-sync clock out of sync timestampsPau Espin Pedrol3-2/+128
Change-Id: I33556b33d7549654442d9bdd7f31128792506652
2018-04-13jibuf: Take RTP marker into accountPau Espin Pedrol3-2/+74
Change-Id: Ie142acfb45650e0af775f58226fd191beaf8178e
2018-04-13tests: jibuf_tool: Add parameters to control size of bufferPau Espin Pedrol1-4/+14
Change-Id: I8a7fa39985f8d197e24c32cab80299aba2d03087
2018-04-13tests: jibuf_tool: Add OSMUX supportPau Espin Pedrol1-3/+40
Change-Id: I0f02da0329e6739ff340d31113161bb520b1b760
2018-04-13tests: jibuf_tool: Improve jibuf_test to read pcapsPau Espin Pedrol3-105/+308
Change-Id: I7a13c823fb70e0adbc5fa0726fd66b15dc40014e Signed-off-by: Pau Espin Pedrol <pespin@sysmocom.de>
2018-04-13tests: jibuf_tool: Initial commitPau Espin Pedrol3-1/+421
Change-Id: I92307c8b1483dd488339771462290aae0ae5689a
2018-04-13jibuf: Add initial implementation of Jitter BufferPau Espin Pedrol4-2/+961
Change-Id: I9688ba9c4d5b733b9f29d0f15f73750f9271ef55
2018-04-12tests: osmo-pcap-test: Fix pcap includes not found in old versionsPau Espin Pedrol2-2/+2
pcap/dlt.h only exists on newer versions of libpcap. On older versions, same defines are available in pcap/bpf.h, which in newer versions include pcap/dlt.h, so we are always fine include pcap/bpf.h. As a side note, there's a lots of comments in pcap/dlt.h stating that those symbols used to reside in pcap/bpf.h but were moved there at some point. Change-Id: I824671a415eb3f35f480c934b9780ff13510011a
2018-02-26test: osmo-pcap-test: Fix clock drift while replaying pcap filePau Espin Pedrol2-7/+26
In the previous implementation, the processing time was not being taken into account, which was implicitly added for each new packet to be sent, which caused a steady incremental drift in the clock clearly visible when analysing a RTP stream. As it uses timespecsub, it depends on libosmocore Change-Id I45fc993b9bb0a343763238bf463c8640f47b00f1. Change-Id: I11cb9a63e16e829ccd4af1096b9f473c802d822f
2017-09-11osmux: fix buffer management mess in snprintf() callsPablo Neira Ayuso1-4/+4
SNPRINTF_BUFFER_SIZE() looks too complex, previous version maintains two different variables to account for the remaining space in the buffer, one of them is always decremented based on what snprintf() returns, which may result in underflow. These variables are swapped - not used consistently - all over this code. Replace this macro by a simplified version, with one single parameter to account for remaining space. This macro also deals with two corner cases: 1) snprintf() fails, actually never happens in practise, but documentation indicates it may return -1, so let's catch this case from here to stick to specs. 2) There is not enough space in the buffer, in that case, keep increasing offset, so we know how much would have been printed, just like snprintf() does. Thanks to Pau Espin for reporting, and Holger for clues on this. I have run osmux_test and, at quick glance, it looks good. Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797
2017-08-14osmux: Slightly improve output format of osmux_snprintfPau Espin Pedrol1-1/+1
The buffer for osmux_test is increased as the former doesn't seem to be able to cope with the whole output. Change-Id: Ic838dd9d7ad89b4510ccfa58c0390c69a075b616
2017-08-08tests: osmo-pcap: Allow different l2 pktsPau Espin Pedrol9-50/+189
Before this patch, ETH was assumed and other types were not supported. This patch also adds Linux cooked packet support for L2. Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f
2017-08-08tests: osmo-pcap: Fix per packet timerPau Espin Pedrol2-7/+13
Before this commit, the gap time between 2 packets {n-1, n} was being applied to {n, n+1}. Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea
2017-04-27osmux: Use osmo_gettimeofday for testing puroposesPau Espin Pedrol1-4/+24
This way we can use fake time and osmux_test take 700ms instead of >2sec to run. Change-Id: Ic39cab74400aca8262a00c0d06884230b1a15ca3
2017-04-27osmux: Add RTP marker bit supportPau Espin Pedrol1-1/+64
According to RFC4867 (RTP payload format for AMR): "The RTP header marker bit (M) SHALL be set to 1 if the first frameblock carried in the packet contains a speech frame which is the first in a talkspurt. For all other packets the marker bit SHALL be set to zero (M=0)." This information bit provides a way for the receiver to better synchronize the delay with ther sender. This is specially useful if AMR DTX features are supported and enabled on the sender. Change-Id: I0315658159429603f1d80a168718b026015060e9
2016-10-01configure: check for pkg-config presenceNeels Hofmeyr1-0/+7
Change-Id: Ifaea95befa3d1d8f6f047e22efcd62cb0bd8b287
2016-07-07osmux-test: remove real-time constraint by defaultNeels Hofmeyr1-0/+10
Introduce a local #define to disable the real-time constraint from osmux-test. It would make sense to remove this completely, but in case anyone may be interested in the timing on a specific platform, I've just #defined it away. The real-time constraint to pass or fail the test is a bad idea in terms of our build server. Whenever the server is loaded, the tests will fail for no reason, like here: https://gerrit.osmocom.org/474 The real time to calculate is highly dependent also on the hardware platform. The arbitrarity of the time constraint is sort of proven by dd24cdd95f3fb8c8f which simply doubles the time to pass the test. Change-Id: Ic1da4bd22411652334f73195b2e37853e0738906
2016-02-29osmux_test.c: tweak error reportNeels Hofmeyr1-1/+3
2015-07-21tests: osmux: iterate 64 times in osmo_test_loop()Pablo Neira Ayuso1-1/+1
Instead of 63, this resolves major "definitely lost" remaining leak that valgrind reports regarding msgb.
2015-07-21tests: compile tests with debugging symbols, ie. -gPablo Neira Ayuso1-1/+1
Useful when debuggin via valgrind/gdb.
2015-07-21tests: osmux: fix msgb leaksPablo Neira Ayuso1-0/+2
2015-07-21tests: osmux: test circuit reopening after closurePablo Neira Ayuso1-0/+7
Make sure circuit routines works correctly.
2015-07-21tests: osmux: validate dummy padding with no voice data interactionPablo Neira Ayuso1-0/+4
Make sure that early dummy bandwitch preallocation works fine in the absence of any kind of voice traffic.
2015-07-21tests: osmux: test online deactivation of dummy paddingPablo Neira Ayuso1-0/+4
Add RTP packets to circuit with dummy padding enabled to test automatic deactivation once when start seeing real voice traffic.
2015-07-21tests: osmux: factor out main test loopPablo Neira Ayuso1-28/+36
Move main test loop routine to the new osmux_test_loop() function.
2015-07-21tests: osmux: adapt it to use the new circuit APIPablo Neira Ayuso1-0/+13
This also introduces a spare circuit that contains no voice data to test bandwidth preallocation through the new osmux dummy frame type.
2014-10-02build: remove all_includesJan Engelhardt1-1/+1
This variable is never set and could therefore be removed.
2014-10-02build: put dependency libraries in the right place in MakefilesJan Engelhardt1-1/+1
Libs must be in _LDADD/_LIBADD and not in _LDFLAGS.
2014-05-22misc: Fix distcheck and refer to the right file0.0.3Holger Hans Peter Freyther3-4/+5
2013-12-16tests: osmux: no need to skip RTP message anymorePablo Neira Ayuso1-6/+4
With the fan-out approach to test multi-batch added int (078d532 tests: osmux: test multi-batch support), this doesn't need the explicit skip as there are already gaps to be filled.
2013-12-16tests: osmux: test multi-batch supportPablo Neira Ayuso1-5/+9
Extend this to test multi-batch in one packet support, eg. OSMUX message (len=158) OSMUX seq=016 ccid=000 ft=1 ctr=6 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=02 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ]OSMUX seq=017 ccid=001 ft=1 ctr=2 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=02 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ff d4 f9 ff fb e7 eb f9 9f f8 f2 26 33 65 54 ]
2013-05-27tests: osmux-test: double timing validation thresholdPablo Neira Ayuso1-1/+1
Double timing validation to avoid hitting errors easily.
2013-05-24tests: osmux_test: exercise osmux_replay_lost_packetsPablo Neira Ayuso1-2/+10
Emulate RTP message loss to test osmux_replay_lost_packets code in src/osmux.c. After this test, lcov reports 90.3% line coverage of osmux.c
2013-05-24tests: osmux_test: deadline after 10 secondsPablo Neira Ayuso1-0/+14
If the test takes longer than 10 seconds (it barely takes less than a second according to `time'), bail out and report an error.
2013-05-24tests: Use the libosmonetif we just built for the testsHolger Hans Peter Freyther1-1/+1
Use the library we just built instead for one already installed in the system.
2013-05-24add testsuite infrastructure and osmux testPablo Neira Ayuso4-0/+216
This patch adds the testsuite infrastructure and it populates it with one test for osmux. The osmux tests makes sure that: * We get the same number of RTP messages in the input and the output path. * The payload of the RTP message is reconstructed correctly. * The reconstructed timing is correct.