Commit Graph

847 Commits

Author SHA1 Message Date
Pau Espin 9dbdb623a0 process: Log stdout tail when process exits with error
This is useful since remote processes we run under ssh end up merging
both remote stdout and sterr into local stdout.

Change-Id: Ibbfb099a667f21641075faa1858e0b9acd706fd2
2020-05-25 16:45:36 +02:00
Pau Espin 6f31de823e enb_srs: Use RemoteProcessSafeExit instead of RemoteProcess
It is known that sometimes srsENB hangs until it is killed -9, specially
when using ZMQ backend. Let's use RemoteProcessSafeExit in order to make
sure it is killed in an acceptable time (srs binaries use some
preventive sigalarm 6 seconds auto-kill procedure, hence we use 7
seconds) before next test is started and potentially try to re-use the
same ENB and fails due to previous one still running.

Change-Id: I905bd753c7822feccf1c1bb59752698f1d1b85f0
2020-05-25 16:12:09 +02:00
Pau Espin 0d64f16544 Replace RemoteProcessFixIgnoreSIGHUP with RemoteProcessSafeExit
The API was doing far more stuff than its name indicated. Even more
important stuff, like making sure the process is killed at the end with
-9 after ssh connection is dropped.

Change-Id: If043ecab509b34b0922824d73db916196274ec64
2020-05-25 15:52:59 +02:00
Pau Espin d84a8387be 4g: Pass max bitrate to iperf3
Otherwise bitrate 0 (unlimited) does weird stuff, like iperf3 hanging
forever in DL.

Change-Id: I631243cce132923d9024f8161cf96161c51cdae5
2020-05-25 14:23:39 +02:00
Pau Espin f4ab97fb4a iperf3: Support runing test with bidirectional data
Change-Id: Ia6f12c65fd3ea26d412997741cb8685a9646af43
2020-05-25 14:11:07 +02:00
Pau Espin 66ef9457cb config: suites_dir and scenarios_dir are now a list of paths
This allows inheriting suites or scenarios from eg. sysmocom/ dir, while
still allowing to apply new suites and scenarios on top.

Change-Id: Icecdae32d400a6b6da2ebf167c1c795f7a74ae96
2020-05-25 13:33:50 +02:00
Pau Espin 3a0dea682e iperf3: Support using configuring UDP protocol
Change-Id: I0b3545847b01ae3d029881f243fea276f0fa39de
2020-05-22 15:20:27 +02:00
Pau Espin d79e719804 schema: Allow objects registering their own schema types
Change-Id: I998c8674a55531909bfeac420064c3f238cea126
2020-05-21 15:41:14 +02:00
Pau Espin 27b609f4d3 ms_srs.py: Fix typos in comments
Change-Id: Iaa09ed696eb58e63c366f26e94c66f27b5f733bf
2020-05-21 13:21:56 +02:00
Pau Espin e972c9c524 config: Allow setting trial directory in main.conf
Change-Id: Ia4141001d084f690897dbdff5eae6c69ff2e521c
2020-05-12 16:27:33 +02:00
Pau Espin 6c6c0e8599 Cmdline arg -c sets main configuration file (old paths.conf) instead of dir containing it
It has been notified that current configuration system is difficult to
understand and to use, so it has been envisioned to refactor it a bit.
The idea is that the user passes a -c path/to/main.conf file, which in
turn contains whatever osmo-gsm-tester main settings supports (basically
what old paths.conf used to be, plus some files harcoded to the same -c
directory are now configurable through the main configuration file).

Change-Id: Ieca65b71b543c44cfcec8e83efd0fe053c432e55
2020-05-12 14:07:29 +02:00
Pau Espin 4e6b5077d0 Split Scenario class to its own file
Change-Id: Ia029de7ecda4c8dc3d0b4c412e4c9c0a65cf0185
2020-05-11 15:12:07 +02:00
Pau Espin b1d8d30526 esme: fix smpplib imports
smpplib modules are used in several places, so it's not enough to import
them in the constructor since they are only imported for the function
scope.

Change-Id: I6511e28c7ef6aa86e85a7e03aa10a67d87896588
2020-05-11 11:55:48 +02:00
Pau Espin 620d2ee5ba ms_srs: fix numpy import
numpy is used in a few places in the class code so we need to jhave it
available in a bigger scope, while still only loading when needed.

Change-Id: Iea66e623e1c980a62d691e20dacb00df99fdd78f
2020-05-11 11:52:14 +02:00
Pau Espin 2a2d846430 obj: Fix objects placing their content in suite rundir instead of test rundir
Change-Id: I421d35473575086b93d5c8db98b909cc6c83d896
2020-05-11 10:56:52 +02:00
Pau Espin 0bd048c620 osmo-gsm-tester.py: Update help description and remove old nope cmdline arg
Change-Id: I879a5c30c185905614c2c5a7d54eb33817c94c31
2020-05-07 19:38:37 +02:00
Pau Espin 06c82aee5c Deprecate envvar OSMO_GSM_TESTER_CONF and remove other ones
Environment variable OSMO_GSM_TESTER_CONF is marked as deprecated and an
error is logged each time it's used. Same feature is available through
"-c" command line parameters, so having the envvar only makes things
more complex for no good reason. It cannot yet be completely dropped
since some environemnt still make use of it. Give some time to users to
adapt their setups.
Other environment variables setting some config apths can be dropped
since they are not being really used in any setup.

Change-Id: I7eb69f870d0dcb5906d45ae067d6bed1aabf5862
2020-05-07 19:09:23 +02:00
Pau Espin 18ff1e6e25 ms_driver: Fix typos after recent refactorings
Change-Id: Id9709743648d60792ec64c97ab1bc6811c4e3e1e
2020-05-07 17:10:51 +02:00
Pau Espin 306373027a Allow suites to dynamically register schemas so tests can receive parameters
Change-Id: Idbe99a35993d193cd97059feb980e61ff14c67ad
2020-05-07 15:06:01 +00:00
Andre Puschmann d27b3ba2e2 srs_{enb,ue}: don't set sc12 as OTW format
Change-Id: I7fc20d998b082f5c37b2451f1900161f997954b1
2020-05-06 20:21:18 +00:00
Andre Puschmann 549826d424 enb: add rf_port to cell list param
we need to make the rf_port a param in the cell list because for CA with
two cells on different EARFNCs, the RF port is different

for two cells without CA on the same EARFCN the RF port is the same

so we need to be able to configure it

Change-Id: I32e83cc34811588757104c5ce1cae7277402addd
2020-05-06 20:21:18 +00:00
Pau Espin e0b899079c schema: Allow keys to start with a number
YAML allows it, and it will allow suites tarting with a number on its
name (like the '4g' one) to register its own schema on next commits.

Change-Id: I64e5a9d6604085d3b17eba30498a5e7a66242cc8
2020-05-06 17:14:46 +00:00
Pau Espin eaefe6b533 suites/4g: Introduce sample handover test
This test currently only works with AmarisoftENB and srsUE, because:
* srsENB has no handover support yet
* AmarisoftUE doesn't provide any known way to verify handovers.

As a result, it usually runs with following filters and modifiers:
amarisoftenb-rftype@uhd+srsue-rftype@uhd+mod-enb-ncells@2+mod-enb-meas-enable

The get_counter() API may change in the future based on information
available from other implementations.

Change-Id: I0dff4af7e3a89804a03842ad4a4d697bca3a9773
2020-05-06 16:24:53 +02:00
Pau Espin 0dd4c0be10 osmo-gsm-tester.py: Fix import error when using default-suites.conf
Recent commit refactoring stuff introduced an import error only
triggered when default-suites.conf is used (no -s param).
This commit fixes the issue.

Fixes: ea8c3d4b12
Change-Id: I1534cfba55c69ed5c1354175f8b5df9b656b7d82
2020-05-06 14:04:24 +02:00
Pau Espin a8b8990bb8 rfemu_amarisoftctrl: import websocket module on first use
Change-Id: I568af52ffb7ac57222697f5d861a532c0e2a70de
2020-05-05 18:26:31 +02:00
Pau Espin 326091555b powersupply_sispm: import sispm and usb modules on first use
Change-Id: I6045bb739e5c69972014a9d27be3a24b7ad61c9a
2020-05-05 18:26:31 +02:00
Pau Espin a1daa51665 ms_ofono: import pydbus and GLib modules on first use
Change-Id: I754e1290eb5593c0ef168f74747f42db1b50f16c
2020-05-05 18:26:31 +02:00
Pau Espin 45149393e7 esme: import smpplib module on first use
Change-Id: Icc92937fdada9210f788805dbc42b80014e345e8
2020-05-05 18:21:58 +02:00
Pau Espin cc89cd0c5f ms_srs: import numpy module on first use
Change-Id: I2ce974954028bdbc7bc1561c4538b909edee2cb1
2020-05-05 17:49:27 +02:00
Pau Espin 5b9c7b922a testenv: deferr importing obj module class until use is required
Change-Id: Ie073256a03bb2d038ef7f715d534afb1c53bb241
2020-05-05 14:40:58 +02:00
Pau Espin 40c7bc7765 tests: Replace 'suite' with 'tenv'
Change-Id: I777ec59ffd83b861ddc09e85e52d7a8896264b8c
2020-05-05 13:56:01 +02:00
Pau Espin a442cb8e5f Update obj classes in obj/ to use testenv instead of suite_run
Change-Id: Idf41243a497de7bc507b9f1cd1b38640f456f815
2020-05-05 13:56:01 +02:00
Pau Espin f574a46b37 Move trial.py and suite.py to core/
Change-Id: Ic9a4c90c190e9d8e1829fbef83a9243f3c6f655b
2020-05-05 12:23:37 +02:00
Pau Espin aa1cbdc75a Move all obj/ references in suite.py to testenv.py
Change-Id: If4ab39be7a97d33e82c5a34e2a10dfec38613a4e
2020-05-05 12:19:10 +02:00
Pau Espin ee217b0a18 Move test.py and report.py to core/
Change-Id: Ibb7fa5ab40bcf1e59705bdd2c2c5a76025b2b544
2020-05-04 19:23:16 +02:00
Pau Espin 06cb536826 Move resource.py to core/
Change-Id: I0f36a5e61ff0ef14d08165c9c184acdf2d6e6901
2020-05-04 19:12:07 +02:00
Pau Espin 1ee5ec5db2 Move object subclass instance allocation logic out of suite.py/resource.py
This way we get rid of object related content in resource.py and we can
finally move it to core/ in next commit.

Change-Id: Ia5b861115ae3ae1b90149863c4265dcc730b8cd4
2020-05-04 17:22:53 +02:00
Pau Espin ea8c3d4b12 Generate schemas dynamically from pieces provided by each object class
This way we benefit from:
* knowing which attributes are used/required by each object class and
  subclass
* Having validation function definitions near the class going to use them

Change-Id: I8fd6773c51d19405a585977af4ed72cad2b21db1
2020-05-04 16:36:33 +02:00
Andre Puschmann 96b17df282 srsenb_rr.conf.tmpl: extend CQI and SR subframe scheduling
this fixes an issues when allocating CQI resources for multiple carriers
or multiple users

Change-Id: I8b9345502003da2f5b6841a98b77375656e84d8c
2020-04-21 15:05:51 +02:00
Andre Puschmann 333b868492 ms_srs: fix ZMQ radio arguments for CA and MIMO configs
similar to the eNB patches this fixes the CA and MIMO radio
parameters. In pricinple this could also be reused for the
AmarisoftUE but since we currently don't have a means to test
it I left it for a future commit.

Change-Id: I16b00009f97d61a9ab4715e5d727024661d3d0be
2020-04-21 15:05:51 +02:00
Andre Puschmann e2a6da6b48 enb: refactored rf_args handling for ZMQ-based radio
this patch moves the rf_dev_args creation for both eNB types
into the eNB base class, since they are identical.

the patch also fixes the arguments for all CA and MIMO configurations

Change-Id: I8ca3ed83e65dc07927385267e5970bc4f5b120d5
2020-04-21 15:05:51 +02:00
Andre Puschmann bf40f8c8bf amarisoft_enb: use two antenna ports for TM > 1
Change-Id: Ia241f96341780760d482d389097659b0f7b897e8
2020-04-21 15:05:51 +02:00
Pau Espin d6c792536f amarisoftENB: Fix running with num_cells=2
The B200 device being used in the physical setup doesn't support several
RF ports, so let's hardcode it to 0 for now.

