[PATCH 3/3] gtphub: nr_map: add min,max and wrap.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Jacob Erlbeck jerlbeck at sysmocom.de
Fri Nov 27 09:00:08 UTC 2015


On 26.11.2015 17:51, Neels Hofmeyr wrote:
> On Wed, Nov 25, 2015 at 09:05:40PM +0100, Holger Freyther wrote:

>> E.g. a unit test that exhausts the entire number space should be
feasible.
>
> Really? 4.294.967.295 TEI mappings?? Thats 4*sizeof(mapping) gigabytes and
> might need special memory model options to work, and the testing
> machine needs that many gigs of ram and will take quite a while: O(n²)...

I am fond of exhausting tests, too.

But AFAI understand, it would be enough to establish one mapping at
first and then establishing and releasing them immediately (N = 1) or
after e.g. N = 2^16 steps. Thus you had a persistent initial one and a
sliding window of N mappings and each new mapping could be checked
against at least the first one. If you still ran into memory problems,
you would have found a bug that way.

> Probably easier to manually assign a given TEI and make the pool return
> that TEI next.

This won't check the TEI generation, will it? If the allocation was
changed in the future (e.g. to be based on random numbers), this kind of
test wouldn't find bugs there.

Jacob

-- 
- Jacob Erlbeck <jerlbeck at sysmocom.de>       http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte



More information about the OpenBSC mailing list