Commit Graph

847 Commits

Author SHA1 Message Date
Andre Puschmann f69b948148 enb.py: increase ZMQ trx timeout to 8s
increase value further to avoid failed tests due to load on system

Change-Id: I77b7864e7ef60faf0262dc24325915d73dd2d5a3
2021-03-16 18:10:28 +01:00
Andre Puschmann fcdff4bcfe ms_srs: add force_ul_amplitude config
this allows to overwrite the PHY export option phy.force_ul_amplitude

Change-Id: I255f027433944c1739c89757609f0dcc3b8aa7cb
2021-03-16 18:10:26 +01:00
Nils Fürste 7b4e1f676b AndroidUE: Fix connection timeout
Change-Id: Iaacf348e2e018da5b67ada33079018c1859d3b63
2021-03-16 18:09:49 +01:00
Andre Puschmann 1bba2891c5 ms_srs: turn tx/rx_gain into INT and make them optional
when they are greater than 0 they are written as config paramter.
if they are -1 they are disbaled and automatic gain calibration is
used.

Change-Id: I473ff3ae679784178574d2f76b612dbf77180490
2021-03-16 18:09:49 +01:00
Andre Puschmann 3fc74d353a run_node: add label to RunNode class
this allows specifying a label on each run node that can be used
to filter/select specific nodes.

Change-Id: Ib6a977007f56d6ff9ff029aaf049a75fb5d5e1dd
2021-03-16 18:09:49 +01:00
Andre Puschmann b190b4c397 ms_android: set num_carriers to 1 by default
throughput tests require the UE object to have the num_carriers
member. For Android UEs, set it to 1 by default.

Change-Id: I297d24bb578a7db0eb7629be4f2cc0d54624467d
2021-03-16 18:07:22 +01:00
Francisco b04f135d32 srsenb_sib.conf.tmpl: reduce the default size of the PUCCH
optimized PUCCH config

Change-Id: I45ae7c33f9d1df20df37c0fe6c3d73aa85ae1b31
2021-03-16 18:04:40 +01:00
David Rupprecht f4ff058ee2 srsue.conf.tmpl: Adjust ue.config template for new pcap path
Change-Id: I4af6abaa3973652a12f571d88bca59cd443704f3
2021-03-16 18:04:40 +01:00
Andre Puschmann c487f7438c ms_srs: add config scheme to select NAS log level
we've provided only all_log_level so far but sometimes it's needed
to select the level per layer. This patch adds the ability
to do so for the NAS layer in the UE.

Change-Id: Iab2bce65e8af81f6d344849c97952e6441cb2846
2021-03-16 18:04:40 +01:00
Andre Puschmann 2bc8311ea7 srsenb_drb.conf.tmpl: add QCI10 with infinit PDCP discard timer
copy of QCI9 params but with infinit PDCP discard to avoid SDU drops
at PDCP

Change-Id: I64a74d09cc1a55ba21a7be7b5cc203e56bba3b10
2021-03-16 18:04:40 +01:00
Andre Puschmann 3cecad8ebf amarisoft_drb.cfg.tmpl: add additional QCI10 with infinit PDCP discard timer
also set QCI9 to 150ms to match default srsENB config

Change-Id: I60cc1390480142bd5bb516934c9f30b6122496d5
2021-03-16 18:04:40 +01:00
Andre Puschmann 88727efa10 srsenb_drb.conf.tmpl: set PDCP discard timer to 150ms for QCI9
srsENB now supports PDCP discard so we set it to a sane value.
Also enable status reporting for UL.

Change-Id: Ib6ad0ff57b95a1f220f87c1ede0f6eacc5fb21ff
2021-03-16 18:04:40 +01:00
Andre Puschmann 0320ec2e95 enb.py: increase zmq trx timeout to 4000ms
with many parallel jobs running on one machine we should
relax the timeout a bit to avoid false positives.

Change-Id: Ib32a07559bd5a4b0165f6d3431c5ac57cc050f44
2021-03-16 18:04:40 +01:00
Andre Puschmann 3ce672594f enb,epc,ms: refactor KPI API
we previously mixed component specific and component agnostic APIs
(stdout vs. log file for example) for setting and retrieving KPI.

This patch propose to use a single abstract get_kpis() method for
all components that can be enriched with component-specific
stuff as desired.

In the case of srsLTE blocks, the main implementation will
remain in srslte_common() and is shared among srsENB/srsUE/srsEPC.

The KPI analyzer in srslte_common() extract and also manages
all three KPI sources (log, csv and stdout) independently.

In addition to the get_kpis() method that always returns a flat
dictionary, it also exposes get_kpi_tree() that return
a dict of KPI dicts that will be used for the Junit.xml generation.

Change-Id: I4bacc6b8a0cb92a581edfb947100b57022265265
2021-03-16 18:04:40 +01:00
Pau Espin 3b351716a9 Fix bts.ready_for_pcu() implementation for sysmo and oc2g
osmo-bts.git ae09c8acb4aa93284cdb44f8bbdc14533dc4fa52 modified code to
avoid calling pcu_tx_info_ind() if pcu socket was not connected. Since
osmo-gsm-tester relied on log message sent from within that funtion to
find out whether BTS was able to handle PCUIF connections, that log line
is not printed anymore and hence the function ready_for_pcu() fails to
ever return true.
As a result, gprs tests for sysmo and oc2g bts types always fail with a
timeout.

Other BTS types are not affected (such as osmo-bts-trx) because in there
we simply check whether the osmo-bts process is running.

Change-Id: Ibde4b8b27b8300b4b9197c0f8d82a6ccbf3b0522
2021-03-08 12:01:37 +01:00
Pau Espin 5ff071833a osmo-sgsn: Fix template cfg to work with NS2 implementation
See following HOW-TO to update existing configs:
https://osmocom.org/projects/libosmocore/wiki/Network_service_(NS)

