summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/osmo_hlr.py
AgeCommit message (Collapse)AuthorFilesLines
2017-08-24Introduce auth_algo modem config attributePau Espin Pedrol1-1/+11
Algorithm to use to generate response for the challenge during authentication time is hardcoded in the sim card and cannot be easily changed. Thus specify in the config of each modem the algorithm used by the SIM Card. This attribute is used add subscriber_add() time, when the IMSI, KI and algorithm to use in the MSC to authenticate a given subscriber is stored in the database. This way we can easily set up a specific algorithm for each SimCard/Modem, in case different SimCards are configured with different algorithms. This can be used to specificially test different algorithms too. For instance, let's imagine we have 2 simcards, one configured to use comp128v1 and another one with xor, and we create a test which ckecks that XOR is algo is working fine. We don't want to accidentally select the modem with comp128v1 in this case. Thus we can use this attribute to create a scenario file matching 'auth_algo: xor' to ensure always the correct modem is picked. Change-Id: Ifdf74630afeb05452994bbc9eb62a745a1d745ce
2017-08-23hlr: Implement subscriber_delete APIPau Espin Pedrol1-0/+13
Change-Id: Iefb30ad552929386743d936bf629fe7a760a4713
2017-08-23hlr: Use python module instead of cmdline to modify sqlite dbPau Espin Pedrol1-16/+11
Change-Id: I94a294c37f361a666064094455c9a1e1399fdfc7
2017-08-23hlr: fill auc_2g table when registering a subscriberPau Espin Pedrol1-2/+11
Change-Id: I491d093934c129a01baa1c5d7ada4acf370bf37d
2017-06-17Use a subdir of run_dir for each testPau Espin Pedrol1-1/+1
Processes created have the scope of the test, so we should store everything in a per-suite_run/per-test directory, otherwise everything is stored in the same trial run_dir directory and it's really messy. Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957
2017-06-13fix and refactor logging: drop 'with', simplifyNeels Hofmeyr1-12/+11
With the recent fix of the junit report related issues, another issue arose: the 'with log.Origin' was changed to disallow __enter__ing an object twice to fix problems, now still code would fail because it tries to do 'with' on the same object twice. The only reason is to ensure that logging is associated with a given object. Instead of complicating even more, implement differently. Refactor logging to simplify use: drop the 'with Origin' style completely, and instead use the python stack to determine which objects are created by which, and which object to associate a log statement with. The new way: we rely on the convention that each class instance has a local 'self' referencing the object instance. If we need to find an origin as a new object's parent, or to associate a log message with, we traverse each stack frame, fetching the first local 'self' object that is a log.Origin class instance. How to use: Simply call log.log() anywhere, and it finds an Origin object to log for, from the stack. Alternatively call self.log() for any Origin() object to skip the lookup. Create classes as child class of log.Origin and make sure to call super().__init__(category, name). This constructor will magically find a parent Origin on the stack. When an exception happens, we first escalate the exception up through call scopes to where ever it is handled by log.log_exn(). This then finds an Origin object in the traceback's stack frames, no need to nest in 'with' scopes. Hence the 'with log.Origin' now "happens implicitly", we can write pure natural python code, no more hassles with scope ordering. Furthermore, any frame can place additional logging information in a frame by calling log.ctx(). This is automatically inserted in the ancestry associated with a log statement / exception. Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90
2017-06-08osmo-msc: configure HLR addressNeels Hofmeyr1-0/+3
In db59bcf9fcdc5f05fdb9047b905ab497472440bc we added a configured GSUP server address for the osmo-hlr, but the osmo-msc is still trying to connect to 127.0.0.1. In the same way as for mgcpgw, add conf_for_msc() to OsmoHLR, and use that to configure the HLR's address in osmo-msc.cfg. Related: OS#2320 Change-Id: I005aa160c679fc92b248abd762888959bd5b2c55
2017-06-03Re-License under GPLv3-or-later instead of AGPLv3-or-laterHarald Welte1-3/+3
The "Affero" nature makes sense for the Osmocom network components like BSC, SGSN, etc. as they are typically operated to provide a network service. For testing, this doesn't make so much sense as it is difficult to imagine people creating a business out of offering to run test cases on an end-to-end Osmocom GSM network. So let's drop the 'Affero' here. All code is so far developed by sysmocom staff, so as Managing Director of sysmocom I can effect such a license change unilaterally. Change-Id: I8959c2d605854ffdc21cb29c0fe0e715685c4c05
2017-05-29MSC+BSC: add test api to run OsmoMSC and OsmoBSC with AoIPNeels Hofmeyr1-0/+129
Change-Id: I5842e8f1cba8e8e6bedfc08540efcafe207159cb