AgeCommit message (Collapse)AuthorFilesLines
2017-09-14Reserve ARFCN dynamically based on BTS band supportpespin/arfcnPau Espin Pedrol15-41/+177
Instead of statically specifying a band for a BTS to use, declare a list of supported bands for each BTS. At the time of BTS object creation, ask the BTS for band support and try to dynamically reserve an ARFCN resource which is compatible with any of the bands supported by the BTS. All this happens transparently to the test. Still, the test may want to use a specific band / arfcn. In this case, a test can use suite.reserve_arfcn(band, arfcn) to reserve a specific band/arfcn and pass that to the BTS at creation time, which will then use that one instead of trying to find a suitable one. It is left as future work to support BTs with multiple TRX, in which case several arfcn must be reserved. It should not be that difficult, mostly using "times: X" where X is the amount of trx, changing the API to use a list of arfcns and the configure() methods of the BTS. Related: OS#2230 Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9
2017-09-14resource: find: replicate_times() is not needed anymorePau Espin Pedrol2-5/+9
Resources are expanded before this point, so we don't need to expand them here. Change-Id: I12a5349f9377dc8a24cb2afbe33c2401eeed0660
2017-09-14resource: Allow passing keyword args to NoResourceExnPau Espin Pedrol1-1/+2
Same code is already being used by log.Error exception. This way we can use: raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands) And get: osmo_gsm_tester.resource.NoResourceExn: No free arfcns in any of bands {bands=['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900']} Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46
2017-09-14Add features attribute to modemsPau Espin Pedrol4-0/+17
The idea behind this attribute is similar to the Features one in ofono: To provide an easy-to-use list of features that a modem supports. In osmo-gsm-tester this feature list can be used to create scenarios to act as a filter for modems. For instance, if an sms related feature must be tested, then a modem supporting sms features is required. This way only modems supporting that feature are going to be selected for that test when that scenario is used. We provide our own list instead of dynamically using it for two reasons: - Accessing the list from ofono means powering on + online the modem, which requires using the modem before resource resolution is done. - ofono may state that it has support for feature X, but it still doesn't have all features required by osmo-gsm-tester or there is a bug in some part of the feature which prevents it from being used for a specific test. Change-Id: I1634049f01859ae0310174892a96e204bb670bc1
2017-09-14resource_test: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: I654484b21ca2e950ff3019ee20133e9cb50296bb
2017-09-14resource_test: update to check list features (ciphers)Pau Espin Pedrol3-242/+187
Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c
2017-09-14Add cipher cfg param for modem and btsPau Espin Pedrol6-1/+31
This parameter is contains a list of supported encryption ciphers by the modem or bts setting it. It is so far not directly/automatically used inside osmo-gsm-tester code, but can be useful to create scenarios for tests that require specific ciphering modes. For instance, aoip_encryption suite contains tests that require a BTS and a modem that supports a5 0 and a5 1, otherwise tests will fail. Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e
2017-09-14Use own format to specify encryption algorithmPau Espin Pedrol9-13/+26
... instead of using the one from from osmo vty directly. This way we avoid having multiple word attribute value and we can skip using quotes in the conf files. Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d
2017-09-14suite_test: Update tests to check new feature fixesPau Espin Pedrol3-51/+69
Now that combination and matching of lists works properly, update the suite test to check a more complex scenario. Change-Id: Ib0b82dc0c2a7f27cd6b2ffc32eed5f1287692ddc
2017-09-14resource: Handle lists correctly in item_matchesPau Espin Pedrol5-9/+57
We want to handle lists in the same way as we handle them in combine(). Without this commit, reserve()->find() failed to match objects containing dictionaries inside lists correctly (such as trx configs). A few attributes are added to trx_list of some resources in suite_test/resources.conf to show a case in which resource reservation would fail without this patch. It failed because before this patch, dictionaries inside lists are compared to be equal instead of being compared element by element to see if one dictionary is a subset of the other one (for each element in the lists). Change-Id: I8588d5b788b9f74a9cc84b8bdcb049921788bb48
2017-09-14config: Fix combination of listsPau Espin Pedrol4-3/+158
This commit fixes combination of resources containing lists. For lists containing complex types, it has been decided to handle them as sorted list, where position in list matters. In this case, combine is called recursively for each element in dest and src sharing position in the list, and assumes that if one list is shorter than the other, then it has to be combined against empty set for that tye. For instance this is useful when defining trx_list properties, where a BTS can have a different amount of TRX but we may be interested in restricting the first TRX and don't care about extra TRX. For lists containing simple types (eg. integers or strings), we just want to merge both lists and we only need to check if the value is already there, ie. handle them as unsortered sets. This case won't work if we call combine for each element of the list because for a simple case it will just end up checking if a[i] == b[i]. This kind of operation for simple types is needed in later commits where cipher attribute is introduced. Without this patch, having following 2 scenarios and trying them to use together "-s foosuite:cipher-a50+ciphera51" will fail: cipher_a50.conf: bts: - ciphers: - 'a5 0' cipher_a51.conf bts: - ciphers: - 'a5 1' ValueError: cannot combine dicts, conflicting items (values 'a5 0' and 'a5 1') Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015
2017-09-14suite: Replicate resources based on times attr before calling combinePau Espin Pedrol5-4/+185
As suite.conf and scenarios need to match 1-to-1 in lists, it's important to extend the dictionaries by replicating the objects with a 'times' values higher than 1 in order to match the objects correctly. Two unit tests are added as a show case. Unfortunately output showing scenario dictionaries needs to be ignored while verifying because it was encountered that different versions of python print dictionary elements in different order. Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6
2017-09-14nominal_power and max_power_red attrs can now be set per resourcePau Espin Pedrol8-8/+43
Before this commit, only max_power_red was specified and it could only be used as a defaults and could not be set per object. Together with nominal_power, it can be useful to be able to set them to different values for different objects, as for example different osmo-bts-trx objects can require different values. Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd
2017-09-14config: Fix variable reference before assigmentPau Espin Pedrol1-1/+1
Change-Id: I1a1acd7b3e5ff96b09a9a8e2825fb864ead9e54b
2017-09-12config: replicate_times: insert replicates in placePau Espin Pedrol1-7/+7
In the following suite.conf, position matters when matching against scenarios: [suite.conf] resources: bts: - type: sysmo times: 2 - type: osmo-bts-trx times: 1 [scenario] resources: bts: - - ip_addr: In this case, for instance, we make it clear that we want the second sysmo bts which has IP With old behaviour, the replicated sysmo would have been created at the end (3rd position), and the ip_addr would match against the osmo-bts-trx BTS. Change-Id: Id78e2326db964d5efb6648854b57d8addce4deb0
2017-09-12Move code to replicate dicts based on times attr to its own functionPau Espin Pedrol2-10/+16
Change-Id: I26ddae2124813bfb63a7c97c466e056cd2ef991a
2017-09-12resource: times is expected to be a non-zero positive integerPau Espin Pedrol2-1/+8
Change-Id: Ie9e313727053a411cec2f698c3bd654d27e8013f
2017-09-12resource: ipa_unit_id is expected to be a positive integerPau Espin Pedrol2-1/+8
Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb
2017-09-12Use tmpdir to create bts pcu-socketPau Espin Pedrol3-3/+27
In commit 329b6f4 pcu-socket path was moved to run inside the test run dir to avoid issues between different tests creating a socket in the same place. However, it seems unix sockets paths are limited to 108 bytes (with Null char included). In some cases, the run dir for a test can be quite long, as it contains suite name, test name, etc. and the path can be longer that the limit defined above. In order to fix this issue, create a tmp dir using mkdtemp to ensure the path to be used for the pcu-socket doesn't collide between different instances of osmo-bts-trx. Clean up of tmp dir and pcu socket is done inside the cleanup() method called by method pcu_socket_path() is added to help with new implementation, and it will be used as well as a public API later soon to be used by OsmoPcu classes. Related: OS#2507 Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038
2017-09-10resource: Fix list comparison in item_matchesPau Espin Pedrol1-2/+5
In following commits, cipher attribute containing a list of supported ciphers is introdued in osmo-gsm-tester. While developing the feature, it was found that resources containing lists are not being handled correctly. Previous implementation regarding lists in several ways: - In the list coe path, both item and wanted_item are expected to be lists. Python doesn't support to check for sublists using the "in" operand. - want_item basically contains the scenario dic, and item is each of the items available as resource of a given type. Thus, we want to check that item supports the subset of features requested by the scenario, ie. that the list in the scenario is a subset of the ones in the3 item and not the opposite. The following failing scenario is going to be checked during "make check" when the cipher attribute is added: BTS supporting cipher a50 and a51, and scenario requesting a50 succeeds. If this commit is remove, the test no longer passes, and it fails with: osmo_gsm_tester.resource.NoResourceExn: No matching resource available for bts = {'type': 'osmo-bts-sysmo', 'ciphers': ['a5 1']} Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d
2017-09-09modem: log property changes from Modem interfacePau Espin Pedrol1-0/+2
The purpose of this patch is to make sure we output to the extended log some information regarding the firwmare version of the modem being used, even if the test being run doesn't call print( explicitly. Printing just after waiting for Powered==true doesn't always work, because the properties are not populated after a while after. Calling Modem.GetProperties() immediately after receiving Powered==true, will provide with empty strings on properties such as Revision. 18:59:55.747412 bus /sierra_1: Setting Powered True 18:59:55.938889 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Powered=True 18:59:55.964694 bus /sierra_1: DBG: Powered == True 18:59:55.987777 bus /sierra_1: DBG: interface enabled: org.ofono.VoiceCallManager 18:59:56.006278 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=[] 18:59:56.027366 bus /sierra_1: Setting Online True 18:59:56.189991 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Manufacturer=Sierra Wireless, Incorporated 18:59:56.210935 bus /sierra_1: DBG: interface enabled: org.ofono.LocationReporting 18:59:56.233217 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=['gps'] 18:59:56.255807 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Model=MC7304 18:59:56.279374 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Online=True 18:59:56.315008 bus /sierra_1: DBG: Online == True 18:59:56.338779 bus /sierra_1: DBG: interface enabled: org.ofono.SimManager 18:59:56.357744 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=['sim', 'gps'] 18:59:56.379532 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Revision=SWI9X15C_06.03.32.04 r28324 CNSHZ-AR-BUILD 2015/05/25 01:09:15 18:59:56.401241 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Serial=356853054230919 Change-Id: If215c7d63ce1b86314ed25f8e76413b15676b7f5
2017-09-09modem: Include serial attribute in info()Pau Espin Pedrol1-1/+1
Change-Id: Ifd490942ecc8ecfd0f799ed241a53d45f5870b30
2017-09-07jenkins: properly clean previous artifactsNeels Hofmeyr1-1/+1
Drop the second 'rm -f' from the rm shell command (typo). Remove all artifacts matching *.build-*.{tgz,md5} because if a job changes the name of its artifact, the previous artifacts would remain. (I hit this with the new scripts being originally wrong and all producing 'osmo-msc.*' artifacts, and those stuck around in the workspace even after the name was fixed.) Change-Id: I00d246226f4c723696bb737ed707cfd0e4c33714
2017-09-07jenkins: build from new osmo-{msc,bsc,mgw,sgsn} repositoriesneels/testNeels Hofmeyr9-12/+67
The idea is to build each binary separately: even though osmo-msc requires libosmo-sccp, which already includes the osmo-stp binary, we still want osmo-stp to be built from a separate script. The reason: to track down regressions, we can change the versions each binary is built from separately. The additional build effort and jenkins script multitude is acceptable. Change-Id: I194ad5169dbe013c8e1cf9d631033cb2576744dd
2017-09-07jenkins-common: ensure requested binaries indeed have been builtNeels Hofmeyr1-0/+9
Recent change Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 drops binaries from a build artifact by leaving only explicitly requested ones. This adds a check that the requested ones indeed exist. Change-Id: Iceddeee6aebb1cdb54d7304495c3e332390261db
2017-09-05jenkins: per build, drop programs built "unintentionally"Neels Hofmeyr9-8/+24
Each of the jenkins-build-* scripts intends to build a specific set of programs. While compiling dependencies, other programs may end up in $prefix/bin. Drop those other binaries to reduce potential confusion. Add arguments to the create_bin_tgz function: callers need to list exactly the $prefix/bin/* binaries that should be tar'd. All others are first removed from the prefix. Adjust existing scripts to provide such binary names. Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45
2017-08-31contrib: Add scripts to build osmo-pcuPau Espin Pedrol2-0/+29
Change-Id: I90e7d2a79fb4ab7cc7fae5f3a1287a2e5bb748ab
2017-08-25default-suites.conf: Add suites to explicitly test with sysmoCell5000Pau Espin Pedrol1-0/+2
Change-Id: I6ff08a281c0c32148ca2c59f731d6550bf7b1c90
2017-08-25modem: Attempt fixing crash from Register() dbus methodPau Espin Pedrol1-2/+12
Register() method returned today this error which is expected acording to ofono documentation API. In this case it probably happens because the modem internally starts registering at some point between the time Scan() is finished and we call Register(). In this case it is fine for us and we should just ignore the error. A helper method is added to check for this as so far it seems tricky to check error information coming from pydbus. I could not reproduce this issue locally so I could not test that the helper function is going to handle it correctly when it is triggered. That's why I added extra debug information to be able to fix it next time it is triggered. File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/", line 489, in scan_cb_register dbus_op.Register() File "/usr/local/lib/python3.4/dist-packages/pydbus/", line 75, in __call__ 0, timeout_to_glib(timeout), None).unpack() GLib.Error: g-io-error-quark: GDBus.Error:org.ofono.Error.InProgress: Operation already in progress (36) Change-Id: I58dda09416ee7328812431220fd3d239c5c2980a
2017-08-24Introduce aoip_encryption suitePau Espin Pedrol5-0/+139
This suite aims testing different authentication and encryption setups. Change-Id: I5816ecc19a818e5b821fbc6272c9f37f9650ae10
2017-08-24schema: Remove uneeded TRX_REMOTE_IP validate typePau Espin Pedrol1-2/+0
Attribute trx_remote_ip is actually using IPv4 validate type, thus this validate type is not needed. Change-Id: Ia8e154ac5fe33932935ba049f08eb5af15195d99
2017-08-24Introduce auth_algo modem config attributePau Espin Pedrol6-5/+40
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-24bsc: Allow tests to select network encryptionPau Espin Pedrol1-0/+8
Nowadays encryption parameter in bsc needs to be set to the same cipher as the one specified in msc, otherwise the cipher negotation will fail. See OS#2461 for more information on the matter. Change-Id: I857b3860fb771b36fb3d587d4e92b320f0685a19
2017-08-23Add support for authentication VTY param in msc and bscPau Espin Pedrol4-0/+14
Change-Id: Ie1eb76149d4b006631050f8a1e532fbdbdad6a7f
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 Pedrol2-16/+12
Change-Id: I94a294c37f361a666064094455c9a1e1399fdfc7
2017-08-23nitb: Introduce subscriber_delete APIPau Espin Pedrol1-0/+17
Change-Id: I62829ed243857681bcc40a4a1861c5c583907f4b
2017-08-23nitb: ctrl: Remove unused return statement in subscriber_addPau Espin Pedrol1-1/+0
In case of failure an exception is raised. If everything goes well no need to return True. Change-Id: I5194eeb9208f973da12f2fa710f2b3e7acd78fb5
2017-08-23hlr: fill auc_2g table when registering a subscriberPau Espin Pedrol1-2/+11
Change-Id: I491d093934c129a01baa1c5d7ada4acf370bf37d
2017-08-23Add scenarios for each osmo-bts-trx typePau Espin Pedrol4-3/+11
This way we can run tests with a specific instance of an osmo-bts-trx, for instance we may want to run some tests with an Ettus B200 and also with a sysmoCell 5000. Change-Id: I5fd78d79b8bfab8ccacc4666563b66b6da9f2bde
2017-08-23bts_osmotrx: Support configuring bts addr, trx_remote_ip and launch_trxPau Espin Pedrol7-11/+49
We may want to support running a device which runs its own TRX (osmo-trx or different implementation). Furthermore, this TRX may be available in some specific hwardare rather than on the main unit. This makes it easy to configure OsmoBtsTrx to launch it's own osmo-trx or not. In case it is launched, all IPs are configured correctly to ensure connection can be established. Before this commit, osmo-trx was binding to Now we can support multiple osmo-trx being launched on the main unit. Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8
2017-08-23resources.conf: Remove empty linePau Espin Pedrol1-1/+0
Change-Id: I821bff68ce3a4a81a9deb79e6302bd7c341a8255
2017-08-23modem: Allow tests to change KIPau Espin Pedrol1-0/+6
This is useful for tests that wants to fake a bad KI to test if auth and encryption are working correctly. Change-Id: I40cfed6f6b9239eea2b97ffa010b98c78f0cb9cb
2017-08-23Allow tests to select network encryptionPau Espin Pedrol2-0/+18
Change-Id: I273eee44c095690d0c2e3994befa97edc42496ac
2017-08-23ctrl: Add dbg log to print received dataPau Espin Pedrol1-1/+3
This is useful to see for instance the returned values from NITB when asked for active subscribers. Change-Id: I5c616646da360457930888b54d9019b76f05fe2f
2017-08-21Increase log verbosity for osmo-bts-trxPau Espin Pedrol1-1/+2
The log levels changed are useful to understand clock failures we see from time to time in osmo-gsm-tester. See OS-2325. Change-Id: Id74af3ccb2f3db3c1793c7ff7b7a60a534e78e81
2017-08-21bts_osmotrx: Allow LD_LIBRARY_PATH when loading osmo-trxPau Espin Pedrol1-0/+2
When splitting osmo-trx to its own class the env injection part was removed because it seemed not needed as it has no dependencies included by default in the trial. However, it may still be required by the osmo-gsm-tester main unit to launch osmo-gsm-tester with LD_PRELOAD_PATH to point to specific versions of libuhd, so let's add the env injection back in there. Change-Id: I069ba69f4207665c8c575fed0fc8ff164c571e36
2017-08-18esme: Remove temporary workaround for non-implemented deliver_smPau Espin Pedrol1-3/+1
Openbsc has SMS Delivery Reports since recently, which means we are now receiving deliver_sm messages and this workaround introduced in commit db0d8ab4fcfac67e76729241d92ca128d4526240 is not required anymore. Closes OS-#2353. Change-Id: Iecf3983bfc24fec8023ba5d589c2d7620ec5d921
2017-08-18Split osmo-trx from osmo-bts-trxPau Espin Pedrol3-12/+50
In the future, some environments/products may come with a trx interface pre-installed. Start work to easily disable launching it. Change-Id: I556c3e2ba16753393c7e70800c533a18122daeaa
2017-08-17esme: user_message_referece values should be smaller than 256Pau Espin Pedrol1-1/+1
SMPP specs say message reference is 16 bits field. However, message reference field in GSM03.40 spec is only 8 bits. Change-Id: I52968a10089d14e0e3b0f9be678c261e3f92939c