Change-Id: I391c977ca20ef185db6b1f17912608acaa13e87f
2021-03-08 11:31:59 +01:00
Andre Puschmann 7aa14e45f4 srsue.conf.tmpl: reduce nof PHY threads to 2 for ZMQ
we've detected a possible race condition during the Msg3
transmission that caused the thread that sets the Msg3 grant
to be delayed. The PHY worker that executed TTI+2 finished
by that time already and didn't even see the pending UL grant.

This is issue is more likely to happen on loaded system,
for example when running parallel ZMQ jobs. We therefore decided
to reduce the number of parallel PHY workers to 2 so the issue
is circumvented.

Change-Id: Ibdb42a1705d87b6d343201458c8fe397398802bc
2021-02-08 17:48:09 +01:00
Andre Puschmann d1732d7820 srsepc.conf.tmpl: double value of T3413 (paging timer)
we've already incrased the t3413 value in 9c7fd618d2
but realized it may still be too low in some cases.

we set it to 12s now.

Change-Id: I9c3c59c0ff8f539a44b420f8ba31eea016c211ce
2021-02-08 17:48:09 +01:00
Nils Fürste a81801558e enb: Set cipher and integrity via scenario file
This patch enables setting cipher and integrity algorithms
in Amarisoft eNB and srsENB via scenario files. If no
settings are defined following defaults are applied:
- Cipher algorithm: EEA0, EEA2, EEA1
- Integrity algorithm: EIA2, EIA1, EIA0

Example of setting cipher algorithms:
- 4g:srsue-rftype@uhd+srsenb-rftype@uhd+mod-enb-cipher@eea1+mod-enb-cipher@eea0+mod-enb-nprb@6

Change-Id: I595206b7d49016fb6d0aec175c828d9537c53886
2021-02-08 17:48:09 +01:00
Andre Puschmann 215bec2f3c enb: add abstract method stop()
implement as noop for Amarisoft eNB, srsENB will send q+Enter to stdin,
which is implemented in class srslte_common()

Change-Id: Ide606e1a6b523997215aa2fa39d4d56ae1f49181
2021-02-08 17:48:09 +01:00
Andre Puschmann f249a026a0 enb,ue,process: move stdout counter helper to process objects
this patch adds the stdout counter to count events happening
on the stdout (known from the UE already) to the common
process class so they can also be used from the eNB (and other objects)

In addition, we add a PRACH counter to be used for tests.

Change-Id: I434f072b8aa6f4dce9f90889c6b40832f6798ff8
2021-02-08 17:48:09 +01:00
Nils Fürste a8263f40e9 Introduce Android UEs as new modems
To expand the test capacities we would like to introduce
Android UEs as new modems. Currently the following tests
are supported:
- Ping
- iPerf3 DL/UL
- RRC Mobile MT Ping

In the following is a small description.

