Commit Graph

1234 Commits

Author SHA1 Message Date
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 f9d92f78e6 Introduce doc/examples/ directory
It contains simple usual setups to get started with osmo-gsm-tester,
such as creating a 4G network using srsLTE or a 2G network using the
osmocom stack (+ ofono modems).

Change-Id: I55d5b1152da201799af21a77ef6c562f97bd94fc
2020-04-10 19:00:14 +02:00
Pau Espin 99bed8bdb2 Move example/ and ttcn3/ to sysmocom/ and sysmocom/ttcn3
This content is mostly specific to sysmocom's setup (thought it can
still be re-used by other people if willing to).

symlinks in ttcn3/ pointing to example/ are redone to point to
sysmocom/.

Change-Id: I364e0859c0851b9167907a4d948b659a0f6a19fb
2020-04-10 19:00:14 +02:00
Pau Espin 69a6f668b9 Get rid of install top directory
Some content there is out of date, or should be mvoed to utils/ with the
rest of installable stuff.

Change-Id: I17ee94b175deb88faff71e7788c482093693f8a8
2020-04-10 17:29:10 +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 80855498f1 utils/bin: Support passing several bin files to setcap helper scripts
Change-Id: Ifa43f895ae0796d086f35778263aaba07f2e1b7a
2020-04-08 15:16:10 +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 69488f6d8a Move suites/ dir inside example/
example/paths.conf and documentation are updated accordingly.

Test suites should have been moved a long time ago, since the they are
user or setup-specific based on what needs to be tested.

Change-Id: I154b19979b545deba8b232b60172903f63fd9e28
2020-04-07 16:12:47 +00: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
Pau Espin 3f2a5e5b41 contrib: build amarisoft: Set trx_zmq.so RPATH to point to copied dependency libsrslte_rf.so
In the ENB case it's not really required since osmo-gsm-tester makes use
of LD_LIBRARY_PATH. However, since the UE is potentially run with
capabilitites to create tunnels and alike, LD_LIBRARY_PATH cannot be
used and lteue will fail to load trx_zmq.so (because it cannot find its
dependency libsrslte_rf.so).

Change-Id: Ifcbc6ed1c4c465b4cfab4c5689cde44624095f29
2020-04-06 16:32:13 +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 8bf740a452 suites/gprs/: beautify output result of ping tests
Print ping output at the end and replace the whole test stdout report
with ping execution.

Change-Id: I90001ddc6bc1145ac9d115aee762f4f3500e8dc8
2020-04-06 14:07:04 +02: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 64ad952de1 contrib/jenkins-build-amarisoft.sh: Fix typo copying trx_uhd.so to UE
Change-Id: I0c9b83b9adf0548e78363462744644bc528c2d29
2020-04-03 18:17:09 +02:00
Pau Espin a560ea7b85 contrib/jenkins-build-amarisoft.sh: Make build of amarisoft trx_zmq.so optional
That module is only available so far in a private repository, so allow
still other amarisof tusers to build the bundles with UHD support.

Change-Id: I361f179c8e7f379173fa9109028e139fc4c8c251
2020-04-03 18:17:09 +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