Change-Id: Id4c31be2bd0c75f469e2293ade011c7b7ceedb1c
2020-04-20 18:21:11 +02:00
Pau Espin 96d64efdbb srsenb: Support neighbour and secondary cell lists in config file
Change-Id: I8fe0703b7d9db69658c112066404d2da1c3d1e09
2020-04-20 18:21:11 +02:00
Pau Espin 6c77874f46 enb: Introduce support for neighbour cell list
Change-Id: If604f1f2643a73f8c4da6ae3e9d24cd6c7e52d06
2020-04-20 18:21:11 +02:00
Pau Espin 154dc93219 AmarisoftENB: Support setting PCI value
Change-Id: Ibffb95f9b55e145d76ba64119a73ef9f1ed7cdef
2020-04-20 18:21:11 +02:00
Pau Espin a6d6304afc srsue, amarisoft/srsENB: Support setting rx/tx_gain attributes
Change-Id: I4228ba8746a54db4c17443718c01069d431361b9
2020-04-20 16:10:57 +02:00
Pau Espin 491f77cd0f enb: Add attribute to set 'id'
Change-Id: I8ce296c7875d557062dc13e7093ce0400050f2ce
2020-04-20 16:10:57 +02:00
Pau Espin d4404d54c0 enb: Implement initial RF emulation API
Two implementations are provided:
* Amarisoft Ctrl interface (websocket)
* Mini-Circuits Programmable Attenuator (HW, HTTP API) [1]

in Amarisoft ENBs, if no rfemu is configured explicitly, the Ctrl
interface one is used by default, while still being possible to use the
HW one.

[1] https://www.minicircuits.com/pdfs/RC4DAT-6G-60.pdf

Change-Id: Ie98a3fb9bcd2b87b96ecbb5b79e0f53981892a32
2020-04-20 13:30:27 +02:00
Pau Espin ca89bb3924 srsenb_rr.conf.tmpl: Fix whitespace
Change-Id: Ic2b4d8e2468984b096a870c878fa5d032ea4130f
2020-04-20 12:16:53 +02:00
Pau Espin a65b505adc powersupply.py: Fix import module line typo
Recent commit changed the import line so it runs only when required, but
added a typo making tests uing it fail.

Change-Id: Id3e5c16adc763a9b79cc464937c541abd15f98de
Fixes: 2b959580b9
2020-04-19 18:56:43 +02:00
Pau Espin f46ae22b3d enb: Add cell_list attribute
It allows configuring each cell_list up to a maximum of 'num_cells'.

Change-Id: I4fd30a3e37789b76bfaddc2beba1815154daab7f
2020-04-17 20:08:28 +02:00
Pau Espin 045245d5ae check_dependencies: Import modules dynamically and find related debian packages
This way we don't need to manually add new imports here or drop unusued
ones. It also makes sure local imports in all our py files is correct.
For instance, running the script already caught an issue which is added
to this patch (osmo_ms_driver/__main__.py).

This new version of the script also allows specifying subsets of
features to skip when checking for dependencies. This way, for instance
somebody not willing to use a sispm powersupply can stil check all the
needed dependencies are fine.