Prerequisites:
    - Android UE
        - Rooted (Ping, iPerf, RRC Idle MT Ping)
        - Qualcomm baseband with working diag_mdlog (RRC Idle MT Ping)
        - iPerf3
        - Dropbear
    - OGT Slave Unit
        - Android SDK Platform-Tools
	  (https://developer.android.com/studio/releases/platform-tools#downloads)
        - Pycrate (https://github.com/P1sec/pycrate)
        - SCAT
            clone https://github.com/bedrankara/scat/ & install dependencies
            checkout branch ogt
            symlink scat (ln -s ~/scat/scat.py /usr/local/bin/scat)

Infrastructure explaination:
The Android UEs are connected to the OGT Units via USB. We
activate tethering and set up a SSH server (with Dropbear).
We chose tethering over WiFi to have a more stable route
for the ssh connection. We forward incoming connections to
the OGT unit hosting the Android UE(s) on specific ports
to the UEs via iptables. This enables OGT to issue commands
directly to the UEs. In case of local execution we use ADB
to issue commands to the AndroidUE. The set up was tested
with 5 Android UEs connected in parallel but it should be
scalable to the number of available IPs in the respective
subnet. Furthermore, we need to cross compile Dropbear
and iPerf3 to use them on the UEs. These tools have to be
added to the $PATH variable of the UEs.

Examplary set up:
In this example we have two separate OGT units (master
and slave) and two Android UEs that are connected to the
slave unit. An illustration may be found here: https://ibb.co/6BXSP2C

On UE 1:
ip address add 192.168.42.130/24 dev rndis0
ip route add 192.168.42.0/24 dev rndis0 table local_network
dropbearmulti dropbear -F -E -p 130 -R -T /data/local/tmp/authorized_keys  -U 0 -G 0 -N root -A

On UE 2:
ip address add 192.168.42.131/24 dev rndis0
ip route add 192.168.42.0/24 dev rndis0 table local_network
dropbearmulti dropbear -F -E -p 131 -R -T /data/local/tmp/authorized_keys  -U 0 -G 0 -N root -A

On OGT slave unit:
sudo ip link add name ogt type bridge
sudo ip l set eth0 master ogt
sudo ip l set enp0s20f0u1 master ogt
sudo ip l set enp0s20f0u2 master ogt
sudo ip a a 192.168.42.1/24 dev ogt
sudo ip link set ogt up

Now we have to manually connect to every UE from OGT Master
to set up SSH keys and verify that the setup works.
Therefore, use:
ssh -p [UE-PORT] root@[OGT SLAVE UNIT's IP]

Finally, to finish the setup procedure create the
remote_run_dir for Android UEs on the slave unit like
following:
mkdir /osmo-gsm-tester-androidue
chown jenkins /osmo-gsm-tester-androidue

Example for modem in resource.conf:
- label: mi5g
  type: androidue
  imsi: '901700000034757'
  ki: '85E9E9A947B9ACBB966ED7113C7E1B8A'
  opc: '3E1C73A29B9C293DC5A763E42C061F15'
  apn:
    apn: 'srsapn'
    mcc: '901'
    mnc: '70'
    select: 'True'
    auth_algo: 'milenage'
  features: ['4g', 'dl_qam256', 'qc_diag']
  run_node:
    run_type: ssh
    run_addr: 100.113.1.170
    ssh_user: jenkins
    ssh_addr: 100.113.1.170
    ue_ssh_port: 130
    adb_serial_id: '8d3c79a7'
  scat_parser:
    run_type: local
    run_addr: 127.0.0.1
    adb_serial_id: '8d3c79a7'

Example for default-suites.conf:
- 4g:ms-label@mi5g+srsenb-rftype@uhd+mod-enb-nprb@25+mod-enb-txmode@1

Change-Id: I79a5d803e869a868d4dac5e0d4c2feb38038dc5c
2021-01-13 19:45:56 +01:00
Andre Puschmann 4cb9ab5671 srsenb.conf.tmpl: set nof_of_prach_threds to 0 for ZMQ
this executed the PRACH search in the main thread so
PHY workers and PRACH processing don't diverge in loaded
scenarios

Change-Id: I97eddb5f9ca682251ded1f73093c2d0a49462bd6
2021-01-07 20:43:48 +01:00
Andre Puschmann 9c7fd618d2 srsepc.conf.tmpl: increase default value of T3413 (paging timer)
we've seen that the default value of 2s might be a bit tight.
the value is network dependent so no real default value exists.
however, 6s seems to be a good compromise.

Change-Id: Icc75ee048c2cc605ab26c4c87a039519998f7e57
2021-01-07 20:43:47 +01:00
Andre Puschmann 2df63d0f2f enb_srs: adopt throughput thresholds for QAM256
it turned out that we have to reduce the MCS when using QAM256,
especially for 6 PRB as subframe 0 and 5 contains PBCH and PSS
signals, so the available REs are reduced.

The eNB scheduler now has this limitation in mind and lowers the MCS.

Change-Id: I0e38fe28002fd68c768cc8dcffcf74f4f190df02
2021-01-07 20:43:47 +01:00
Andre Puschmann b7ce9499b6 enb_srs: only use QAM64 tables if both UE and eNB are configured for QAM64
this was causing failed tests because to achieve QAM64 rates both
eNB and UE need to support it and have it activated.

Change-Id: I599df92d69eeb56a5d44327de08f004222cff073
2021-01-07 20:43:47 +01:00
Andre Puschmann 1d1c0bfed9 srsue.conf.tmpl: disable TTI stats for ZMQ
since ZMQ runs are not using wall clock anyway, measuring
TTI execution isn't useful, disable it therefore to avoid
misleading warnings.

Change-Id: I5c2cb0abcfce0ee67806f6611356f4d5d180541d
2021-01-07 16:30:25 +01:00
Andre Puschmann 507c60ca0c srsue.conf.tmpl: reorder conditions for setting RRC release
the order of checks needs to go from high to low, i.e. the higher
release feature (e.g. qam256) needs to be checked and set first.

in theory it should also be possible to have a CA-capable UE
that does not support QAM256, but for srsUE we announce both anyway.

Change-Id: I2fa49f0cb5d80db412a811ceeb380359c8ad67a7
2021-01-07 16:30:25 +01:00
Andre Puschmann bfd3fe659e enb: include name label and run_addr in enb remote path
this allows to quickly identify the enb host in the logs

Change-Id: I9c979de852a23041e43692e97ebcbfb389b52fdb
2021-01-07 16:30:25 +01:00
Andre Puschmann a7725fcedf srsenb_drb.conf.tmpl: add QCI1 DRB config
use default QCI1 config for real-time voice traffic

Change-Id: I43f408b1a3c172a5eb8327f03df49801e063e5cd
2021-01-07 16:30:25 +01:00
Pau Espin Pedrol 2c92c2e9be resource: Fix next_zmq_port_range using bvci file name
Change-Id: I293b7de1066ea69ccb0e495a69602ed56810018d
2020-12-17 15:51:39 +01:00
Neels Hofmeyr f80f7cc5c4 OsmoCtrl: use one global common counter for CTRL IDs
It is easier to traverse debugging logs if the CTRL request and response
IDs are globally unique across all programs and tests. Before this, we
were using 0 almost everywhere.

(This is not strictly needed for correctness, since each CTRL client has
its own request ID scope; just we open fairly many separate CTRL clients
all the time in our tests.)

Change-Id: I44c51f4fb5beb6cedf98ea0d6684a24c6aa418c7
2020-12-11 00:41:17 +01:00
Neels Hofmeyr 1e01a68846 add option osmo-gsm-tester.py --suites-file my-suites-listing.conf
For example, run with '-S handover-suites.conf' to just do the handover
tests.

Change-Id: If896ac84d02a275deda2f20a93c29312df128ebb
2020-12-11 00:41:17 +01:00
Neels Hofmeyr fb8c02fbd5 process output: do not leak ANSI colors past logged stdout/stderr
In jenkins, I still saw incidents of the entire log becoming colored
after a colored stderr snippet was printed to the log. Make absolutely
sure that no unterminated ANSI coloring is leaked.

Change-Id: Ib9ac1eea4a12d6d43ac8614491f016bbe9ca17b1
2020-12-11 00:41:17 +01:00
Neels Hofmeyr de6743de9a add handover_2G suite, with handover.py test
Via VTY, handover two lchans of a voice call from bts0 to bts1 and back.

New scenarios/bts1-* allow selecting various types for bts1,
complementing the already existing files for selecting bts0.

Change-Id: I0b2671304165a1aaae2b386af46fbd8b098e3bd8
2020-12-11 00:41:17 +01:00
Neels Hofmeyr 5354058c75 osmo_ctrl.py: add RateCounters
First user will be the upcoming handover_2G/handover.py test in
I0b2671304165a1aaae2b386af46fbd8b098e3bd8.

Change-Id: Id799b3bb81eb9c04d13c26ff611e40363920300e
2020-12-11 00:30:38 +01:00
Neels Hofmeyr 012a17da6a keep Ctrl connections open for bsc, msc and nitb objects
The pattern to use 'with' to keep a CTRL connection open adds indents to
every test script that wants to avoid multiple reconnections to the
CTRL. Instead, keeping a single open connection that is cleaned up on
{bsc,msc,nitb} object cleanup ensures that a) the program started up
successfully and opened a CTRL port, b) always has a CTRL open without
having to worry about it and c) keeps test scripts less
complex/indented/crufted.

(These are all current users of the OsmoCtrl API.)

Change-Id: I53fedbe569c5ccbc4b1a17dafe1f8d1bb8200b24
2020-12-11 00:30:38 +01:00
Neels Hofmeyr 5b04ef213e OsmoCtrl cleanup: get_var(), set_var(), get_trap()
CTRL interface interaction was mostly inherited from the first legacy
implementation of osmo-gsm-tester, and it was a pain to look at from the
start. Now, while I'm close to the topic, I want this to improve:

Properly match a GET_REPLY/SET_REPLY to a sent GET/SET by the message
ID.

Completely drop the do_get() and do_set(), which were not useful for
correct handling of the CTRL request and response messaging. The API to
use by callers is set_var(), get_var()/get_int_var() and get_trap().
These call the internal _sendrecv() (or for TRAP only _recv())
functions. Make it so that tese work both on an already connected
OsmoCtrl, as well as one that needs to establish a (short) connection,
so that both are trivially possible:

    # one CTRL connection stays open
    with OsmoCtrl(...) as ctrl:
  	ctrl.get_var('var1')
  	ctrl.get_var('var2')
  	ctrl.get_var('var3')

and

  # get_var() opens a connection, does the GET and closes again
  OsmoCtrl(...).get_var('var1')

Do away with doubling the instances OsmoCtrl and e.g. OsmoBscCtrl.
Rather make OsmoBscCtrl a child class of OsmoCtrl, which means that we
no longer have bsc.ctrl().ctrl(), just bsc.ctrl().

Have VERB_* constants instead of dup'd strings.

Apply to / simplify all callers of OsmoCtrl.

Some of these changes are similar to recently added OsmoVty.

Change-Id: Id561e5a55d8057a997a8ec9e7fa6f94840194df1
2020-12-11 00:30:38 +01:00
Neels Hofmeyr f79a86fc25 ctrl: increment message IDs for CTRL commands
Implicitly use distinct IDs for CTRL commands. This is a prerequisite
for matching GET_REPLY IDs to GET IDs, to correctly handle CTRL
responses without counting on being lucky.

Rather use 'use_id' as var name instead of overloading the 'id' keyword.

Change-Id: I698faa013eb14f88759685d50d925f5d82d80aa0
2020-12-11 00:19:13 +01:00
Neels Hofmeyr 05439d7029 ctrl: set socket timeout
The blocking CTRL socket must have a timeout.

So far we have always been reading from the CTRL socket in a blocking
way. So far we are always lucky that we are indeed getting a response to
receive. Should the CTRL interface ever fail to answer, the tester would
be stuck infinitely.

Change-Id: I20091daf13981dc3d0d894af5a65c23f4db0471d
2020-12-11 00:19:13 +01:00
Neels Hofmeyr 16c8be41c9 report fragment: strip ansi colors from junit XML
Jenkins does support showing ANSI colors on the web, but apparently not
in the junit results output. Strip ansi colors from report fragment
<system-out> text, to make it less annoying to read those on jenkins.

Change-Id: I656ecc23bbfd3f25bdf012c890e0c998168844d3
2020-12-11 00:19:13 +01:00
Neels Hofmeyr 9596b210c5 add test.report_fragment()
Allow enriching the junit output with arbitrary subtasks within a test.

The current aim is, for handover tests, to not just show that a test
failed, but to show exactly which steps worked and which didn't, e.g.:

 handover.py/01_bts0_started PASSED
 handover.py/02.1_ms0_attach PASSED
 handover.py/02.2_ms1_attach PASSED
 handover.py/02.3_subscribed_in_msc PASSED
 handover.py/03_call_established PASSED
 handover.py/04.1_bts1_started FAILED

In this case it is immediately obvious from looking at the jenkins
results analyzer that bts1 is the cause of the test failure, and it is
visible which parts of the test are flaky, over time.

First user Will be the upcoming handover_2G suite, in
I0b2671304165a1aaae2b386af46fbd8b098e3bd8.

Change-Id: I4ca9100b6f8db24d1f7e0a09b3b7ba88b8ae3b59
2020-12-11 00:19:13 +01:00
Neels Hofmeyr 12ed99628c implement test.get_log_output()
Retrieve a test's own logging. The aim is to provide logging belonging
to a given report fragment in the junit XML output, will be used by
upcoming test.report_fragment() feature.

Change-Id: Idfa0a45f3e6a18dd4fe692e81d732c70b5cffb76
2020-12-11 00:19:13 +01:00
Neels Hofmeyr e5e5df8d24 log: process.py: fix weird space in stdout/stderr log output
Log output before:

  stdout:
   | line1
  | line2
  | line3

After:

  stdout:
  | line1
  | line2
  | line3

Change-Id: I4202e7dfbb550acaf55a6c6487fc07819ab18b94
2020-12-11 00:19:13 +01:00
Neels Hofmeyr 3b493f3567 do not redirect_stdout in test scripts
In a test, I called print() on a multi-line string and saw the log
showing each line 0.2 seconds apart. redirect.stdout seems to be pretty
inefficient.

Instead, put a print() function into the testenv, to directly call log()
on the strings passed to print().

The initial idea for redirect_stdout was that we could print() in any
deeper functions called from a test script. But we have no such nested
print() anywhere, only in test scripts themselves.