This new tool will make it easier to slowly make some dependencies only
used by some object test classes optional (for instance, python-smpplib
if user doesn't want to run an ESME node).

It also allows to retrieve the required debian/manually installed
packages when run with "-p" option:
"""
Debian packages:
        libpython3.5-minimal:amd64
        python3-gi
        python3-six
        libpython3.5-stdlib:amd64
        python3-pygments
        python3-yaml
        python3-mako
        python3-numpy
        python3-markupsafe

Modules without debian package (pip or setuptools?):
        usb                  [dpkg-query: no path found matching pattern /usr/local/lib/python3.5/dist-packages/usb/_interop.py]
        pydbus               [dpkg-query: no path found matching pattern /usr/local/lib/python3.5/dist-packages/pydbus/proxy.py]
        smpplib              [dpkg-query: no path found matching pattern /usr/local/lib/python3.5/dist-packages/smpplib/command_codes.py]
        sispm                [dpkg-query: no path found matching pattern /usr/local/lib/python3.5/dist-packages/sispm/__init__.py]
"""

Change-Id: I29ddf8971837754abd930d847bd1036e8e510de6
2020-04-17 19:44:24 +02:00
Pau Espin 2b959580b9 powersupply: Import sublcass module only if used
This way we avoid unconditionally importing all subclass dependencies,
and make them optional based on whether the setup has devices of that
type or not.

Change-Id: I0d2f8b26364b45f0d837cc51078784d1d0fa7ea1
2020-04-17 16:53:17 +02:00
Andre Puschmann 4b5a09a83c enb: add optional gtp_bind_addr paramter to enb class
this allows to optionally specify a the GTP bind_address for a enb object
in the resources.conf

this address is then used for binding the listening socket for gtp connections
which, in turn, allows to run the enb and epc on the same host.

when gtp_bind_addr is not specified, addr is used by default

this is especially useful if eNB and EPC run on the same host
and ZMQ is used for RF between eNB and UE. Two eNB addresses
are needed in this case, one bind address and one "remote-accessable"
address for the UEs ZMQ radio to connect to

Change-Id: I4fe38f31401428ed3e74e1d0b64960f0af122d37
2020-04-16 22:03:09 +02:00
Pau Espin 0e6ab424a4 ms_srs.py: Pass filenames to main cfg file template instead of cmdline args
Change-Id: Id2a6ba17d087d2ff67fe10b1dae6434259e74366
2020-04-16 15:41:31 +02:00
Pau Espin 3373703a72 epc_srs.py: Pass filenames to main cfg file template instead of cmdline args
Change-Id: I1ac3a3cace7ec2b0f85c5d9a5f97d5007d7c65ac
2020-04-16 13:59:57 +02:00
Pau Espin 135c609d29 enb_srs.py: Pass filenames to main cfg file template instead of cmdline args
Change-Id: Ifec6a8a9c29b94634f6ac7ea50aae9b8e18ae3cb
2020-04-16 13:44:37 +02:00
Andre Puschmann e4d5a139e3 enb_amarisoft: fix enb conf template name
issue has been introduced during refactor of enb class names

Change-Id: Ib3ad6451c3979440be28d8811f51ce5d1c103518
2020-04-14 22:23:06 +02:00
Pau Espin fdd8e3aad2 iperf3: Avoid using --logfile arg
Some older iperf3 versions don't support the --logfile arg. Let's
instead parse the json from stdout. Old --logfile behavior is left in
code but disabled since it's a nicer (less hacky) way to get results,
because parsing from stdout means we need to avoid reading some content.

Change-Id: Ia1b7fa4dae074089878963aeddf0006aea68e31f
2020-04-14 12:50:23 +02:00
Pau Espin 0dbd694501 Rename modem.py to ms_ofono.py
Change-Id: I050970986b0b3fbc23b756c5b7c524cb8b7c1327
2020-04-11 19:15:56 +02:00
Pau Espin e1a58bd8dd Move object classes used by tests into obj/ subdir
Change-Id: I0b2963cf00acd1f9036dca2e87aa3b87a0f8066d
2020-04-11 19:15:56 +02:00
Pau Espin e8bbcbf5b8 Create core directory to contain most of code not in object classes used by tests
Change-Id: I9aec6c55ccd71894182057d36e0025b69925d314
2020-04-11 19:15:53 +02:00
Pau Espin 9b486eedb6 Rename object classes to be {obj_class}_{implementation}
Change-Id: Ieafd96d7ee5b4baef08ca767629b93834f6a8c7c
2020-04-10 19:41:06 +02:00
Pau Espin bd552f9786 bts_oc2g: Fix ready_for_pcu() waiting forever
Change-Id: Id33e527591164b87d1e14b7922247b726267ad6e
2020-04-10 02:20:57 +02:00
Pau Espin 19155245a4 bts_oc2g: Fix missing import remote
Change-Id: I318683b8dc6215f5bf863cfb1581e2c3bfa05621
2020-04-10 02:09:22 +02:00
Pau Espin ce82b038c7 pcu_{sysmo,oc2g}: Inherit from pcu abstract class
For some reason these classes were still not inheriting from the base
class (probably because it was added after they existed) and they
started failing after recent changes which presumed they where already
inheriting.

Change-Id: I88217baf490ec45373d0743585377ed2639a8cfd
2020-04-10 01:59:48 +02:00
Pau Espin 23e60e5b37 amarisoft_ue: Implement data plane
Use the ifup script to set up the netns + configure the tun device
created by lteue. Use it also as a hook to know when the UE is attached.
Since tun setup is done by arch-optimized lte-avx(2) binaries, we also
need to give capabilitites to them (instead of allowing inheritance of
caps in general in the setcap script).

Change-Id: I1e228b1296eac8e4cb183c2faa735b0468abe124
2020-04-08 15:16:52 +02:00
Pau Espin 6b8f5ae3d2 srs/amarisoft{ue,enb}: Fix b200 specific rf_dev_args
Commit 12ae6d79a5 switched the rf_dev_type
to be in lowercase but forgot to change these conditions.

Change-Id: I91d3877381b4e6343dc4aa0465e699341ed6648d
2020-04-07 18:51:59 +02:00
Andre Puschmann d97ab42462 amarisoft_ue: fix UHD support
the Amarisoft UE seems to be only working with UHD when the bandwidth
param is provided. It seems the set_bandwidth() API is used.

Change-Id: I3f20a5a8ca80c63374f0ad500fd2794e2dc45479
2020-04-07 18:38:21 +02:00
Pau Espin 29b7132eb8 pcu: Enable 'egprs only' vty option if egprs requested
Change-Id: Idd0b5bf8769d693480268c0a0b89dbfd63779e48
2020-04-07 16:12:47 +00:00
Andre Puschmann a7f1983658 enb: add measurement modifier to scenario files
this commit adds basic support for configuring measurements in the
eNB config. It currently support A1, A2, and A3 events.
By default UE measurements are turned off and need to be enabled by
configuring an event with:

+mod-enb-meas-event@{name},{report_type},{value},{hysterisis},{time to trigger}

For example one can update the a2 and a3 event with:

+mod-enb-meas-event@a2,rsrq,-40,2,480+mod-enb-meas-event@a3,rsrp,6,1,512

Change-Id: Ia7657be2396886840570bc41645450a268b4cfff
2020-04-07 17:23:37 +02:00
Andre Puschmann 9a5be2c8fd amarisoftue.cfg.tmpl: fix UE bandwidth/rate config and power on automatically
Change-Id: I2d63055d0648a1758905fd277c20edaeec8f9b85
2020-04-07 15:09:24 +00:00
Pau Espin 65beb8f324 amarisoftUE: adding basic support for Amarisoft UE
Change-Id: Idda0d3a040663969dd71781814198b47fff7daf3
2020-04-07 15:09:24 +00:00
Pau Espin 3edc29cab1 templates: Improve cs7 config in osmo-{bsc,msc}
Change-Id: I0aa0057c85e606d45e67d01b818db7549033bdbd
2020-04-06 17:52:22 +02:00
Pau Espin ba213a3067 pcu: Improve logging and gsmtap
Change-Id: I506a39b114eed55a185d329cea5e9d6ba379a2ae
2020-04-06 17:33:33 +02:00
Andre Puschmann 65e769f034 srsue.conf.tmpl: fix the configuration of UE params for carrier aggregation
the num_carriers is parsed as a string in the conf dict and therefore
needs to converted to int before matching

also changed the num_carriers to be of type UINT

Change-Id: I1386812d32e1181ba666720bbb875bf9bbce0f51
2020-04-06 13:44:45 +00:00
Andre Puschmann a0e69aa698 amarisoft_enb: add handling of num_cells modifier
the num_cells modifier allows to create multiple cells in a single enb
both cells are by default configured for CA

Change-Id: Ie9f16ce06ee56002c01097f2d338278f09ea4337
2020-04-06 13:44:45 +00:00
Andre Puschmann a70f05cd9a amarisoft_rf_driver_temp: fix tx time offset for ZMQ driver
Change-Id: Icee282837e62e02a17b93efba4c22756efa2a5d3
2020-04-06 13:44:45 +00:00
Pau Espin d45a29e694 amarisoft_enb: Support zmq rf_driver
Change-Id: I958834d99584e33f632b839a0bd0acccc2379049
2020-04-06 13:44:45 +00:00
Pau Espin 04ad3b5fb4 epc: Replace rlc_drb_mode with qci attribute
Change-Id: I21b7d7009f9b0df8ec4f59189a65cfc26f164f04
2020-04-06 13:17:28 +00:00
Pau Espin eae9c90d17 Add modem resource features attributes: 2g, 3g, 4g
This allows selecting modem by supported network type. It will allow
using 4G modems with type different than srsue in 4g suite in the future.

Change-Id: I38bcf6abf789f52c3ed0bee7911567fa872e2491
2020-04-03 18:56:01 +02:00
Pau Espin 214f15e5ee amarisoft_enb: Add missing default values in constructor
Change-Id: I61c04df14468b38cfe4afaaeb5404367838ff0a9
2020-04-03 16:56:12 +02:00
Pau Espin 17253af1e9 Introduce contrib/jenkins-build-amarisoft.sh
Prepares inst tgz archives to be consumed by osmo-gsm-tester from
Amarisoft prebuilt binaries.

Change-Id: I372606fc5ff9f6bb3ef848f2fe229b83382ddc09
2020-04-03 15:49:00 +02:00
Pau Espin 76b2c2a108 srs_{ue,enb}: Add modifier to pass arbitrary cmd line arguments
Change-Id: Ie438c8aa9992dbc61b2133473a83d565cf5c7056
2020-04-01 20:06:33 +02:00
Pau Espin 20a49112e9 config.py: Allow escaping commas in parametrized scenario names
comma character ',' is used in the command line to split between
parameters, which means a parameter value itself couldn't contain it.
This commit allows passing a comma inside a character value by escaping
it with '\,'.

Change-Id: Ic0bd9a029137a59e8c4a32b807eba7a64fcfa51f
2020-04-01 20:06:33 +02:00
Pau Espin 12ae6d79a5 srs{enb,ue}: Use lowcase UHD as rf_type string
Older versions of srsLTe.git required passing UHD in caps to the conf
file, but that's not the case anymore. Let's use lowcase then.

Change-Id: If8a289ba110229d31b62b0d3adc1ae97324e6d27
2020-04-01 18:06:17 +00:00
Andre Puschmann 4d35ea2b33 srsenb_rr.conf.temp: patch scheduler variables for 6 PRB cells
Change-Id: Ifdab42da8184cdf8367c5be1639a0faea3e68db1
2020-04-01 15:35:36 +02:00
Andre Puschmann 2dcc4312a0 iperf3: add config to adjust the duration of the iperf run
the time is passed as a string param and is then converted
into seconds when literals "h" or "m" are found.
So it would accept 2m and would convert it to 120s, for example.

Example:

+cfg-iperf3-time@15+

Change-Id: Iff28816f83670751e9e91de31ec59b1b0ad8fc0d
2020-04-01 15:35:03 +02:00
Pau Espin c04528cb1f Make amarisoft license server optional
* Since license_server_addr logic is generic among all amarisoft
  software, let's move it to its own config category "amarisoft", which
  all amarisoft classes (amarisoft_{enb,epc}.py as of now) will import
  during configure().
* The license server is disabled by default (value 0.0.0.0) since the
  usual case is to have a license in the local system.
* the license server can be enabled using scenario
  cfg-amarisoft-license@A.B.C.D where A.B.C.D is the address to use.

Change-Id: Id5456ad9497e91370857b80ff9a389111d3611ff
2020-04-01 15:22:14 +02:00
Andre Puschmann 7225d52e39 srs_{ue,enb}: change UHD stream args and buffer size as function of cell width for B2XX
Change-Id: I2de0526ee9bd2f7bb75c7d529b3f52d75117c5cc
2020-04-01 14:38:06 +02:00
Pau Espin da2e31f929 Introduce support for AmarisoftEPC
* A new abstract generic base class EPC is created
* srsEPC and AmarisoftEPC inherit from that class
* options are loaded from defaults.conf in cascade. First generic "epc",
  afterwards the specific enb type.
* A new scenario is added to select the EPC type to use. srsEPC is the
  default unless stated by an scenario.
* AmarisoftEPC delegates setup of the tun IP address to an "ifup"
  script. As a result, since we run without root permissions (ony with
  CAP_NET_ADMIN), the ifup script itself is unablet o set the IP
  address. To solve this, we introduce a new osmo-gsm-tester helper
  script which must be installed in the slave node which can be called
  through sudo to increase privileges to do so.

With this commit, I can already get srsUE<->amarisoftENB<->amarisoftEPC
to pass ping and iperf3 4g tests.

Change-Id: Ia50ea6a74b63b2d688c8d683aea11416ad40a6d3
2020-03-31 19:18:18 +02:00
Pau Espin 55e278c758 amarisoft_enb: Drop unused lib variable
Change-Id: Iea3e77a4b9f25f2781f617cd4bfd0ba4b34c709e
2020-03-31 13:35:48 +02:00
Pau Espin e44e76a787 {srs,amarisoft}enb:Move shared code to parent generic class eNodeB
Change-Id: Ica0f1d4179a905d6dfc77d3e8eb08ac6cd5c3d2e
2020-03-31 12:35:19 +02:00
Pau Espin 9aa932fd11 srsue: start_locally(): Fix missing class name in attribute access
Change-Id: Iab4196b12ee12a06ba2129053f2291c1e4c284ff
2020-03-31 12:03:38 +02:00
Pau Espin f4cce26173 srsenb: No need to generates values dict for every template file
Let's only do all the dictionary processing once and not for each
template file.

Change-Id: I4684d26375fce1e2ae28d3eccdc4f607fa5411a9
2020-03-31 10:49:49 +02:00
Pau Espin 874130510d srsenb: start_locally(): Fix missing class name in attribute access
Change-Id: I5e11dc9c3c0dcf4808a3ad67fe96580480fe47d1
2020-03-31 10:46:18 +02:00
Pau Espin 786a6bcd20 Introduce initial Amarisoft ENB support
* object class expects the amarisoft software to be placed in directory
  provided by env var AMARISOFT_PATH_ENB. On local runs, it will run the
  software from there. On remote runs it will copy over that directory to
  the slave.
* Configuration provided works with 6 PRBs, but probably won't work for
  other values (yet).
* ZMQ support not yet available, only UHD.

One can select the Amarisoft ENB by declaring it in resources.conf:
"""
- label: AmarisoftENB-B200
  type: amarisoftenb
  rf_dev_type: uhd
  rf_dev_args: "type=b200,serial=317B9FE,recv_frame_size=9232,send_frame_size=9232"
  remote_user: jenkins
  addr: 10.12.1.206
"""

And running:
"""
$ export AMARISOFT_PATH_ENB=/path/to/binaries
$ osmo-gsm-tester.py ... -s 4g:amarisoftenb-rftype@uhd+srsue-rftype@UHD+mod-enb-nprb@6 -t ping
"""

Change-Id: I1ddf4962ea6438ad977382ab201b724028ca46b3
2020-03-31 08:22:18 +00:00
Andre Puschmann 54f25cabc5 srs_ue: remove hard-coded num phy thread param
Change-Id: Ia4fac188ecbe6aba393a68ec0291b51cd1441029
2020-03-24 17:33:55 +01:00
Andre Puschmann 4ae614dbef srs_enb: remove num_cells getter
Change-Id: Ic5c45bb17440d2ee241840591baf02930a0b3470
2020-03-24 16:40:29 +01:00
Andre Puschmann a0782d5df9 srs_enb: remove unneeded enb parameters
Change-Id: I1f2e18c6552fc4a6e3a68d75a85744fadf26aacb
2020-03-24 16:40:10 +01:00
Andre Puschmann c2c8221c12 srs_enb: enable console trace, use RemoteProcess class
In order for the console trace to work over SSH this commit
switches to use the default RemoteProcess class. Note that srsENB
now correctly handles the SIGHUP signal.

Change-Id: I26391eb8409e14b34987e0b338e10613fa157e06
2020-03-24 16:39:35 +01:00
Andre Puschmann 3ffea80ae8 srs_{enb,ue}: add secondary cell and set dl/ul freq in eNB/UE config accordingly
Change-Id: I3730856003fffda4f3c3f9e835d62ddc312c4c31
2020-03-24 14:30:19 +01:00
Andre Puschmann d61613ac80 srs_ue: adding num_carriers paramter and corresponding modifier
this allows to configure a UE to support multiple carriers

Change-Id: I4fa0a0c6e52efb17aa0b07e55abb5470d8028e8b
2020-03-24 14:30:19 +01:00
Andre Puschmann 82b88901f3 srs_enb: add num_cells param to srsENB
this is needed to support the upcoming multi-cell feature in srsENB.
It's required for carrier aggregation (CA) but can also
be used for (currently) two independent 4G cells.

This commit adds baseline support for the parameter. Upcoming
commits will add hooks to configure the cell's EARFCN, etc.

Change-Id: I6d1658bf820163aee03b64b0f4ac68046c243f37
2020-03-24 14:30:19 +01:00
Andre Puschmann 22ec00a01f ms: add optional param to specify fixed APN IP address assigned to a MS
this allows to specify a fixed APN address for each subscriber in the
HLR. If the param is not provided in the resources config, the default
allocation type is used, which is to dynamically allocate an IP in the
supported range.

Change-Id: Ie6fcd7987dc7bc62a686bee3a10c67e3dd813419
2020-03-24 14:30:19 +01:00
Andre Puschmann 35234f2e21 srs_ue: add scenario for airplane mode simulation in srsUE
Change-Id: I5db2ff325ce4b4236c1ceec0831dd7420d52dedb
2020-03-23 21:00:36 +01:00
Andre Puschmann bf960ec0cc srs{enb,ue}.conf.tmpl: make sure to only use a single PHY thread when running with ZMQ
Change-Id: Icc1e67705c0354ece77c037f224a9c756a16daaa
2020-03-23 21:00:36 +01:00
Andre Puschmann cfdcf89515 srs_ue: run srsUE as normal RemoteProcess
running with RemoteProcessFixIgnoreSIGHUP was needed bc
srsUE used to ignore SIGHUP that is delivered to the process
when the SSH session is terminated causing the UE to not
quit properly. This isn't the case anymore so we can use
RemoteProcess for spawning the UE.

Furthermore, the wrapper script didn't pass along stdin
to it's child process, i.e., srsUE. Therefore the console
trace can't be seen if the run through the wrapper.

Change-Id: Iab4dafc58167620362a36ec9e904b8d49a7d5fc1
2020-03-23 18:54:15 +01:00
Andre Puschmann 2e8626f9be srs_ue: send t+Enter to stdin after launching app
this enables the console trace which is printed to stdout
and provides human readable radio statistics

Change-Id: If1c998aff1c5c11d3fa636fb60cb4991e0def768
2020-03-23 18:54:15 +01:00
Andre Puschmann 66272f8ac8 process: add stdin_write method to communicate with child on stdin
Change-Id: I3e5d843911998bb50726d93e3dfd3de584dc81a5
2020-03-23 18:54:15 +01:00
Andre Puschmann e227fa3b13 fix lookup table for maximum DL/UL rate for srsENB
Change-Id: Ieb027eaf5d8f4d774d0e29207f7a3b75dec6ee5b
2020-03-21 21:45:29 +01:00
Andre Puschmann b778707767 srsenb.conf.tmpl: update to new version
Change-Id: I204d03307aaaddcb15fed6f7310b64d09c43f64c
2020-03-21 21:45:29 +01:00
Pau Espin 1e81b5af9a srs{ue,enb,epc}: Disable pcap by default, allow enabling by param
Take the change to fix several small things and support recording pcap
in srsENB.

pcap generation can be enabled with scenario cfg-srs-enable-pcap.

Change-Id: Ia096a9be7efb2123f95115c751e2402fb4fec935
2020-03-16 13:47:30 +01:00
Pau Espin 990b520b1f osmo_ms_driver: Store cfg files and logs in correct test rundir
This way all the content is available as an artifact when we run it
inside osmo-gsm-tester.

Change-Id: I3ab493e6aafef90bb0c5d98e552840fd11c43079
2020-03-12 18:04:15 +01:00
Pau Espin e10970d626 Drop wrong vty cfg line ms-power-control
Those two BTS backends never had their own MS Power Control Loop, so
they should be using the "osmo" common one. This wrong value "dsp" used
to be accepted for no good reason, but it's no longer the case. Let's
remove the line to let the backend take the default one (osmo).

Change-Id: I842fce2b8185c53d1684747afcfc3ae8fba1afee
2020-03-12 16:13:23 +01:00
Pau Espin 66a38917f4 Move RESOURCES_CONF from resource.py to config.py
This way we have all known config file names in one place, in the module
containing the implementation to retrieve them
(config.read_config_file()).

Change-Id: I8304dda70268b16dbc316af882fecdbf20ac25ec
2020-03-11 20:15:13 +01:00
Pau Espin a2e81f5e19 config.py: use var to hold defaults.conf string
This way we have all config file names together in same place.

Change-Id: If35739f21f1414efdaba71acbb60661213ac58df
2020-03-11 20:15:07 +01:00
Pau Espin 5b31cc358c srsue: Use logfile instead of stdout
newer srsLTE has fixes to exit properly after 3 seconds and then flush the log file.

Change-Id: I9801ce932ad08b7fbb6d14a66e1dba64d4af38f7
2020-03-09 18:48:47 +01:00
Pau Espin 7f37deb020 srsenb_sib.conf: Fix warning about wrong prach_freq_offset value
WARNING: Invalid PRACH configuration - prach=(2, 8) does not fit into the eNB PRBs=(0, 6).
       Consider changing the "prach_freq_offset" value to 0 in the sib.conf file when using 6 PRBs.

Change-Id: Ie4374faca62a4d0289f78674eadec7eb5d045dfd
2020-03-09 18:36:44 +01:00
Pau Espin f796ad0061 srsue,srsenb: Configure num_ports for tmode > 1
Change-Id: I35d8ee907738845e729f58c23f377a42bb665672
2020-03-09 18:36:44 +01:00
Pau Espin b9aeb156fe srsepc: Update log file output matching
New version of srsEPC improved the information logged during S1 setup
request, which we use to wait for the ENB to be connected.

Change-Id: Ia2338e3161c66ef7c1ab50b024a70de661edc780
2020-03-09 15:06:48 +01:00
Pau Espin d2e5aa58fb srsenb: Update config files
Latest ENB config file grammar changed and needs to be updated to work
with next versions of srsENB.

Change-Id: I84db30dc57ea9e0b05208fa86d88d42d492b237f
2020-03-09 11:40:53 +01:00
Pau Espin 2bcd346203 suites/4g/ping.py: Overwrite test stdout with ping output
Change-Id: I83403a21c46758132b4fbb930000df67d8650016
2020-03-09 10:15:39 +01:00
Pau Espin 02e8a8d4e1 Improve junit xml generated fields
* trial ('testsuites' node): Add fields 'tests', 'errors', 'failures',
  'time'.
* testsuite: Add fields 'errors', 'failures', 'skipped',
  'disabled'
* test: Add field 'classname' (empty).

Fix and improve suite.py and test.py to count errors, skipped, failures
properly.

Change-Id: Ie2d10cee88a9c0d829e4620553164cf3150e8e5c
2020-03-09 10:15:39 +01:00
Pau Espin a5f7bef0a2 remote: Set debug logfile of ssh_sigkiller.sh to /dev/null
Otherwise processes run eventually as root (due to being run on another
netns) may change its permissions and other processes later will fail to
write to it (Permission Denied).

Change-Id: Ide092db082937be7c2fb16d60e099c85dc1941b7
2020-03-05 17:26:22 +01:00
Pau Espin 644cb41b05 Allow overwriting test's report stdout text from inside test code
Change-Id: Ie1c0ecf7464209a4241665025fda33ae624fc049
2020-03-04 16:14:31 +01:00
Pau Espin 151b08a410 srsue: Introduce metrics verification procedures
Change-Id: Ib1da58615cdc4f53ac1a27080e94e5b47760c508
2020-03-04 13:56:25 +01:00
Pau Espin 085a17e8e0 iperf3: Support setting run time
Change-Id: I93e857bd682c733c3ba36234b9bf1e1cc85eddef
2020-03-02 18:14:31 +01:00
Pau Espin 905e503cb9 iperf3: Support configuring data direction (dl vs ul)
Change-Id: I6b5b740beac22015c952ce826c034031ad4c4465
2020-03-02 15:45:08 +01:00
Pau Espin 2aeadeb58d srsue,srsenb: Fix zmq base_rate calculation and share value
Change-Id: I3e7817e822fb4d1f8bc9ef798162edf95a74d442
2020-03-02 11:56:51 +01:00
Pau Espin dcf99edf53 srsue: Enable pcap through config file
Change-Id: I15219d707aea778fefa8911362278442fa09550c
2020-03-02 11:10:50 +01:00
Pau Espin a031995762 srsue: Enable metrics csv file generation
Change-Id: I393afc49f553d9ebda29717c27d5eb907b3c5b60
2020-03-02 11:06:51 +01:00
Pau Espin a337695cd0 srsue: Remove old comment not longer applying
Change-Id: I1718dbb701c5dcd5a4081d3d91ae9f192418e7df
2020-03-02 11:04:03 +01:00
Pau Espin 3f088da9b2 junit: Replace invalid xml characters
Otherwise junit parser in jenkins fails:
org.dom4j.DocumentException: Error on line 20231 of document  : An invalid XML character (Unicode: 0x1b) was found in the element content of the document.

Fixes: 5bbdab8d95
Change-Id: Ia629e43bba01e50fd718c16404a7796d4f4e3713
2020-03-02 10:51:40 +01:00
Pau Espin b69377112c Introduce LTE Transmission Mode and RLC DRB mode params
Change-Id: I38f247f266ba736cdbb6f36ba5673b8fd46a8d67
2020-02-27 18:14:24 +01:00
Pau Espin 6ed301259a Introduce parametrized scenario files support
The idea is to have something similar to systemd template unit files:
https://fedoramagazine.org/systemd-template-unit-files/

Specially for modifiers, one finds the situation where same scenario structure
has to be created with lots of different values.
For instance, let's say we want to test with different eNodeB num_prb values:
[6, 15, 25, 50, 75,100]
Right now we'd need to create one scenario file for each of them, for instance:
mod-enb-nprb6.conf
mod-enb-nprb15.conf
mod-enb-nprb25.conf
mod-enb-nprb50.conf
mod-enb-nprb75.conf
mod-enb-nprb100.conf

And each of them containing something like (changing the num_prb value):
"""
modifiers:
  enb:
  - num_prb: 75
"""

Instead, we can now have one unique file mod-enb-nprb@.conf:
"""
modifiers:
  enb:
  - num_prb: ${param1}
"""
The general syntax is: "scenario-name@param1,param2,param3".
So "@" splits between scenario name and parameter list, and "," splits
between parameters.

For instance, one can now run following suite with scenario:
"4g:srsenb-rftype-uhd+srsue-rftype-uhd+mod-enb-nprb@75"

Related: OS#4424
Change-Id: Icfcba15b937225aa4b1f322a8005fcd57db1d1ca
2020-02-27 17:16:47 +01:00
Pau Espin 1deb1ae0bc enb: Add modifiers for num_prb
Change-Id: I0b8c834f1c67cc4bf4d07d03358ba2012331cbde
2020-02-27 15:37:08 +01:00
Pau Espin 6c42bb584b srs_enb: Make num_prb a config parameter
Change-Id: I336e71f53556596050cf3eb55a7810a009dbf7a8
2020-02-27 15:05:11 +01:00
Pau Espin 5bbdab8d95 Add test log to junit output
Change-Id: Ieb5566a41ecf3a9512db579eb37e8d8ed5325057
2020-02-24 18:30:58 +01:00
Pau Espin 69b2cf3ce2 srsue: Create netns on demand
Already existing script osmo-gsm-tester_netns_setup.sh is modified to
support only creating the entns without moving an iface to it.

Change-Id: I1b7e186b0146f932fe37fbea68e4dfa3120b7a74
2020-02-24 10:59:05 +01:00
Pau Espin 666d6c8236 remote: Fix comment typo
Change-Id: Ie466a95d354dc8c9d6960f713948426dadc58241
2020-02-24 10:41:58 +01:00
Pau Espin a9a2fe2ad3 srsLTE: Support configuring different RF backends
Before this patch, only virtual RF through ZeroMQ was supported.
This patch allows configuring srsUE and srsENB to use a real SDR with
UHD/SoapySDR backend connected through a physical RF network, while
still keeping compatibility to run on virtual RF ZeroMQ network, based
on the resources used (controlled by scenarios). For instance, one can
first run a suite through the phyisical RF (using 2 UHD-controlled SDRs)
and afterwards with ZeroMQ using the following default-suites.conf:

- 4g:srsenb-rftype-uhd+srsue-rftype-uhd
- 4g:srsenb-rftype-zmq+srsue-rftype-zmq

Change-Id: I7dbbe328f4c0225fe74e878bb2da13fe39ccf049
2020-02-20 15:54:33 +01:00
Pau Espin 9c383287e6 iperf3: Fix netns param not used
Change-Id: I2768ec0c6d2cbfc8411382a983e1ba17cb5f097e
2020-02-20 14:33:05 +01:00
Pau Espin 7691f2d027 config: Fix reading empty yaml default-suites.conf
during config.read(), on empty file yaml.safe_load() returns None, which
was then later converted to string "None" by _standardize(), and
osmo-gsm-tester.py was not catching "not combination_strs" condition.

Change-Id: I07d7daab8f8f4238db140f0a0311f3d1d41e6cb0
2020-02-18 12:12:03 +01:00
Pau Espin c8b0f9359e Initial srsLTE support
2 tests (iperf3, ping) working against a full srs{UE,ENB,EPC} network
using ZeroMQ backend for RF (so no real RF support yet, that will come
next).

Related: OS##4295, OS#4296

Change-Id: I290c0d79258a9f94f00c7ff2e1c6c5579c0e32f4
2020-02-13 18:07:18 +01:00
Pau Espin 873dee391d powersupply_intellinet: Log target ip+dev_port
Change-Id: Iafd6e3aaf1d3b4d91ac6cf06f2a7fe94fd1203c3
2020-02-12 17:56:30 +01:00
Pau Espin 4983eb5367 Fix remote and process RemoteNetNSProcess
Change-Id: Icdc917968a1310e287dd98994420519a605be9c0
2020-02-11 19:16:26 +01:00
Pau Espin c852ad8813 iperf3: Support running iperf3 remotely
The new RunNode class is used and ip_address support will be dropped
eventually, replaced by the former.

Change-Id: Ib803d7774cb502c7d07443d7720a7b013684faa8
2020-02-11 17:46:52 +01:00
Pau Espin 7346472e5a util: Add helper setcap_netsys_admin()
This API was already added for RemoteHost but forgot to add it too for
local systems. It will be used by srsue once support for it is added.

Change-Id: I734e910af90fd25bed27c24b60346064b5fde67e
2020-02-11 17:46:52 +01:00
Pau Espin 116a2c45fe Inroduce RunNode class
This class will be used to hold information for a run node, that is, a
target system or environment were a process or task is run.
It superseeds in functionality the old ip_address resource, which will
eventually be droped in favor of RunNode.

Change-Id: I647bedf116aa9a570d925a5281c9491c9032e343
2020-02-11 17:45:50 +01:00
Pau Espin 7381e820a1 remote: Add more helpers to operate on remote hosts
Change-Id: I034314839675038762e00750b069eee8fcb70a5c
2020-02-11 14:41:09 +01:00
Pau Espin 180adfc3a6 remote: Improve wrapper script handling proper exit of ssh-remote processes
Improvements include:
* Avoid race condition between receiving signal and process not yet
  started
* Make sure process is killed with -9 if process is still alive a while after
  we killed it (SIGINT, SIGTERM). This is useful for processes which
  sometimes hang during shutdown like srsue in some conditions.

Change-Id: I3c656b008a3c2b2bb453a59e51d338cb272fa50b
2020-02-11 14:39:36 +01:00
Pau Espin 14022d31b0 Add handlers to run process under a specific netns on a remote host
It will be used later to run iiperf3-cli connected to srsue on another host.

Change-Id: I8d223fc302df42446f5876ba020cfbea94be09b9
2020-02-11 14:39:28 +01:00
Pau Espin f6d45adb05 Allow passing remote env to process running in remote host
Change-Id: Icc0ae8d79ca30ed0a289b67546735251fc46cb10
2020-02-11 14:39:15 +01:00
Pau Espin 2eafb03195 Introduce RemoteHost and refactor code to use it
Let's move code related to coping stuff to remote hosts and managing
remote processes under a class where relevant information is stored.
This simplifies parameters being passed all over and allows to reuse
more code.

Change-Id: Ifff5ded8fdb28e8ef267cebe6c5f30a910cae11a
2020-02-06 13:58:51 +00:00
Pau Espin dd71022af7 bts_osmotrx: Add support to run osmo-trx on LimeNet-micro
bts_osmotrx will check if target host can run the inst, and otherwise
run osmo-trx-lms already present in the system (installed by other
means). This way same class can be used both ways, since the only real
difference between the 2 scenarios is:
* copying inst vs not copying it.
* Running binary from inst vs running it from PATH.

This commit does not provide a mechanism to make sure the osmo-trx or its
dependencies are up-to-date in the target system. A solution for that
will be provided separately.

Related: SYS#4663
Change-Id: I6bd76f6d7e0cb2b6f7bdde971b6515846048a341
2019-11-26 14:33:11 +01:00
Pau Espin abf837d326 process: Allow passing no local inst to copy_inst_ssh
This will be useful in the event a user wants to run a binary already
available in the target which needs no copying, but still requires the
non-binary related items to be copied and set up, such as config files,
directory structure, etc.
This option will be used to run osmo-trx-lms in LimeNetMicro already
installed from an OBS repo, since cross-compiling all related
dependencies would require a lot of work to do now.

Change-Id: I6b0f2a19e493c7ac911c5db0ea08f5c0ab936d74
2019-11-26 14:28:33 +01:00
Pau Espin 12c5ea4a24 process: Return proc in function helpers
Caller may want to access the proc object after running the process, for
instance to check return code or inspect its stdout/stderr logs.

Change-Id: I60a18dcf699ebeaced951f7d5ff188f573772282
2019-11-26 14:25:35 +01:00
Pau Espin c18c5b82ca bts_osmotrx: Allow Setting Rx/TX paths through resources.conf
Change-Id: Iddb0f20366c3242098bdf869f39fc3e2244c13e7
2019-11-26 14:24:24 +01:00
Pau Espin 5eae2c50b0 Add a per-test log file
This way there's no need to go over hours of logging in the main log to
find information of a failing test.

Change-Id: I8cb79c7855e0bc14282d6728841e92ba22699eed
2019-09-18 18:57:11 +02:00
Pau Espin 7e1ee5044b Revert "resources.conf.prod: Use different ARFCN for sysmocell-5k"
This reverts commit 91199a3137.

Since we now support powercycling the SC5, we don't longer need to use a
different ARFCN for it.

Change-Id: Ie8b49c556c90b4a97a73695a93ac4108660a217f
2019-09-10 16:45:35 +02:00
Pau Espin 55cee160b0 Support SC5 power cycling through powersupply
* Add powersupply related code to bts_osmotrx.py to power cycle the
board.
* Each time the board is started, we need to unlock the RF (start TRX
implementation).

Change-Id: I8a1428c1ff90c9f5b42d7ffe86a6fc763819cba2
2019-09-10 16:45:35 +02:00
Pau Espin dd7bb2ca2d process: Introduce respawn_sync() method
Change-Id: Ifd1f553d9bead78bf1659f6c778c1b70888ba433
2019-09-10 13:44:39 +02:00
Pau Espin 922ce5ad31 process: respawn(): return process result
Change-Id: Ic6b57b8d0c2993a40ba39b87f45c7a524a8ca440
2019-09-10 13:44:20 +02:00
Pau Espin f11c4eea6d bts-trx: Improve logging and trap SIGTERM in ssh_sigkiller.sh
Trapping SIGTERM is done in order to get extra logging about that event.

Related: OS#4151
Change-Id: I2c7649dee8f5ecdaa08274806ccd8948d197ffdb
2019-08-14 12:32:25 +02:00
Pau Espin c93707ff6c bts-trx: Drop deprecated -t parameter
Parameter was dropped a while ago in osmo-bts, since it's calculated
dynamically from VTY config. So let's drop it to avoid a deprecation
warning message in osmo-bts log file.

Change-Id: Ia17a2528e091d4691c511732ed251e472d1270eb
2019-08-05 21:00:30 +02:00
Pau Espin 91199a3137 resources.conf.prod: Use different ARFCN for sysmocell-5k
Due to a bug in sysmocell-5K's TRX implementation, it may keep polluting
the air transmitting after the BTS is disconnected. This could cause
interferences with other tests. Correct fix would be to RF lock it after
test finishes (through ccli), but let's simply use a different ARFCN for
now.

Related: OS#4129
Change-Id: I6d5555aa8740b262ee92110987189c076db44f76
2019-07-26 11:47:43 +00:00
Pau Espin 0cde25f1d9 Introduce and use osmo-bts-trx VTY cmd max_trxd_version on sysmocell-5K
Force TRXDv0 when using sysmocell-5k as a TRX, since its implementation
(different than osmo-trx) doesn't support higher versions. Furthermore,
it will crash upon receival of SETFORMAT string. By forcing maximum TRXD
version to 0, osmo-bts-trx won't sent any SETFORMAT message since 0 is
the initial version to use.

Depends: osmo-bts.git I5eb1fdc002f9d7f4acf475356d8fc998dc8f6326
Related: OS#4006
Change-Id: Ic95c38d91dba354ae64c5edbfcea3fbbf34a7de3
2019-07-24 20:53:03 +02:00
Pau Espin b5f37ff935 tests: voice: Add voice call test with Osmux enabled
Change-Id: Ie4f360a77f6fcbc74f140a7fcb5feef2d94ac734
2019-06-19 18:57:13 +02:00
Pau Espin fed578e873 Introduce osmux support for msc,bsc,mgw
Change-Id: Ief3518e77650f2cddb48357b07fe95346e46ee1b
2019-06-19 17:37:07 +02:00
Holger Hans Peter Freyther dbb16e869e virtual: Make mass tests be able to activate themselves
We will need to enable/disable generation of lua script code
depending on the subscriber and mass test.

Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558
2019-05-08 05:16:27 +01:00
Holger Hans Peter Freyther 2e7e84358e virtual: Make it possible to add tests to the ms driver
Introduce an Executor that forwards all testcase related methods to
a list of testcases. Allow to instantiate them by name and use the
result to access the statistics.

Change-Id: Ia65ee53987e92b24e6b8c40e1376bc74dc260180
2019-05-08 05:16:18 +01:00
Holger Hans Peter Freyther 75c9cc75ea virtual: Introduce a base class for test cases
Introduce a base class with the intended life cycle and use it.

Change-Id: I97968fb02436d5ac8248fc8020539e1af547b030
2019-05-04 13:50:49 +01:00
Holger Hans Peter Freyther f16a8f7aaf virtual: Move the starter code into the starter module
There is nothing location update specific in the file. Let's move
it into the starter file.

Change-Id: I0cd5705eaf53a14523feacece9446331a53b3e59
2019-05-04 13:49:45 +01:00
Holger Hans Peter Freyther 92cc0c9b69 virtual: Separate starting virtphy/mobile from the test
Move the starting code out of the Update Location "test". In the mid
term we can have a SMS test run in addition to waiting the Update
Location tests.

A mass-test testcase will have a life-cycle of:

 * Creation
 * Configure (number of subscribers, probably all subs)
 * Pre-Start trigger (same as configure so it can be omitted)
 * Post-Start (all processes run)
 * Query if the test has completed

The next step is an actual implementation to send SMS.

Change-Id: Ie15f5123775d11dd44243b2741d047ed93f318f9
2019-04-30 22:11:31 +01:00
Holger Hans Peter Freyther 41cd68146d ms_driver: Catch up with the new MS baseclass
Change-Id: Id8de8b3ee76b515c49e5ea52acaa326a2283b0e1
2019-04-30 10:54:48 +01:00
Holger Hans Peter Freyther 61f28773bf virtual: Have a single result class that can store data
We want to have LU, SMS and other tests run at the same time. Begin
by creating a single result where testcases can store additional data.

Move the stats code into the UL test case handling and out of the
suite.

Change-Id: Ie99351bee1515de8cf6870467f08256a53701907
2019-04-28 15:53:24 +01:00
Holger Hans Peter Freyther e524f2ca59 virtual: Unify the lua script into a single one
In the quest to support multiple testcases we will use a single
script. Parts can be enabled/disabled depending on which tests
we want/need to run.

Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6
2019-04-28 15:51:58 +01:00
Pau Espin fcc04f88dd powersupply: Add support for Intellinet PDU
Based on original pdutool code from Joachim Steiger.

Change-Id: Iab4f7aec1c50f47da4cd734441bb36fa09d171a3
2019-04-12 17:02:10 +02:00
Pau Espin f0cbe0599b Revert "modem: workaround ofono crash"
We already updated our ofono branch to current master (after 1.28),
and this fix is not longer required, as stated in ticket OS#3064.

Related: OS#3064
This reverts commit f8d12196f0.

Change-Id: I884f6d4f3df4f3b4e2ac05e4dba2ad8704697521
2019-04-08 21:09:44 +02:00
Pau Espin 3a479c212d processes: Fix kill of processes run under sudo
sudo drops forwarding of signals sent by processes of the same
process group, which means by default will drop signals from
parent and children processes. By moving it to another group, we
will later be able to kill it.
Note: sudo documentation is wrong, since it states it only drops
signals from children.

See following link for more information:
https://stackoverflow.com/questions/34337840/cant-terminate-a-sudo-process-created-with-python-in-ubuntu-15-10

Change-Id: I25990234aaa496c501ff45ad7f7fd549d6f188da
2019-04-05 20:12:12 +02:00
Pau Espin 0409655e64 process: Early return during process termination if no proc running
This avoids extra unneeded logging about killing with signal when
actually no signal is being sent.

Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198
2019-04-04 17:48:30 +02:00
Pau Espin 806aae8830 suite: Make _processes an empty list during init time
It simplifies the code because we don't need to check if it is a list or
not.

Change-Id: I634901a1f4ba3a6b7294666012ea679ae148ff08
2019-04-04 17:44:37 +02:00
Pau Espin 4c8cd7b9a5 modem: Move modem iface to its netns before using it
We used to do that once after ofono startup for all iface
(modem-netns-setup.py), but then if a modem crashes the interface is
re-created on the default netns, and tests fail until manual re-run of
modem-netns-setup.py.

This way now we always make sure the iface is moved to the expected
netns before it is used.

Related: OS#3881
Change-Id: I506309c424aa46684c4516a1a0217343ecbf32c6
2019-04-04 16:10:14 +02:00
Pau Espin b27827b7bc util: use launch_sync API instead of manual wait
The API is available so no need to manually craft all steps in there.

Change-Id: I4afedb185f6e864929155981e8a2ec2df90110c3
2019-04-04 15:59:10 +02:00
Pau Espin e159cd206d process: Prevent NetNSProcess alive forever after SIGKILL
NetNSProcess are run in the following process tree:
osmo-gsm-tester -> sudo -> bash (osmo-gsm-tester_netns_exec.sh) ->
tcpdump.

Lots of osmo-gsm-tester_netns_exec.sh scripts with tcpdump child process
were spotted in prod setup of osmo-gsm-tester. Apparently that happens
because sometimes tcpdump doesn't get killed in time with SIGTERM and
SIGINT, and as a result SIGKILL is sent by osmo-gsm-tester as usual
termination procedure. When SIGKILL is sent, the parent sudo process is
instantly killed without possibility to forward the signal to its
children, leaving the bash script and tcpdump alive.

In order to fix it, catch SIGKILL for this process class and send
instead SIGUSR1. Then, modify the script under sudo to handle SIGUSR1 as
if it was a SIGKILL towards its children to make sure child process in
the netns terminates.

Change-Id: I2bf389c47bbbd75f46af413e7ba897be5be386e1
2019-04-03 17:53:57 +02:00
Pau Espin 17a4ed9029 process: add signal to NetNSProcess kill path
This allows to easily differentiate different calls to kill in order to
terminate the process when looking at the logs.

Change-Id: Ida88f2674b0ed1802f20c519aa4e3cbe81e0def8
2019-04-03 17:10:33 +02:00
Pau Espin feb66e714a Integrate osmo-{bts,pcu}-oc2g
Change-Id: I446e27039f75e63c2870d751c190a4fd76947000
2019-03-27 13:50:41 +01:00
Holger Hans Peter Freyther 337141fc1b nitb_netreg_mass: Add code to declare a run successful/failure
Change-Id: If26047f0635db8c7209af143fbd1da4c9b2312d1
2019-03-07 10:05:48 +00:00
Holger Hans Peter Freyther 5e67ed467c nitb_netreg_mass: Allow a suite to configure num subscriber
Remove hardcoded configuration and replace it with a reservation in
the suite.

Change-Id: Ic9fd560c2924731e4fd6eea5aaf3ad565cb4ef52
2019-03-07 09:40:42 +00:00
Holger Hans Peter Freyther 10501ccc8e resource: Add a mobile resource for the virtual test
Add a new resource and make a reservation in the suite.

Change-Id: Ic26aa63cad62323bb85f952640672eb28af0eadc
2019-03-07 09:39:39 +00:00
Pau Espin e02158fd16 Log signals from VoiceCall dbus objects
Change-Id: I0def02b9063f75ec32c8b9382bdb12d65e1fb9eb
2019-03-05 20:29:19 +01:00
Holger Hans Peter Freyther 48c83a8939 resource: Introduce a base class for the modem
Extract IMSI, KI and authentication algorithm into a base class.

Change-Id: Id547cdcc241a307a2ea59b5fbac6b8d7a9d95639
2019-03-05 13:19:41 +00:00
Holger Hans Peter Freyther 7424301034 resource: Use a factory to initiate a modem
Change-Id: I4baa791c92196cda477b2d969d4f67dfbe1152af
2019-03-05 09:46:57 +00:00
Holger Freyther 44128f91d2 Revert "nitb_netreg_mass: Add code to declare a run successful/failure"
This reverts commit b4ad8d7243.

Reason for revert: There was a true dependency on earlier changes (len(mobiles)). Rollback until the resource configuration is merged.

Change-Id: If0f5e24cec2f0d1d144b464180b341cacbdf0ebb
2019-03-05 09:44:37 +00:00
Holger Hans Peter Freyther 54b4fa928e process: Make killing processes non-sequential
Change-Id: Icf1ac6774ea11880542012fd6c6ac73302bb74f5
2019-03-05 03:53:10 +00:00
Holger Hans Peter Freyther b4ad8d7243 nitb_netreg_mass: Add code to declare a run successful/failure
Change-Id: I49a821e8e4656466259e519ef901726cbb76ef86
2019-03-05 03:07:41 +00:00
Holger Hans Peter Freyther 93a89424d0 resource: Introduce a type attribute to the resource definition
Change-Id: Ie1fd10ec878311b7347118badb1b9dce5b49e976
2019-03-05 02:52:44 +00:00
Holger Hans Peter Freyther 0d714c976d process: Make sending signals (kill) externally visible
Change-Id: I87bba8a8c467ba5936e0b6604d8abb9432e5e7a8
2019-03-04 06:53:51 +00:00
Holger Hans Peter Freyther 20b52c1ee3 process: Speed-up terminating lots of processes by batching it
Introduce a strategy to terminate processes and begin with an
implementation for parallel (that has no degree of parallelism
right now).

Change-Id: I7dd4a7e26aca758198aa08a434eaf5f3f5af632d
2019-03-04 06:53:51 +00:00
Holger Hans Peter Freyther f922a998cb pyflakes: Rename local variable to not shadow import
Change-Id: Ib70130dbbeeeb9813eaea707bf66f1db91088b92
2019-02-27 08:09:21 +00:00
Holger Hans Peter Freyther 1ea4e52f9f pyflakes: Remove occurrences of using undefined variables
Mention the attribute right away and remove a method that looks
to have been broken (more vs. more_rules).

Change-Id: Iba18a96ff804780e66c69b459e112f9d42b7b2ff
2019-02-27 08:09:21 +00:00
Holger Hans Peter Freyther 34dce0edb1 pyflakes: Remove assigned but unread variables
Change-Id: Ie257ac051739ea6f846d1aac2c8f778638b5f8a6
2019-02-27 08:09:21 +00:00
Holger Hans Peter Freyther 91067239c1 pyflakes: Remove imports of unused modules
Change-Id: I7496030e5857078cd66a36a5e46c9a50217ce6e3
2019-02-27 08:09:17 +00:00
Holger Hans Peter Freyther 77d6d55e90 ms_driver: Rename method to hopefully be more clear
This is finding min/max in a dataset. Call it like this and update
the caller.

Change-Id: Ic7f5cd34639f897e460ca1edcb4f9b6df44683e9
2019-02-23 15:44:37 +00:00
Holger Hans Peter Freyther ae0dae821c modem: Do not connect to the systembus until a modem is in use
In case of the "virtual" tests we:

* Don't use ofono based modems (they are physical for now).
* Run in an environment that doesn't naturally run a dbus-daemon

Modify the code to memoize the bus by hand.

Change-Id: Ieae4bf819903402f7f715eb489e0a96ed59dc3f8
2019-02-20 20:38:46 +00:00
Pau Espin 4d7f7709d5 modem: Log once dbus returns call was answered
Change-Id: Ia277b2eecdbf9969d77a688638837f9d9e1a44b6
2019-02-13 19:30:38 +01:00
Pau Espin 32e9d8c26e modem: print call ID during log of call state
Change-Id: I33d0153b3e89aa1924129b8068ef068c08059958
2019-02-13 17:40:31 +01:00
Holger Hans Peter Freyther 82feeff1c5 mobile: Switch from removed cli option to vty port
Bind the mobile's to a random (chosen by the kernel) VTY port. The
CLI option was removed and I added a new VTY command to be able to
specify the port in addition to the address.


Change-Id: Ie40a2ba156ba5674d37a15eb30e5b2527e75fbe7
2018-12-30 12:31:29 +00:00
Holger Hans Peter Freyther d2db10d80e ms_driver: Add a virtual bts and make use of it
It's very close to the osmo-bts-trx but without osmo-trx. Modify
the suite to make use of this BTS.

Change-Id: I9f5a2501eb4473ccf2287c902ee207c6a45a1bc5
2018-12-13 10:17:02 +00:00
Holger Hans Peter Freyther d51c2ea58d md_driver: Store the virtphy unix sockets in the temp directory
Storing them inside the testrun directory will most likely violate
the file length limit of the AF_UNIX files. This has happened on
the jenkins test run and can not be mitigated by picking shorter
paths in the code. We are already storing the event server in a
tmp directory and can add subdirs+files there.

Change-Id: I9ba4cd5c3e220ec10fc7c3160d7211daa821358f
2018-12-04 09:29:14 +00:00
Holger Hans Peter Freyther 6bf882260a ms_driver: Do the existance check with the path
Change the existance test to use the full path and not just the
binary name.

Change-Id: Ibe28514df03efb7c302ac30411761a8d1a6dcf5d
2018-12-04 09:29:14 +00:00
Holger Hans Peter Freyther 51ae2b5f5c Fix and use the right member variable
Change-Id: Ib5d50322ecd30c7724eef8452d22845450e9c633
2018-12-02 16:09:37 +00:00
Pau Espin 14e3e50b6e nanobts: Use -G parameter of ipaccess-config to avoid need to restart nanoBTS
If OML IP doesn't need to be changed because it's the one already
configured, then there's no need to set + restart the nanoBTS, which
means we can speed up a test running a nanoBTS by aprox 2 minutes per
nanoBTS used.

Requires osmo-bsc.git 5c2485dcff35996fce328798351af79c0ff4474c, which
fixes json generation in ipaccess-config after -G -q was implemented.

Related: OS#3624
Change-Id: I2871dee3de11512250445127f0b807a8990fd4c6
2018-11-29 17:14:44 +01:00
Holger Hans Peter Freyther bdc18d97e1 ms_driver: Consult the suite to get the binaries
Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
2018-11-24 12:09:12 +00:00
Holger Hans Peter Freyther 792614f12b ms_driver: use the util.Dir and create one dir per instance
Change-Id: Ie0f2fe99f6a6640606eb4e69fb1a2d22eae9b2c8
2018-11-24 12:07:52 +00:00
Pau Espin 9ea9c65b39 templates: bsc/nitb: Remove explicit no force-combined-si
It's always been the default anyway, so no need to explicitly state it.
Furthermore, recently (osmobsc 167cb828665b91ed7d28007abd4a1862ebbb78c9)
force-combined-si was enabled by default for nanoBTS due to issues with
some MS not registering when it's not enabled, so let's osmo-bsc decide
were should it be enabled.

Related: OS#3063
Change-Id: I97b10406a4a0048c66a47aa7d32a113f0c0366d1
2018-11-21 20:23:09 +01:00
Pau Espin 0fc74370b0 tests: iperf3: Support testing parallel iperf3 clients in test
Since tests running a single MS and several of them are really similar,
generic code handling the test for N concurrent iperf3 sessions is
writen an moved to testlib, and existing and new test use that code.

Change-Id: I57799fde49e6845379cca332eec0a1f70aaecd2b
2018-11-19 09:40:24 +00:00
Pau Espin 0df6317d1f iperf3: implement str() method in iperf3 server
This way it can be logged easily during test runs.

Change-Id: I699f0a9a8d263ac9f02ea9594a28ca9fd8d48db6
2018-11-19 09:40:24 +00:00
Pau Espin cf6a360efe iperf3: Allow changing port of iperf3 server
This way several servers can run sharing same IP address.

default port variable is moved inside class to be available to tests.

Change-Id: Id4eae7cefbb1a18ecf2676f9cb22c60cc91cec7c
2018-11-19 09:40:24 +00:00
Holger Hans Peter Freyther f743afb669 ms_driver: Switch to process.Process from subprocess
Use a single tmp/rundir for all these instances. In the next step
we can create separate directories.

Change-Id: Icf4d4e161ac4283a63ed4e0745b375e7e6a25004
2018-11-14 21:03:54 +00:00
Holger Hans Peter Freyther f658b83b07 ms_driver: Allow to specify env and binary name/path
For the proper trial/suite integration we can't assume that the
virtphy/mobile are in the PATH and that they can be executed
directly (e.g. need a LD_LIBRARY_PATH to be applied).

Introduce BinaryOptions to pass the name/path of the two executables
and the env to use. Default this to virtphy/mobile and an empty
environment.

Change-Id: I79a57e53bc20613ac061453c24fd29a6d05e1721
2018-11-14 21:03:23 +00:00
Pau Espin b656432701 templates: osmo-pcu-sysmo: Set log level from dbg to info
Otherwise there's too much output. With debug enabled, iperf3 test from
gprs testsuite generates a 111MB osmo-pcu.log.

Change-Id: I687361f3d6ede9a77531cd71204b1b07e0d1af42
2018-11-14 12:43:41 +01:00
Pau Espin c977547ea1 templates: osmo-pcu: Set log level from dbg to info
Otherwise there's too much output. With debug enabled, iperf3 test from
gprs testsuite generates a 96MB osmo-pcu.log. With log level set to
info, size drops to 1.4M, which is a lot less after compressing in an
archive.

Change-Id: I008234024b9369db42c90ef5d59a013fd2d22718
2018-11-13 13:32:59 +00:00
Pau Espin 1444f55643 nanobts: ipacces-config: Use process.launch_sync helper
Change-Id: I986ba81d766240d4f11c079d90b126bf96d776b9
2018-11-12 18:23:34 +01:00
Pau Espin 78087beaa9 process: launch_sync: allow non success return
Change-Id: I0617335b594ba565cf2e5ffd0edfb8bffa398c48
2018-11-12 18:21:21 +01:00
Pau Espin 79df739c07 process: Move standalone run_local_sync as method of Process
Change-Id: Ib2b3fd39db5400a93a8caabae367dac3e3250247
2018-11-12 18:15:30 +01:00
Pau Espin 64f0b1b114 iperf3: Fix parsing of incorrect json from iperf3
Change-Id: I759d99857c17de061e6d7c1ae1c38f6b15172131
2018-11-12 09:14:19 +00:00
Pau Espin 8cfa10f01d osmo-trx: Add support for dev-args cfg parameter
Change-Id: I3cff225e378e187779bf2b0c7d65bd6b97217104
2018-11-09 13:34:18 +00:00
Holger Hans Peter Freyther 799fe6286b ms_driver: Fix subject in the header
Change-Id: I47e688b9fe3aef6679e3c82c641393ab041cbec3
2018-11-07 03:50:33 +00:00
Holger Hans Peter Freyther b5e86b7e11 ms_driver: Use terminate not kill and initialize in ctor
Change-Id: Ib0102569cfb64a2f85ff33b93dd4ffc8ec59171b
2018-11-06 13:17:49 +00:00
Holger Hans Peter Freyther d6d3206b0a ms_driver: Initialize event_server_sk_tmp_dir in ctor
Change-Id: I9f39a25f292262cf335df371f434995e58c9ae93
2018-11-06 13:15:59 +00:00
Pau Espin 4f23ab58ad Add support to enable EGPRS
Change-Id: I682f0c1b4cb97b704d646f18f54e748baaefd677
2018-10-31 09:59:45 +01:00
Pau Espin 8a72586835 Introduce iperf3 testing infrastructure
Change-Id: I6ff6bef14feb535d98ca41b9788700d699e1ef1e
2018-10-31 09:59:45 +01:00
Pau Espin 772b2b14bb pcap_recorder: Add support to run in netns
Change-Id: Ie1c848254f221f26c59e7f4bd8c079fe3e7bdfc2
2018-10-31 09:59:02 +01:00
Pau Espin fd4c144049 Add support to test gprs IPv4 data plane
Since the modem iface and the GGSN iface are on the same host/netns,
it's really difficult to conveniently test data plane without getting
routing loops. As a result, either GGSN or modem iface must be moved to
a different namespace. The decision after a few discussions was finally
to move modem interfaces to a different netns.

Expected setup:
* ofono is patched to avoid removing modem if it detects
through udev that its net iface was removed (due to for instance, net
iface being moved to another netns and thus not being reachable anymore
by systemd-udev process running in root netns).
* After ofono is started (and successfully configured all the modems and
detected its net ifaces through syfs/udev), script "modem-netns-setup.py
start" which creates a netns for each modem, naming it after its usb
path ID. net ifaces for that modem are moved into its netns.
* Modem is configured to use 802-3 data format, and as a result the net
iface is configured through DHCP (DHCP req only replied AFTER pdp ctx is
activated!).
* Since osmo-gsm-tester knowns the modem USB path ID (available in
resources.conf), it can run required steps (ifup, DHCP) to configure the
interface. The interface name is provided by ofono to osmo-gsm-tester.
* As a result, any process willing to transmit data through the modem
must be in the modem netns.

Related: OS#2308
Change-Id: Icb06bdfcdd37c797be95ab5addb28da2d9f6681c
2018-10-31 09:59:02 +01:00
Holger Hans Peter Freyther b484aab683 Create a "ms_driver" stub for the testsuite
All config parameters are hardcoded for now and it should push
subscribers into the test (which should be a base class but not
a specific test).

Change-Id: I586b6d532c6e6395b4e6f2cf2128372237d05a7d
2018-10-30 21:28:43 +00:00
Holger Hans Peter Freyther b697b3bb86 Always initialize the _started in the test
We don't know at which state the termiation routine will be
called and it is best to have a fully initialized object. In
prepare we start with a fresh list just to be sure.

Change-Id: I675772c89e32620da5695aa4793b735cc266684c
2018-10-30 21:26:20 +00:00
Pau Espin 8aca1f37d6 process: Make sure sync process is terminated if ogt is stopped
Change-Id: Iecdac96ea576a312be2a6c6b6799e249074687ef
2018-10-26 10:24:59 +00:00
Holger Hans Peter Freyther d03acdf38a First round of clean-ups of imports and unused variables
Run pyflakes src/osmo_gsm_tester and then address the first
round of problems.

Change-Id: I02f1d89078dfdf37d53e2e20811bf36fb14ec3b0
2018-10-25 16:26:49 +00:00
Pau Espin f6166144b5 ttcn3: Support running tests without PCU socket avail
Change-Id: I902af460b798ffdba09d77d457bac672db606368
2018-10-15 17:55:12 +02:00
Pau Espin e789f0c088 osmo-bts-trx: Add support for osmo-trx-lms
Change-Id: I44db0fe4592109ecb665e1880806d90379da64f7
2018-10-10 09:39:58 +00:00
Pau Espin 16abefb35c bsc: Record RSL traffic in case rsl_ip and oml_ip differs
This change allows recording all interesting traffic for TTCN3 tests,
having GSMTAP and RSL together, because osmo-bsc is configured to pass
the RSL IP of the TTCN3 testsuite emulating a BSC.

Change-Id: I6bd1d1bec8e7b698d12aa886acc21d92532d9e6c
2018-10-09 18:55:30 +02:00
Pau Espin cef9c0dee8 Drop unused sysmobts-mgr.cfg.tmpl
Change-Id: I09632a6b4d3a431f1699d00843b9d7ee257a8b4c
2018-10-03 14:56:32 +02:00
Pau Espin 1b11c5916c templates: Update .cfg files to use logging level set-all
VTY cmd "logging level all" is deprecated in favour of "logging level
set-all", but the required behaviour in this case is "logging level
set-all".

Change-Id: Ice54fca6be86f05a02ce4ae783e6e42e6958b95d
2018-10-03 14:56:32 +02:00
Pau Espin 1ff03766be osmo-trx: Enable multi_arfcn for B200 and only in multiTRX setup
Change-Id: I6a29e1813f0603b00b49b7b7c805be23a72cf0e3
2018-10-02 15:58:32 +02:00
Pau Espin f2e5972ffc bts_osmo: Only check for socket path in ready_for_pcu()
Previous implementation was done due to osmo-pcu dying if failed to
connect to not-yet prepared BTS. This is no longer the case, so we can
start osmo-pcu as soon as the socket exists.

Change-Id: I3aa6bef0c4893bdcac668002ca018af019f666a3
2018-10-02 14:55:50 +02:00
Pau Espin 302c7563ef osmotrx: Make sure remote process stops after ssh session is closed
First of all, it was found that vty allocation must be forced (-t -t)
during ssh session creation to make sure SIGHUP is forwarded when
session is closed.

Second, since osmo-trx ignores SIGHUP (osmo_init_ignore_signals()), we
must add a wrapper script which converts received SIGHUP into a SIGINT
to stop osmo-trx.

Change-Id: Ic334a54b1a1827d74fe0b453ac32bb77b8616147
2018-10-02 14:52:53 +02:00
Pau Espin a9006dffd9 osmotrx: Allow running osmo-trx from remote host
Change-Id: Ia31ac8eb41e02eda28d9f6f56774679300244ee8
2018-10-02 13:10:36 +02:00
Pau Espin e4358a9a36 Make code copying inst through ssh generic
It can later on be used by other classes that need to run binaries in
inst remotely.

Change-Id: I838b999528695207e1147cfe76e6f7aaf3b1dd53
2018-10-02 13:10:36 +02:00
Pau Espin 94eab26bf3 osmo-trx: Add multi_arfcn support
2nd TRX arfcn is changed in defaults.conf because multi_arfcn requires
them to be alocated in steps of 4 starting from TRX0.

It is not enabled by default yet on B200 (it must use it to support
several TRX) because current host running osmo-gsm-tester is not
performant enough and cannot keep up with timers due to multi-arfcn CPU
overhead.

Change-Id: I096df82ad1f4cbb41dfbd6a78466a845f34be385
2018-09-18 11:29:12 +00:00
Pau Espin 44b7ea18ca osmo-bts-trx: Add multiTRX support
Support is limited to 1 osmo-trx with 1 phy and multiple instances.

Change-Id: If2bda5ec7ac9fa3fe6bc5d71f323c3ccc2a70158
2018-09-18 11:29:12 +00:00
Holger Hans Peter Freyther 99a6a419a2 Keep track of all mobiles and copy them to unstarted later
At all times have a list of mobiles that were created. Make a shallow
copy and use it as the unstarted list.

This will be used by the upcoming gsm tester integration to build a list
of subscribers to be added into the HLR/AuC database.

Change-Id: Id72b7ce8821cf53ac0d5e4a141b9a2b66242e2a3
2018-09-15 09:27:22 +00:00
Pau Espin 4aeb4300b1 Build and use osmo-bsc_mgcp from openbsc.git instead of osmo-mgw.git
In osmo-mgw.git 31b4729f2731c747b8b33c4646dd5ade2ace29bc, osmo-bsc_mgcp
was dropped and the one from openbsc.git must be used.

Change-Id: Ib1c46baf4d36ab18f8064a2234a0ba28a1e7d2c2
2018-09-13 12:20:43 +02:00
Holger Hans Peter Freyther 8ae38a6b85 Allow to access imsi/ki from the OsmoMobile instances
Change-Id: Ib1b5f51e93d67e1dbde6f1ab4701e539d3cabec0
2018-08-31 15:19:33 +01:00
Holger Hans Peter Freyther a7b61f39fb Generate imsi/ki on OsmoMobile construction
Take an IMSI/KI when creating the OsmoMobile and not when starting
it. This will allow other code to know which IMSIs will be used
before the system starts (e.g. to add it to the HLR/nitb db).

Change-Id: I79e259e948aa797c13118143ecd64bb7e29d274b
2018-08-31 08:03:20 +00:00
Pau Espin 0d45504267 osmo-bts-trx: Big refactor and cleanup of osmo-trx related code
* This commit is a preparation for future commits to add support for
different osmo-trx devices and backends like osmo-trx-lms.

* Drop deprecated osmo-trx-* cmd line params and use VTY cfg to set them.

* As number of osmo-trx related osmo-gsm-tester attributes grow, group
them togther in an "osmo_trx" dictionary.

Change-Id: I77d29413c9e3b600b796627ba366f80c3281b7e1
2018-08-29 12:30:48 +02:00
Pau Espin 5dc245938b osmo-bsc: Parametrize codec-list VTY cfg
Change-Id: I1678aba43e8d399ecad192cbc416698373e3c0a0
2018-08-29 10:18:05 +00:00
Pau Espin c264d3df9d suite: Fix generation of config() dictionary
suite.config() hasn't been activetly used anywere. New upcoming patches
will start using it to set and overlay config parameters for objects
which are not necessarily allocated as resources.

Since these options don't apply to specific resources, there's no sense
in running replicate_times() on them.

Change-Id: I5fcdc9151d1663e738f5c8abe588a42ab51c8f6e
2018-08-29 10:18:05 +00:00
Pau Espin 722e94e833 Add channel_allocator cfg attr to bts resources
Change-Id: I682809d4aeb91a36e3a35fc481e8d40d0b084fa0
2018-08-22 11:59:09 +02:00
Pau Espin 568228701c osmo-bsc,msc: Set mgw local-ip in cfg.tmpl
Change-Id: Id46aa337f12756f80d492bf3102db5b1449e2027
2018-08-21 18:30:24 +02:00
Pau Espin aab56921f1 Introduce scenario modifiers
Before this patch, scenarios were only used to select resources with
specific attributes. This commit introduces "modifiers" in scenarios,
which allows setting or modifing config attributes of resources once
they have been reserved. This way same test can be run selecting same
resources but modifying its configuration, allowing for instance running
different number of TRX, different timeslot configuration, etc.

Modifiers are described by placing a "modifiers" dictionary in any
scenario file, similar to the current "resources" one used to select
requird resources. The "modifiers" dictionary is overlaid on top of the
"resources" one resulting from combining all the "resources" dictionary
of all scenario files.

Change-Id: If8c422c67d9a971d9ce2c72594f55cde2db7550d
2018-08-21 16:48:02 +02:00
Pau Espin 635f4c8d8f osmo-hlr.cfg.tmpl: Add ussd routing prefix for *#100# and fix expected answer format
Since osmo-hlr.git I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9, USSD
processing has been moved to osmo-hlr and prefix routing needs to be
configured, otherwise USSD requested are answered back to the MS with an
error "ss-NotAvailable (18)".

mesage received for extension resolution (*#100#) had its format change,
so update to new format (carriage return at the end was dropped).

Change-Id: I5f75eff0df2d20d7f9b39e69184cffb0e635713d
2018-08-13 14:36:14 +02:00
Pau Espin 58603671c2 Cleanup of class scoped variables
After bug described in OS#3456 and fixed in last commit, let's
categorize and place variables in its correct plac to avoid similar
issus. We leave under the class keyword (class scoped variables) the
attributes which are to be used as static class attributes. All other
ones are initialized during __init__(). This way w avoid scenarios in
which while using an object from an instance attribute we end up reading
a class scoped variable which is shared among all instances.

Change-Id: I5ad4cac34a9f49eaf42966c01c9c5a4d3f3e9dc8
2018-08-13 07:51:58 +00:00
Pau Espin 926a4b81be bts_nanobts: Fix pwsup_list increasing its size every new test
variables under class section are shared among all instances, and are
used unless the specific class instance attribute is set. As a result,
the same pwsup_list object was being re-used.

Take the chance to do the same with the _pcu var, since we want same
behavior for it.

See for reference: https://stackoverflow.com/a/1716730

Fixes: OS#3456
Change-Id: I3f6a9d64b35aec33430e90872f41c3d046653ce6
2018-08-09 13:01:17 +02:00
Pau Espin f6a0712282 nanobts: Support multiTRX
num_trx is left for now by default to 1, but it has been tested to work
properly (current tests pass and both trx are configured) with
num_trx=2.

Change-Id: Ib3962f824a804e2aa582601475a8514c6cb0d8e7
2018-07-27 16:24:31 +02:00
Pau Espin 698ad4ce50 bts: Recreate resources.conf trx_list with len based on num_trx
We are already doing this for defaults.cfg, but not for resources.conf.
As a result, if we have a trx_list with 2 trx but we have set num_trx=1
(default), parsing will fail later in bsc.cfg.tmpl because
conf_for_bsc_prepare() will pass a trx_list with 2 trx.

Change-Id: I28ed34abeedaa0ee2e7862ced45a46042192d831
2018-07-27 16:21:11 +02:00
Pau Espin bc1ed88304 Add ttcn3-bts-test env
Change-Id: I3251a49503dc823f0ef1fe8ef5d68236a584dad4
2018-07-25 16:38:30 +02:00
Holger Hans Peter Freyther 1dc9a04bc1 ms: Make the total test duration configurable
Change-Id: I5598d5dfd51e224e13835307ad20d108a5aa3935
2018-07-21 23:21:46 +01:00
Holger Hans Peter Freyther 874b4b4269 ms: Remove unused imports
Change-Id: Idd428d1bbd937a26a320eb69b1031856e49d3e4b
2018-07-21 23:21:46 +01:00
Holger Hans Peter Freyther af522fd601 ms: Only use completed tests for min/max handling
Remove non completed results before calculating the min/max. We will
need to check success/failure based on completion ratio.

Change-Id: Icaf9e90dd729b2339e409b3ec1593f456969fd19
2018-07-21 23:21:46 +01:00
Holger Hans Peter Freyther 6926c5763f ms: Simplify starting of the test and combine loop and wait
This will make it easier to strt different kind of tests. The cost
of calling step_once is hopefully neglectable as it simplifies the
test.

Change-Id: I3708ac382c0a34e17cf147d18f03603946437a53
2018-07-21 23:21:46 +01:00
Holger Hans Peter Freyther 0f6e41089b ms: Quit early when all tests concluded..
And fix the the detection if everything has completed.

Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179
2018-07-21 23:21:41 +01:00
Holger Hans Peter Freyther 574e62f0f9 ms: Begin to refactor and be able to share functionality
Change-Id: I840af0396f08744ce8ee6a2967f880d5cb7f815f
2018-07-05 20:30:42 +00:00
Holger Hans Peter Freyther 94da045c20 ms: Attempt to stop all mobile/virtphy instances on exit
We leave mobile/virtphy running after the test. Attempt to gracefully
exit and kill all of them. I experimented with both os.setpgrp and the
prctl(PR_SET_DEATH_SIG) but that didn't improve the situation.

Change-Id: I6cec050db7d4c355fb6678b2d84309fbbe5587b3
2018-07-04 20:26:13 +00:00
Holger Hans Peter Freyther 0f0ebd85db ms: Make the outer variables configurable
Do the easy part for making these variables configurable.

Change-Id: If8bbedcf672f6481a12c30d3669564704063626c
2018-07-04 20:24:41 +00:00
Holger Hans Peter Freyther 89dbf6db21 ms: Remove debug left over for the test
Change-Id: I17aa97a99cb1b1f9205b3a951370fe5ad49ae3dc
2018-07-04 20:24:30 +00:00
Pau Espin c81e26504d hlr: Get hlr.sql from new path
As of osmo-hlr edca4f88a653cc688bc1c46611a9f0bc880637e2, hlr.sql file
has been moved to an sql subdir.

Change-Id: I1cbbe46edc6121476cd2422074a9f3cfc2d8e5ef
2018-07-03 11:56:07 +02:00
Holger Hans Peter Freyther 05895a912d ms: Use the new API to pass credentials to the event server
We are using the "autobind" feature of Linux to get a special
socket address. This allows us to have roughly 2^20 clients on
the system.

Change-Id: Ie9b9ac6267f40345baf7dbb3becaecf264a5df5f
2018-06-25 20:27:41 +00:00
Pau Espin 99efe820e4 ggsn: Bind VTY and CTRL ifaces to assigned ip addr
Change-Id: I26735a21cd53183dfe0a75e5bd24954d583c354f
2018-06-22 12:13:52 +02:00
Holger Hans Peter Freyther 5eb4f0e6a2 osmo_ms_driver: Use the two new config options for the mobile
Avoid being stuck in c7 state and use the c7-any-timeout with a low
value. Do not attempt to store SMS in the home directory (if they
are received).

Change-Id: I4bb59130a04852bc43af9ef3602b129f40e9e170
2018-06-06 19:19:54 +01:00
Pau Espin e523665e9c event_loop: Log parameters during wait timeout exception
Change-Id: I1cf104392bfd11ad263264738eb4d8fa60550a5d
2018-05-28 14:01:12 +02:00
Pau Espin 7f4807a4bc powersupply_sispm: Add port number to log name
This way it can easily be spotted which port is being triggered in case
someone wants to manually test it.

Change-Id: Ibd2c70170d97a786e37b6838b1ed6d4eb637ad8b
2018-05-28 13:04:42 +02:00
Pau Espin e974944496 osmo-bsc.cfg.tmpl: Remove unused nd recently removed option dest
This VTY cmd has been removed in osmo-bsc.git
68e4be9c845e25f53aea511b1c57340a9da5825c.

Change-Id: I48c0b8a7b2a0088887f1309efc40bcf1da0f1626
2018-05-28 13:04:42 +02:00
Pau Espin b1526b9979 Add option to expect bts/pcu failures and respawn its processes
Some tests may want to reproduce some scenarios in which it is expected
that a BTS process is stopped, for instance if the BSC link is dropped.
Provide a keepalive parameter to start() for bts and pcu objects to
inform suite that failures are expected and that it should keep them
alive in case that ocurrs by respawning the BTS process.

Change-Id: Ia2a7539f9fad457125ac9b60a52a52999e885ba8
2018-05-25 12:31:20 +02:00
Pau Espin 06ada458cf process: Move cleanup log inside cleanup method
Change-Id: I72ad453e9dc8340946d7e7d041643fe8ef97439f
2018-05-25 12:31:20 +02:00
Pau Espin 63f2d47b3e bsc: Add API to mock BSC RSL IP addr
Change-Id: I9ca67964e656943b50967a27a88054fd3e484672
2018-05-25 12:31:20 +02:00
Pau Espin 58cd83c3ec templates: osmo-bts: Use BTS assigned IP addr to bind CTRL and VTY iface
Change-Id: Ib1c3022a6c531ef8c6a5ba31927762806abc37ac
2018-05-25 12:31:20 +02:00
Pau Espin 878b2c6619 testenv: Provide tests with access to process module
Some tests may want to start/stop/manages processes themselves. By using
the process module from osmo-gsm-tester, we make that possible easily,
providing with useful features such as requesting a suite to stop it on
cleanup.

Change-Id: I8e018107cbec81299ec2228bfff933fb3b0bb6cd
2018-05-18 15:59:06 +02:00
Pau Espin f32c41519e util: Fix unloading of suite lib import path
Change-Id: Iac81151f5baec092a3d15bbe6541b5bc007e6a03
2018-05-14 15:34:40 +02:00
Pau Espin 155a355e01 Unload suite local modules after suite exit to avoid collisions
Since sys.path is modified idynamically to load modules from "lib" subdir of each suite, from python env point of view all those modules share a namespace. As a result, there can be name collisions.

If a name collision appears (eg test1 loads "testlib.py" and test2
afterwards also loads its own "testlib.py"), then python interpreter
thinks the testlib.py module is already loaded, so test2 ends up using
"testlib.py" from test1.

The way to solve this is to make suite local
modules to live only through the scope of the suite, and unload the
modules once the suite is finished.

Change-Id: I4efe815f85bc4ec2ca91aa9c2d3a369048f21571
2018-05-09 11:24:25 +02:00
Pau Espin 7e02d20b46 suite: Set suite subdir lib part of syspath so tests can import their own modules
Change-Id: I3307c3ab314bb7a88d3c22c7c270c9f05fe6e03e
2018-05-08 15:28:48 +02:00
Pau Espin 39df7f4668 bts: Allow setting amount of TRX and timeslot in cfg and from test at runtime
The num_trx attribute for a given BTS states the number of TRX to be
used by that BTS. If more than num_trx are configured in trx_list in the
cfg file, then only up to num_trx are taken into account. If a num_trx
value higher than max_trx is specified throuygh config file or at
runtime by the test, an exception is raised explaining the issue.

The num/max_trx attributes are overlayed along the config levels
(generic -> bsc_bts -> specific bts-type -> specific resource object).
This way we can specify a long list of trx+timeslot config in the
generic config (bsc_bts), and tune for each model and specific BTS which
is the desired default number of TRX, as well as the maximum supported
per type.

Change-Id: I7f46eaf7a16f03268653299c93600c0443f691ac
2018-05-08 14:55:12 +02:00
Pau Espin e699912a23 bts: Move conf_for_bsc_prepare from bts_osmo to bts
nanobts inherits directly from bts.Bts, so we need to move
conf_for_bsc_prepare there to make nanobts work again.

Fixes: 530681fd86
Change-Id: I4305eefb4056ed7614118532e271efe780f4a87f
2018-05-08 14:50:32 +02:00
Pau Espin e519462d60 bts: Pass defaults config name at construct time
It will be needed later at construction time when resolving the num of
trx.

Change-Id: I2c6a46ead14010f714897ea178917327215823e7
2018-05-07 13:37:02 +02:00
Pau Espin 530681fd86 bts: Refactor conf_for_bsc_osmo
Move duplicated code into a method in the superclass.

Change-Id: Ie27932f94142f667c3fb8c054b77e04afa0d5cbb
2018-05-07 11:20:23 +02:00
Pau Espin c9b6376796 Check physical channel configs
Change-Id: I5894678e0d6f306173cc550dd6806a7d6f8a4c11
2018-05-07 11:20:22 +02:00
Pau Espin 7d4bdf2daf bts_osmotrx: Don't use binary name as inst name
Change-Id: Iee20738f2aa750aa9035a9e54ad667d8753ea12e
2018-05-07 11:00:30 +02:00
Pau Espin 553eda638c osmo-trx binary is now called osmo-trx-uhd
Change-Id: Ibf111ba89b24964127b9c1db7102953e1dba3181
2018-05-07 00:47:40 +02:00