As a result of this, a multi-line print() in test scripts now no longer
puts the log prefix (timestamp, test name...) and suffix (backtrace /
source position) to each single line, but prints the multiline block
between a single log prefix and suffix -- exactly like the log()
function does everywhere else.

I actually briefly implemented adding the log prefix to each separate
line everywhere, but decided that it is not a good idea: in some places
we log config file snippets and other lists, and prepending the log
prefix to each line makes pasting such a snippet from (say) a jenkins
log super cumbersome. And the log prefix (backtrace) attached on each
separate line makes multiline blocks very noisy, unreadable.

Change-Id: I0972c66b9165bd7f2b0b387e0335172849199193
2020-12-11 00:19:13 +01:00
Neels Hofmeyr 081e89f477 fix: line nr in test name in wrong places
test.Test() overrides name() in order to provide source line number
information. However, overriding name() is the wrong place for that, as
name() is also often used for identifying an object - when listing the
tests of a suite, the line number should not appear in the test name.
For example, the line number sometimes ends up in the test results in
jenkins, making 'foo.py' and 'foo.py:23' two distinct report items.

Instead, add a separate function Origin.src() that defaults to name(),
but specific classes can override src() if they wish to provide more
detailed information with the object name.

Override src() in Test, not name().

Use src() in backtraces.

The suite_test.ok shows that the backtracing in the log remains
unchanged, but the place where the test name is printed is corrected:
   I am 'test_suite' / 'hello_world.py:23'
becomes
   I am 'test_suite' / 'hello_world.py'
(Notice that "[LINENR]" in suite_test.ok is a masking of an actual
number, done within the selftest suite)

Change-Id: I0c4698fa2b3db3de777d8b6dcdcee84e433c62b7
2020-12-11 00:19:13 +01:00
Neels Hofmeyr fc38393f82 process: add get_output_mark() and grep_output()
Allow showing log lines matching specific regexes, from a specific start
point of a log.

My use case is to echo the handover related logging after an expected
handover failed, so that the reason is visible already in the console
output of a jenkins run. So far I would need to open the endless bsc log
and look up the matching place in it to get a conclusion about why a
handover failed.

Change-Id: Ib6569f7486e9d961bd79a5f24232e58d053667a1
2020-12-11 00:19:13 +01:00
Neels Hofmeyr ecce402f43 configure fixed ARFCN per bts
Remove ARFCNs as a concept from resource pool, assign a fixed ARFCN to
each BTS and TRX in the resource pools.

Using ARFCNs on specific bands as resources was an idea that is hard to
implement, because specific BTS dictate selection of bands which
influences which ARFCNs can be picked. That means reserving ARFCN
resources is only possible after reserving specific BTS resources, but
the tester is currently not capable of such two-stage resolution.

Writing handover tests, I got the problem that both BTS in a scenario
attempt to use the same ARFCN.

The by far easiest solution is to assign one fixed ARFCN to each BTS and
TRX. If ever needed, a scenario modifier can still configure different
ARFCNs.

(Due to uncertainty about OC2G operation stability, I prefer to leave
OC2G on ARFCN 50, as it happened to end up being configured before this
patch.)

Change-Id: I0a6c60544226f4261f9106013478d6a27fc39f38
2020-12-11 00:19:13 +01:00
Neels Hofmeyr f07114f9e2 log reserved resources
On non-debug log level, show something like this at the beginning of
each suite:

 03:45:49.439720 tst handover:sysmo+secondbts-trx-b200: RESERVED RESOURCES for handover:
 bts
   sysmoBTS 1002
   Ettus B200
 ip_address
   10.42.42.2
   10.42.42.3
   10.42.42.4
   10.42.42.5
   10.42.42.6
   10.42.42.7
 modem
   sierra_1st
   sierra_2nd

Change-Id: Ic23556eafee654c93d13c5ef405028da09bd51d7
2020-12-11 00:19:13 +01:00
Neels Hofmeyr 7d79ea4d2a log passed tests
In the end of a test suite, do not omit the passed tests. For example,
running handover against N BTS combinations, it was hard to summarize
which BTS models actually succeeded, with only the failures listed.

Besides the "FAIL" listings, now print something like this in the end:

 PASS: handover:sysmo+secondbts-trx-b200 (pass: 1)
     pass: handover.py (198.8 sec)
 PASS: handover:sysmo+secondbts-trx-umtrx (pass: 1)
     pass: handover.py (192.7 sec)
 PASS: handover:trx-b200+secondbts-trx-umtrx (pass: 1)
     pass: handover.py (193.1 sec)

Change-Id: Ib85a5b90e267c2ed2f844691187ecadc8939b1bb
2020-12-11 00:19:13 +01:00
Neels Hofmeyr aa67f95027 bts: allow configuring ARFCN and BSIC: add to schema
resources.conf is already allowed to set these, but in order to let
scenarios and suites modify these values, they need to be in the schema.

Change-Id: I8e0583e9208d563c66b0bdc9f25b1b74f92403c2
2020-12-11 00:19:13 +01:00
Neels Hofmeyr ca155b6c37 bsc: add active lchan matching via vty
Will be used in upcoming handover_2G test suite in
I0b2671304165a1aaae2b386af46fbd8b098e3bd8, which needs to verify that a
handover actually ended up on the expected lchan.

Change-Id: I03df8f3ae2ee47930eee311c7ce104c36dbb3154
2020-12-11 00:19:13 +01:00
Neels Hofmeyr af4e2317dc add bsc.vty: always keep a BSC VTY connection ready
The BSC's VTY port will be used to trigger manual handover, and to
retrieve a list of active lchans from the BSC, in the upcoming
handover_2G test suite, I0b2671304165a1aaae2b386af46fbd8b098e3bd8.

Change-Id: I06652db04fc9e48748f3c2196334f5352e9cc48a
2020-12-11 00:19:13 +01:00
Neels Hofmeyr 106865a75f add osmo_vty.py
To trigger manual handovers, I need a VTY interface. The non-trivial
parts of this are copied from osmo-python-tests osmo_interact_vty.py.

Will be used in the upcoming handover_2G test suite in
I0b2671304165a1aaae2b386af46fbd8b098e3bd8.

Change-Id: I7c17b143b7c690b8c4105ee7c6272670046fa91d
2020-12-11 00:19:13 +01:00
Neels Hofmeyr b5a3d6732a cfg templates: log level and source basename last, log no category-hex
Makes for saner log output in stderr files.

Change-Id: I2755beffd18d6779367c04e4aaaed119d66eb3be
2020-12-10 23:03:27 +00:00
Nils Fürste 2af2b15e2e Process: Add remote_port as new parameter
remote_port defines a custom/additional port for
connections over ssh. It may be used in case several
ssh instances share one IP address.

Change-Id: I2c93fd2ea1c10c333d00eafd3c1066c35796e398
2020-11-30 16:32:51 +00:00
Andre Puschmann b33f36b9fb gnuradio_zmq_broker_remote: fix eNB port mapping for carrier aggregation
the mapping of ports didn't consider when a eNB had two ports for
different EARFCNs

Change-Id: I5548f67a3b37b03482e4b6172828fcd891e704a5
2020-11-30 14:27:10 +01:00
Andre Puschmann 65a9e741ad ms_amarisoft: fix various regressions
this patch fixes some regressions in the Amarisoft UE class,
the config template, etc. that have been undetected bc we never
executed tests with it.

Change-Id: I397e675a4018acf3372a3b7e29fd864703b2b919
2020-11-23 12:33:52 +01:00
Andre Puschmann 3166b6353e enb: add QAM64 support for UL
* add new UE feature
* enable in srsue.conf.templ
* add new table for maximum rates
* add config scenario to enable SIB option for QAM64

Change-Id: I6ac2c9989a761e91b93d76c2507f55f0140b202d
2020-11-20 11:50:43 +01:00
Andre Puschmann 635edb33c3 schema: allow empty lists in resource schema
Change-Id: I9249e29deef00d4dd68f89c704ef1d3093c799fd
2020-11-11 17:16:21 +01:00
Nils Fürste ca6efa9359 epc_srs.py: Fixed reference in local execution
fixes local execution of srsEPC

Change-Id: I36db8f2f65be6c92ccea050f550e21b67bb9e50e
2020-11-11 12:47:47 +01:00
Nils Fürste 1e736ea46e {enb,ms}_srs: Add DL QAM-256 support
Due to the integration of DL-QAM256 another table for DL max rates is needed.
Therefore, I added the parameter 'qam256' to the feature list in the resource.cfg.

The patch also enables the correct UE settings in the config file.

Change-Id: I2d34395449cdcfb31db66ea887d9adbee551e757
2020-11-11 12:47:47 +01:00
Pau Espin 600c799ee0 resource: Support waiting for reserved resources until available
Before this patch, almost everything was in place to support concurrent
osmo-gsm-tester instances sharing a common state dir. However, during
resource reservation, if the reservation couldn't be done due to too
many resources being in use, osmo-gsm-tester would fail and skip the
test suite.
With this patch, OGT will wait until some reserved resources are
released and then try requesting the reservation again.

Change-Id: I938602ee890712fda82fd3f812d8edb1bcd05e08
2020-11-11 11:38:35 +00:00
Pau Espin ef7256a138 enb: Support cells from different ENBs in ncell_list
Change-Id: I1242c56ff42caea06e7f96317def82064fd11325
2020-11-09 18:54:26 +01:00
Andre Puschmann a7fd39448c srsenb_rr.conf: add PCI, TAC and root_seq_idx as cell param
make sure to insert cell specific TAC, PCI and root seq ind
into cell config and do not depend on cell index for a particular
enb. This causes issues in multi-eNB setups.

Change-Id: I6642128a449a0562dd23f7fa393ff48ae2503006
2020-11-09 13:10:21 +01:00
Pau Espin 4acb45a381 enb: Fix non-1st ENB gnubreaker remote address
ENB was using its own address as a remote address when the broker is
used, which actually only holds true for the first ENB (since the broker
is currently run on the same host/address of the first ENB).

Change-Id: I5c83075d140632846c6d357152963754d16b4633
2020-10-23 14:29:03 +02:00
Pau Espin a2d4e2f54e enb: Name preferrably by label, use it in remote run dir
This way several ENB will place its config and logs into different dirs.

Change-Id: I9b0c74cd63bc3888f380c66d94271beafc0db915
2020-10-22 16:04:12 +02:00
Pau Espin d6deb2824f Copy gnuradio zmq broker at runtime
The remotely run script is moved into a new subdir called "external",
where external utils to be used by osmo-gsm-tester (exernal to its own
process) are placed.
It needs to be in another directory because python files in obj/ are
loaded at startup of osmo-gsm-tester to dynamically load schemas.

Change-Id: I633a85294694f2c6efd58535729e9b8af166b3ff
2020-10-22 11:28:26 +02:00
Pau Espin 17f7c38755 sysmocom: emergency_preemptive_call.py: Avoid test failure if 2nd call not fully established
It may happen that the non-emergency call MT leg is still not properly
released when the emergency call MT leg is to be assigned a TCH, meaning
BSC will fail with an Assignment Failure upon Assignment request from
MSC.
The test sometimes passed and sometimes didn't, due to above mentioned
race condition. Let's relax a bit the test expectancies to have it
always passing, while still verifying preemption happens, and MT phone
is reached.

Related: OS#4549
Change-Id: I3697227cac56a1327f9ea08c5c2f52568e8d2a8a
2020-10-21 18:02:07 +02:00
Pau Espin fbb8611381 gnuradio zmq broker refactoring
First step towards support everal ENBs and installing the remote script
at runtime:

* The gnuradio broker class is moved to its own file, to decouple it
  from RFemu.
* The ENBs are registered earlier in the test so that the GrBroker knows
  when to start (delay start + setup until all ENBs have been configured).
* Handle ENBs internally as a list.

Change-Id: I4f1095bbc7ed0a816fe47caef44f7becadd9d737
2020-10-16 18:23:58 +02:00
Andre Puschmann d5579fa38e rfemu_gnuradio_zmq: fix amplitude conversion
fix dB to amplitude conversion and adjust max attenuation value

Change-Id: I5a94d5d31e7dc85ab37bd281f95374ad825a41ff
2020-10-16 14:17:36 +00:00
Andre Puschmann d0682bad0f enb: add basic TDD config option
this patch adds the basic notion of FDD and TDD duplexing modes
to the eNB object. So far we've always assume FDD.

Since only Amarisoft eNB supports TDD, the required config
template changes, etc. are only applied there.

The patch also adds a scenario to enable the default TDD config.

Change-Id: I37216b5bfdf527d221913283b6c41d3c8fd6b500
2020-10-16 14:17:36 +00:00
Pau Espin 680ba03038 sysmocom: Introduce suite to test emergency calls
Change-Id: I2e851c94311ded0abd4ff072b8cc72316d972750
2020-10-15 15:50:48 +00:00
Pau Espin 83a2fdca9b ms: Allocate default msisdn internally
Don't wait until adding it to the subscriber data base, since the msisdn
may be needed beforehand (for instance in follow up patch to be passed
to osmo-msc configuration to route emergency calls).

Change-Id: I0d6902687e4beb3d6cdcefd4e343f21496100504
2020-10-15 15:50:48 +00:00
Pau Espin 410912333e 4g: Introduce ZMQ GnuRadio stream broker
srsENB currently creates 1 zmq stream (1 tx, 1 rx) for each cell (2 if
MIMO is enabled). Each cell transceives on a given EARFCN (and several
cells can transmit on same EARFCN).

However, for handover test purposes, we want to join all cells operating
on the same EARFCN to transceive on the same ZMQ conn, so that an srsUE
can interact with them at the same time (same as if the medium was shared).
Furthermore, we want to set different gains on each of those paths
before merging them in order to emulate RF conditions like handover.

In order to do so, a new element called the Broker is introduced, which
is placed in between ENBs and UEs ZMQ conenctions, multiplexing the
connections on the ENB side towards the UE side.

A separate process for the broker is run remotely (ENB run host) which
listens on a ctrl socket for commands. An internal Broker class is used
in osmo-gsm-tester to interact with the remote script, for instance to
configure the ports, start and stop the remote process, send commands to
it, etc.
On each ENB, when the rfemu "gnuradio_zmq" rfemu implementation is selected
in configuration, it will configure its zmq connections and the UE ones to
go over the Broker.

As a result, that means the UE zmq port configuration is expected to be
different than when no broker is in used, since there's the multiplexing
per EARFCN in between.

In this commit, only 1 ENB is supported, but multi-enb support is
planned in the future.

The handover test passes in the docker setup with this config:
"""
OSMO_GSM_TESTER_OPTS="-T -l dbg -s 4g:srsue-rftype@zmq+srsenb-rftype@zmq+" \
	"mod-enb-nprb@6+mod-enb-ncells@2+mod-enb-cells-2ca+suite-4g@10,2+" \
	"mod-enb-meas-enable -t =handover.py"
"""

and in resources.conf (or scenario), added:
"""
enb:
  ...
  cell_list:
    - dl_rfemu:
       type: gnuradio_zmq
    - dl_rfemu:
        type: gnuradio_zmq
"""

Note that since the broker is used, there's not need for mod-srsue-ncarriers@2
since the broker is joining the 2 enb cells into 1 stream on the UE side.

Change-Id: I6282cda400558dcb356276786d91e6388524c5b1
2020-10-15 12:34:36 +00:00
Pau Espin 4b7c585561 ms: Fix and use ms msisdn() getter
The getter method was named the same as the itnernal field, and hence
when used it would fail since the intenral field would be sleect and
fail to be called.

Change-Id: I2f631eb6256eb0e065f41d5b7531395c4a054cd8
2020-10-15 14:01:27 +02:00
Pau Espin 92a29d6b7e enb/ue: Assign zmq binding ports dynamically at runtime
ports are assigned increasingly in blocks in the range 2000-2200.

Change-Id: If2abddeb2ad6819de4f3ce64daaf00d2f527f9d2
2020-10-15 11:57:01 +00:00
Pau Espin d0e8601ace templates/osmo-bts-trx: Increase osmo-trx rx-gain
Otherwise osmo-trx with a B200 seems to be having issues receiving some
data from the MS otherwise, making "sms" test fail. In general LU works
fine, and when MS sends the SMS, CM Service Request+Accept also works
fine, but then the BTS never sees the CP-DATA afterwards probably due to
MS power loop.

Change-Id: I5f7e3d22a142521ab83db81635ded252dabcf111
2020-10-14 10:59:55 +00:00
Andre Puschmann e3f40f9904 rfemu_srsenb_stdin: use negative dB value to set attenuation
the logic for the RF emulator on the command line is, like the
Amarisoft equivalent, to set a negative gain value to express
attenuation. Therefore, the sign needs to be inverted.

Change-Id: I7b6ac611a9f711bbdc1570602bfd797a5346ab86
2020-10-13 18:05:28 +02:00
Andre Puschmann 54307cbf09 {enb,epc,ms}_srs: remove uneeded class variable
self.kpis is define in base class

Change-Id: I49c9c9cdf7bc31270d3cfe182a79b197a742dd2c
2020-10-13 17:57:38 +02:00
Pau Espin 10c64fee41 srsenb: Activate handover in config file
This is needed to test handover features.

Change-Id: Ifa8462f4d1e183e73b059a7af37bcdf7b3e247f6
2020-10-13 09:55:45 +02:00
Pau Espin 9ff1eabdb1 srsenb: Fix ECI in handover cell list
So far we only support setting cell IDs from same ENB. Support for
handover to other ENB will come later, probably by adding some API to be
called during the test to add own's CellID's to other ENB's config.t

Change-Id: I1780bda130cde0faab15d4032117e0aa2b9c5dbe
2020-10-12 20:58:01 +02:00
Pau Espin 1f46d24935 Introduce RFemu stdin implementation for srsENB
Change-Id: I5487dec3691cbf424306369f94f337ed34a10c70
2020-10-12 20:46:58 +02:00
Andre Puschmann b5f0444021 srs{enb,ue}: add rf_dev_sync option to config templates
pass-through the option so they can be used in templates

just concatenate with rf_dev_args for srsLTE eNB/UE, arguments
parsing will handle them

Change-Id: I3818026c159780f29968888f547163cdf730afad
2020-10-12 17:27:25 +02:00
Andre Puschmann c489f190be enb_amarisoft: add rf_dev_sync option to specify the sync type
this allows to specify "external_clock" for example to use
the external REF input of an USRP

Change-Id: Ie066993440840cbd2c18e8f0c0c577b92ac7092d
2020-10-12 16:47:11 +02:00
Andre Puschmann e3a1910915 ms_srs: add freq_offset as resource param
this allows to specify a freq tuning offset in Hz in the MS resource config

Change-Id: Iab726edd27e890d2c2dddbea91afe80d8a5068aa
2020-10-06 09:52:46 +02:00
Andre Puschmann 182109db4d srslte_common: fix indent in whole file
Change-Id: I8aee79e9d451761dde8f35f84d75483dc4e23040
2020-10-05 20:03:13 +02:00
Andre Puschmann f4fb48af9a srslte_common: add get_num_phy_errors() method
the get_num_phy_errors() uses the external KPI analyzer module
to calculate the number of PHY layers errors in a vector of log metrics

Change-Id: I0c8de87e7f83f986e288585640ce56847959c497
2020-10-05 15:24:17 +02:00
Andre Puschmann a9bbbd64e4 amarisoft_enb.cfg.tmpl: seperate PRACH root sequences for cells
seperate the root sequence index for each cell a bit more to
avoid detection of a single PRACH in both cells

Change-Id: I5aea1a27939c880944779c282e902465ab513715
2020-10-05 13:49:12 +02:00
Andre Puschmann c1c2f3d16f enb_amarisoft: reduce max achievable UL rate for 100 PRB
Change-Id: Ib7a0b8e2948cdf6c0a15d4ad2bf7d218a6b28ea2
2020-10-05 13:49:12 +02:00
Andre Puschmann 51fa941994 amarisoft_enb.cfg.tmpl: increas threshold for failed UL retransmissions
this avoids the eNB from releasing the UE too early if the UL channel
stays very bad for a longer time but many PUSCH are scheduled

Change-Id: Ib82616e920eecc70fbded12433e54bd90ae1bcd4
2020-10-05 13:49:12 +02:00
Andre Puschmann 0e00f38aa2 lte: update UHD device args for MIMO usage
the USRP B210 device args were not ideal for MIMO configs for
both Amarisoft and srsLTE.

Change-Id: I3785bb96eb7c10a6b10b3d1a86fa71d1f787a7a3
2020-10-05 13:49:12 +02:00
Andre Puschmann 0908ceb0eb amarisoft_enb.cfg.tmpl: use default tac 0007
this is the tac used in srsepc.

Change-Id: I1de432a52281ea210abae5648239fd89ba5eb4ce
2020-10-05 13:49:12 +02:00
Andre Puschmann dda20e27e9 amarisoft_sib23.asn.tmpl: set p-b value in SIB23 depending on TM
this fixes a wrong p-b value used for TM2 and above

Change-Id: I89c557c456f3330f491cc66bc4931a0234bf6e02
2020-10-05 13:49:12 +02:00
Andre Puschmann a9fb751e69 ms_srs: fix ZMQ config for 4xCA
add missing freq config for 4xCA

Change-Id: I88a389f5b03d6b55ff5ef403d5107c648a11686f
2020-10-05 13:49:12 +02:00
Andre Puschmann eb991f5f5a srsenb_rr.conf.tmpl: set TAC for cells to 0x0007
this is the default TAC used in the EPC. A recent EPC patch
will reject the S1 setup request if the TACs don't match

Change-Id: I94fdb96631ce3ae35a1b2a9f90d1101df9161233
2020-10-05 13:49:12 +02:00
Andre Puschmann 99fb78bfca {enb,epc,ms}_srs: refactor start/stop and KPI helpers
refactor some of the functionality to srslte_common

Change-Id: I2ff36df6f1a07ed8ddac39d296d62fe44a215283
2020-10-05 13:49:12 +02:00
Andre Puschmann 3d3bbcb3ae reduce max expected UL rate for 4xCA 100 PRB
this needs to be reverte once extendedBSRs are supported

Change-Id: I8432c744868afe43e2b150f6fcecd8cb3a0458a3
2020-10-05 13:49:12 +02:00
Andre Puschmann 52fb33cd9c srsenb_rr.conf.example: comment CQI and SR specific subframes
this enables auto-selection by eNB which has been implemented
recently

Change-Id: I17e16c5c47a2fba5c2955a1c3e6e0e16f83bab72
2020-10-05 13:49:12 +02:00
Andre Puschmann 645b5ccd8e enb_amarisoft: temporary reduce max UL rate on 2nd CC
this is due to a confirmed bug in Amarisoft eNB. will
be reverted as soon as the fix is released.

Change-Id: I182b46cf9e6c2f428c9535edf3c7df3daa912f18
2020-10-05 13:49:12 +02:00