Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_20.04/x86_64

2020-12-10 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_20.04/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in 
xUbuntu_20.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  117s] [COMPILING libboard/qmod/source/wwan_perst.c]
[  117s] [COMPILING libboard/qmod/source/card_pres.c]
[  117s] [COMPILING libboard/qmod/source/wwan_led.c]
[  117s] [COMPILING libboard/qmod/source/i2c.c]
[  117s] [COMPILING libboard/qmod/source/board_qmod.c]
[  117s] [COMPILING apps/dfu/main.c]
[  117s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu.c]
[  117s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_desc.c]
[  117s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c]
[  118s] Memory region Used Size  Region Size  %age Used
[  118s]  rom:   16588 B16 KB101.25%
[  118s]  ram:   11672 B48 KB 
23.75/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom'
[  118s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: region 
`rom' overflowed by 204 bytes
[  118s] collect2: error: ld returned 1 exit status
[  118s] %
[  118s] make[2]: *** [Makefile:234: flash] Error 1
[  118s] make[2]: Leaving directory '/usr/src/packages/BUILD/firmware'
[  118s] make[1]: *** [Makefile:13: fw-qmod-dfu] Error 2
[  118s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  118s] dh_auto_build: error: make -j1 returned exit code 2
[  118s] make: *** [debian/rules:16: build] Error 25
[  118s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  118s] ### VM INTERACTION START ###
[  121s] [  110.075051] sysrq: Power Off
[  121s] [  110.077999] reboot: Power down
[  121s] ### VM INTERACTION END ###
[  121s] 
[  121s] sheep85 failed "build simtrace2_0.7.0.69.aadd.dsc" at Fri Dec 11 
02:06:25 UTC 2020.
[  121s] 

-- 
Configure notifications at https://build.opensuse.org/my/subscriptions
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_20.10/x86_64

2020-12-10 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_20.10/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in 
xUbuntu_20.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  222s] [COMPILING apps/dfu/main.c]
[  222s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu.c]
[  222s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_desc.c]
[  222s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c]
[  223s] Memory region Used Size  Region Size  %age Used
[  223s]  rom:   16580 B16 KB101.20%
[  223s]  ram:   11672 B48 KB 
23.75/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: warning: 
changing start of section .stack by 4 bytes
[  223s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  223s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom'
[  223s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  223s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  223s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  223s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: region 
`rom' overflowed by 196 bytes
[  223s] collect2: error: ld returned 1 exit status
[  223s] %
[  223s] make[2]: *** [Makefile:234: flash] Error 1
[  223s] make[2]: Leaving directory '/usr/src/packages/BUILD/firmware'
[  223s] make[1]: *** [Makefile:13: fw-qmod-dfu] Error 2
[  223s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  223s] dh_auto_build: error: make -j1 returned exit code 2
[  223s] make: *** [debian/rules:16: build] Error 25
[  223s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  223s] ### VM INTERACTION START ###
[  226s] [  208.845060] sysrq: Power Off
[  226s] [  208.855865] reboot: Power down
[  226s] ### VM INTERACTION END ###
[  226s] 
[  226s] lamb04 failed "build simtrace2_0.7.0.69.aadd.dsc" at Fri Dec 11 
02:02:21 UTC 2020.
[  226s] 

-- 
Configure notifications at https://build.opensuse.org/my/subscriptions
openSUSE Build Service (https://build.opensuse.org/)


Change in osmo-gsm-tester[master]: OsmoCtrl: use one global common counter for CTRL IDs

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21567 )

Change subject: OsmoCtrl: use one global common counter for CTRL IDs
..

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
---
M src/osmo_gsm_tester/obj/osmo_ctrl.py
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/obj/osmo_ctrl.py 
b/src/osmo_gsm_tester/obj/osmo_ctrl.py
index 6c4ac87..3098960 100644
--- a/src/osmo_gsm_tester/obj/osmo_ctrl.py
+++ b/src/osmo_gsm_tester/obj/osmo_ctrl.py
@@ -39,17 +39,17 @@
 pass

 class OsmoCtrl(log.Origin):
+_next_id = 1

 def __init__(self, host, port):
 super().__init__(log.C_BUS, 'Ctrl', host=host, port=port)
 self.host = host
 self.port = port
 self.sck = None
-self._next_id = 0

 def next_id(self):
-ret = self._next_id
-self._next_id += 1
+ret = OsmoCtrl._next_id
+OsmoCtrl._next_id += 1
 return ret

 def prefix_ipa_ctrl_header(self, data):

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21567
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I44c51f4fb5beb6cedf98ea0d6684a24c6aa418c7
Gerrit-Change-Number: 21567
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: run handover_2G in default-suites.conf

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21524 )

Change subject: run handover_2G in default-suites.conf
..

run handover_2G in default-suites.conf

Change-Id: Ic6bb013cc2c395211eeb86fe7a3d3f42671793c7
---
M sysmocom/default-suites.conf
1 file changed, 37 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/sysmocom/default-suites.conf b/sysmocom/default-suites.conf
index b32d7b1..5ebd9d1 100644
--- a/sysmocom/default-suites.conf
+++ b/sysmocom/default-suites.conf
@@ -172,3 +172,40 @@
 - encryption

 - 4g:srsenb-rftype@zmq+srsue-rftype@zmq
+
+- handover_2G:nanobts+bts1-oc2g
+- handover_2G:nanobts+bts1-octphy
+- handover_2G:nanobts+bts1-trx-lms
+- handover_2G:nanobts+bts1-trx-lms-limenet-micro
+- handover_2G:nanobts+bts1-trx-sysmocell5000
+- handover_2G:nanobts+bts1-sysmo
+- handover_2G:nanobts+bts1-trx-b200
+- handover_2G:nanobts+bts1-trx-umtrx
+- handover_2G:oc2g+bts1-octphy
+- handover_2G:oc2g+bts1-trx-lms
+- handover_2G:oc2g+bts1-trx-lms-limenet-micro
+- handover_2G:oc2g+bts1-trx-sysmocell5000
+- handover_2G:oc2g+bts1-sysmo
+- handover_2G:oc2g+bts1-trx-b200
+- handover_2G:oc2g+bts1-trx-umtrx
+- handover_2G:octphy+bts1-trx-lms
+- handover_2G:octphy+bts1-trx-lms-limenet-micro
+- handover_2G:octphy+bts1-trx-sysmocell5000
+- handover_2G:octphy+bts1-sysmo
+- handover_2G:octphy+bts1-trx-b200
+- handover_2G:octphy+bts1-trx-umtrx
+- handover_2G:trx-lms+bts1-trx-lms-limenet-micro
+- handover_2G:trx-lms+bts1-trx-sysmocell5000
+- handover_2G:trx-lms+bts1-sysmo
+- handover_2G:trx-lms+bts1-trx-b200
+- handover_2G:trx-lms+bts1-trx-umtrx
+- handover_2G:trx-lms-limenet-micro+bts1-trx-sysmocell5000
+- handover_2G:trx-lms-limenet-micro+bts1-sysmo
+- handover_2G:trx-lms-limenet-micro+bts1-trx-b200
+- handover_2G:trx-lms-limenet-micro+bts1-trx-umtrx
+- handover_2G:trx-sysmocell5000+bts1-sysmo
+- handover_2G:trx-sysmocell5000+bts1-trx-b200
+- handover_2G:trx-sysmocell5000+bts1-trx-umtrx
+- handover_2G:sysmo+bts1-trx-b200
+- handover_2G:sysmo+bts1-trx-umtrx
+- handover_2G:trx-b200+bts1-trx-umtrx

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21524
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ic6bb013cc2c395211eeb86fe7a3d3f42671793c7
Gerrit-Change-Number: 21524
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: keep Ctrl connections open for bsc, msc and nitb objects

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21670 )

Change subject: keep Ctrl connections open for bsc, msc and nitb objects
..

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
---
M src/osmo_gsm_tester/obj/bsc_osmo.py
M src/osmo_gsm_tester/obj/msc_osmo.py
M src/osmo_gsm_tester/obj/nitb_osmo.py
M src/osmo_gsm_tester/testenv.py
4 files changed, 37 insertions(+), 14 deletions(-)



diff --git a/src/osmo_gsm_tester/obj/bsc_osmo.py 
b/src/osmo_gsm_tester/obj/bsc_osmo.py
index 510063a..877db29 100644
--- a/src/osmo_gsm_tester/obj/bsc_osmo.py
+++ b/src/osmo_gsm_tester/obj/bsc_osmo.py
@@ -50,6 +50,7 @@
 self.mgw = mgw
 self.stp = stp
 self.vty = None
+self.ctrl = None

 def start(self):
 self.log('Starting osmo-bsc')
@@ -84,6 +85,9 @@
 self.vty = OsmoBscVty(self)
 self.vty.connect()

+self.ctrl = OsmoBscCtrl(self)
+self.ctrl.connect()
+
 def configure(self):
 self.config_file = self.run_dir.new_file('osmo-bsc.cfg')
 self.dbg(config_file=self.config_file)
@@ -149,10 +153,8 @@
 # over this list, we have a 1:1 match in indexes.
 return self.bts.index(bts)

-def bts_is_connected(self, bts, use_ctrl=None):
-if use_ctrl is None:
-use_ctrl = self.ctrl()
-return use_ctrl.bts_is_connected(self.bts_num(bts))
+def bts_is_connected(self, bts):
+return self.ctrl.bts_is_connected(self.bts_num(bts))

 def running(self):
 return not self.process.terminated()
@@ -161,9 +163,9 @@
 if self.vty is not None:
 self.vty.disconnect()
 self.vty = None
-
-def ctrl(self):
-return OsmoBscCtrl(self)
+if self.ctrl is not None:
+self.ctrl.disconnect()
+self.ctrl = None

 class OsmoBscCtrl(osmo_ctrl.OsmoCtrl):
 def __init__(self, bsc, port=4249):
diff --git a/src/osmo_gsm_tester/obj/msc_osmo.py 
b/src/osmo_gsm_tester/obj/msc_osmo.py
index 5a7c0ba..550fb87 100644
--- a/src/osmo_gsm_tester/obj/msc_osmo.py
+++ b/src/osmo_gsm_tester/obj/msc_osmo.py
@@ -49,6 +49,7 @@
 self.mgw = mgw
 self.stp = stp
 self.smsc = smsc.Smsc((ip_address.get('addr'), 2775))
+self.ctrl = None

 def start(self):
 self.log('Starting osmo-msc')
@@ -75,6 +76,9 @@
 self.testenv.remember_to_stop(self.process)
 self.process.launch()

+self.ctrl = OsmoMscCtrl(self)
+self.ctrl.connect()
+
 def configure(self):
 self.config_file = self.run_dir.new_file('osmo-msc.cfg')
 self.dbg(config_file=self.config_file)
@@ -147,7 +151,7 @@
 return all([(imsi in attached) for imsi in imsis])

 def imsi_list_attached(self):
-return OsmoMscCtrl(self).subscriber_list_active()
+return self.ctrl.subscriber_list_active()

 def set_emergency_call_msisdn(self, msisdn):
 self.dbg('Setting Emergency Call MSISDN', msisdn=msisdn)
@@ -156,6 +160,11 @@
 def running(self):
 return not self.process.terminated()

+def cleanup(self):
+if self.ctrl is not None:
+self.ctrl.disconnect()
+self.ctrl = None
+

 class OsmoMscCtrl(osmo_ctrl.OsmoCtrl):
 def __init__(self, msc, port=4255):
diff --git a/src/osmo_gsm_tester/obj/nitb_osmo.py 
b/src/osmo_gsm_tester/obj/nitb_osmo.py
index ea00a75..a978b71 100644
--- a/src/osmo_gsm_tester/obj/nitb_osmo.py
+++ b/src/osmo_gsm_tester/obj/nitb_osmo.py
@@ -36,6 +36,7 @@
 self.ip_address = ip_address
 self.bts = []
 self.smsc = smsc.Smsc((ip_address.get('addr'), 2775))
+self.ctrl = None

 def start(self):
 self.log('Starting osmo-nitb')
@@ -62,6 +63,9 @@
 self.testenv.remember_to_stop(self.process)
 self.process.launch()

+self.ctrl = OsmoNitbCtrl(self)
+self.ctrl.connect()
+
 def configure(self):
 self.config_file = self.run_dir.new_file('osmo-nitb.cfg')
 self.dbg(config_file=self.config_file)
@@ -134,11 +138,11 @@
 raise log.Error("Auth algo %r selected and no KI specified" % algo)

 self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi())
-OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki(), 
algo)
+return self.ctrl.subscriber_add(modem.imsi(), msisdn, modem.ki(

Change in osmo-gsm-tester[master]: add option osmo-gsm-tester.py --suites-file my-suites-listing.conf

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21566 )

Change subject: add option osmo-gsm-tester.py --suites-file 
my-suites-listing.conf
..

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
---
M src/osmo-gsm-tester.py
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py
index cfe55f6..15b1923 100755
--- a/src/osmo-gsm-tester.py
+++ b/src/osmo-gsm-tester.py
@@ -109,6 +109,11 @@
 parser.add_argument('-s', '--suite-scenario', dest='suite_scenario', 
action='append',
 help='''A suite-scenarios combination
 like suite:scenario+scenario''')
+parser.add_argument('-S', '--suites-file', dest='suites_file', 
action='append',
+default=[],
+help='''Read suites to run from a yml listing,
+like default-suites.conf. The path is relative to
+--conf-path.''')
 parser.add_argument('-t', '--test', dest='test', action='append',
 help='''Run only tests matching this name.
 Any test name that contains the given string is run.
@@ -151,6 +156,12 @@

 combination_strs = list(args.suite_scenario or [])

+for suites_file in args.suites_file:
+suites_file = config.main_config_path_to_abspath(suites_file)
+from_this_file = config.read(suites_file)
+print(('Running suites from %r:\n  ' % suites_file) + ('\n  
'.join(from_this_file)))
+combination_strs.extend(from_this_file)
+
 if not combination_strs:
 combination_strs = 
config.read_config_file(config.CFG_DEFAULT_SUITES_CONF, if_missing_return=[])


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21566
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: If896ac84d02a275deda2f20a93c29312df128ebb
Gerrit-Change-Number: 21566
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: add handover_2G suite, with handover.py test

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21523 )

Change subject: add handover_2G suite, with handover.py test
..

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
---
M src/osmo_gsm_tester/testenv.py
A sysmocom/handover-suites.conf
A sysmocom/scenarios/bts1-nanobts.conf
A sysmocom/scenarios/bts1-oc2g.conf
A sysmocom/scenarios/bts1-octphy.conf
A sysmocom/scenarios/bts1-sysmo.conf
A sysmocom/scenarios/bts1-trx-b200.conf
A sysmocom/scenarios/bts1-trx-lms-limenet-micro.conf
A sysmocom/scenarios/bts1-trx-lms.conf
A sysmocom/scenarios/bts1-trx-sysmocell5000.conf
A sysmocom/scenarios/bts1-trx-umtrx.conf
A sysmocom/suites/handover_2G/handover.py
A sysmocom/suites/handover_2G/suite.conf
13 files changed, 309 insertions(+), 0 deletions(-)



diff --git a/src/osmo_gsm_tester/testenv.py b/src/osmo_gsm_tester/testenv.py
index dc7aee0..e1d3a0a 100644
--- a/src/osmo_gsm_tester/testenv.py
+++ b/src/osmo_gsm_tester/testenv.py
@@ -31,6 +31,7 @@
 from .core import resource
 from .core.event_loop import MainLoop

+test = None
 suite = None
 log = None
 dbg = None
diff --git a/sysmocom/handover-suites.conf b/sysmocom/handover-suites.conf
new file mode 100644
index 000..623bbfb
--- /dev/null
+++ b/sysmocom/handover-suites.conf
@@ -0,0 +1,36 @@
+- handover_2G:nanobts+bts1-oc2g
+- handover_2G:nanobts+bts1-octphy
+- handover_2G:nanobts+bts1-trx-lms
+- handover_2G:nanobts+bts1-trx-lms-limenet-micro
+- handover_2G:nanobts+bts1-trx-sysmocell5000
+- handover_2G:nanobts+bts1-sysmo
+- handover_2G:nanobts+bts1-trx-b200
+- handover_2G:nanobts+bts1-trx-umtrx
+- handover_2G:oc2g+bts1-octphy
+- handover_2G:oc2g+bts1-trx-lms
+- handover_2G:oc2g+bts1-trx-lms-limenet-micro
+- handover_2G:oc2g+bts1-trx-sysmocell5000
+- handover_2G:oc2g+bts1-sysmo
+- handover_2G:oc2g+bts1-trx-b200
+- handover_2G:oc2g+bts1-trx-umtrx
+- handover_2G:octphy+bts1-trx-lms
+- handover_2G:octphy+bts1-trx-lms-limenet-micro
+- handover_2G:octphy+bts1-trx-sysmocell5000
+- handover_2G:octphy+bts1-sysmo
+- handover_2G:octphy+bts1-trx-b200
+- handover_2G:octphy+bts1-trx-umtrx
+- handover_2G:trx-lms+bts1-trx-lms-limenet-micro
+- handover_2G:trx-lms+bts1-trx-sysmocell5000
+- handover_2G:trx-lms+bts1-sysmo
+- handover_2G:trx-lms+bts1-trx-b200
+- handover_2G:trx-lms+bts1-trx-umtrx
+- handover_2G:trx-lms-limenet-micro+bts1-trx-sysmocell5000
+- handover_2G:trx-lms-limenet-micro+bts1-sysmo
+- handover_2G:trx-lms-limenet-micro+bts1-trx-b200
+- handover_2G:trx-lms-limenet-micro+bts1-trx-umtrx
+- handover_2G:trx-sysmocell5000+bts1-sysmo
+- handover_2G:trx-sysmocell5000+bts1-trx-b200
+- handover_2G:trx-sysmocell5000+bts1-trx-umtrx
+- handover_2G:sysmo+bts1-trx-b200
+- handover_2G:sysmo+bts1-trx-umtrx
+- handover_2G:trx-b200+bts1-trx-umtrx
diff --git a/sysmocom/scenarios/bts1-nanobts.conf 
b/sysmocom/scenarios/bts1-nanobts.conf
new file mode 100644
index 000..2425b7f
--- /dev/null
+++ b/sysmocom/scenarios/bts1-nanobts.conf
@@ -0,0 +1,4 @@
+resources:
+  bts:
+  - {}
+  - type: nanobts
diff --git a/sysmocom/scenarios/bts1-oc2g.conf 
b/sysmocom/scenarios/bts1-oc2g.conf
new file mode 100644
index 000..ff45d8e
--- /dev/null
+++ b/sysmocom/scenarios/bts1-oc2g.conf
@@ -0,0 +1,4 @@
+resources:
+  bts:
+  - {}
+  - type: osmo-bts-oc2g
diff --git a/sysmocom/scenarios/bts1-octphy.conf 
b/sysmocom/scenarios/bts1-octphy.conf
new file mode 100644
index 000..2eb51d1
--- /dev/null
+++ b/sysmocom/scenarios/bts1-octphy.conf
@@ -0,0 +1,4 @@
+resources:
+  bts:
+  - {}
+  - type: osmo-bts-octphy
diff --git a/sysmocom/scenarios/bts1-sysmo.conf 
b/sysmocom/scenarios/bts1-sysmo.conf
new file mode 100644
index 000..fa466a8
--- /dev/null
+++ b/sysmocom/scenarios/bts1-sysmo.conf
@@ -0,0 +1,4 @@
+resources:
+  bts:
+  - {}
+  - type: osmo-bts-sysmo
diff --git a/sysmocom/scenarios/bts1-trx-b200.conf 
b/sysmocom/scenarios/bts1-trx-b200.conf
new file mode 100644
index 000..9927b88
--- /dev/null
+++ b/sysmocom/scenarios/bts1-trx-b200.conf
@@ -0,0 +1,5 @@
+resources:
+  bts:
+  - {}
+  - label: Ettus B200
+type: osmo-bts-trx
diff --git a/sysmocom/scenarios/bts1-trx-lms-limenet-micro.conf 
b/sysmocom/scenarios/bts1-trx-lms-limenet-micro.conf
new file mode 100644
index 000..e0536ec
--- /dev/null
+++ b/sysmocom/scenarios/bts1-trx-lms-limenet-micro.conf
@@ -0,0 +1,5 @@
+resources:
+  bts:
+  - {}
+  - label: LimeNET-Micro
+type: osmo-bts-trx
diff --git a/sysmocom/scenarios/bts1-trx-lms.conf 
b/sysmocom/scenarios/bts1-trx-lms.conf
new file mode 100644
index 000..df644c0
--- /dev/null
+++ b/sysmocom/scenarios/bts1-trx-lms.conf
@@ -0,0 +1,5 @@
+resources:
+  bts:
+  - {}
+  - label: LimeSDR-USB
+type: osmo-bts-trx
diff --git a/sysm

Change in osmo-gsm-tester[master]: process output: do not leak ANSI colors past logged stdout/stderr

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21565 )

Change subject: process output: do not leak ANSI colors past logged 
stdout/stderr
..

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
---
M src/osmo_gsm_tester/core/process.py
1 file changed, 2 insertions(+), 2 deletions(-)



diff --git a/src/osmo_gsm_tester/core/process.py 
b/src/osmo_gsm_tester/core/process.py
index 9cde7de..09dce55 100644
--- a/src/osmo_gsm_tester/core/process.py
+++ b/src/osmo_gsm_tester/core/process.py
@@ -338,7 +338,7 @@
 with open(path, 'r') as f:
 if since_mark > 0:
 f.seek(since_mark)
-return f.read()
+return self.end_ansi_colors(f.read())

 def get_output_file(self, which):
 ''' Return filename for given output '''
@@ -354,7 +354,7 @@
 return None
 out = out.splitlines()
 tail = min(len(out), tail)
-return prefix + ('\n' + prefix).join(out[-tail:])
+return prefix + self.end_ansi_colors(('\n' + prefix).join(out[-tail:]))

 def get_output_mark(self, which):
 '''Usage:

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21565
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ib9ac1eea4a12d6d43ac8614491f016bbe9ca17b1
Gerrit-Change-Number: 21565
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: ctrl: set socket timeout

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21518 )

Change subject: ctrl: set socket timeout
..

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
---
M src/osmo_gsm_tester/obj/osmo_ctrl.py
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/obj/osmo_ctrl.py 
b/src/osmo_gsm_tester/obj/osmo_ctrl.py
index 312e1e9..891cc48 100644
--- a/src/osmo_gsm_tester/obj/osmo_ctrl.py
+++ b/src/osmo_gsm_tester/obj/osmo_ctrl.py
@@ -55,6 +55,7 @@
 self.sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 self.sck.connect((self.host, self.port))
 self.sck.setblocking(1)
+self.sck.settimeout(10)

 def disconnect(self):
 self.dbg('Disconnecting')

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21518
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I20091daf13981dc3d0d894af5a65c23f4db0471d
Gerrit-Change-Number: 21518
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: ctrl: increment message IDs for CTRL commands

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21519 )

Change subject: ctrl: increment message IDs for CTRL commands
..

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
---
M src/osmo_gsm_tester/obj/osmo_ctrl.py
1 file changed, 16 insertions(+), 4 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/obj/osmo_ctrl.py 
b/src/osmo_gsm_tester/obj/osmo_ctrl.py
index 891cc48..c2dd7e3 100644
--- a/src/osmo_gsm_tester/obj/osmo_ctrl.py
+++ b/src/osmo_gsm_tester/obj/osmo_ctrl.py
@@ -33,6 +33,12 @@
 self.host = host
 self.port = port
 self.sck = None
+self._next_id = 0
+
+def next_id(self):
+ret = self._next_id
+self._next_id += 1
+return ret

 def prefix_ipa_ctrl_header(self, data):
 if isinstance(data, str):
@@ -72,13 +78,19 @@
 self.dbg('Receiving', data=data)
 return data

-def do_set(self, var, value, id=0):
-setmsg = "SET %s %s %s" %(id, var, value)
+def do_set(self, var, value, use_id=None):
+if use_id is None:
+use_id = self.next_id()
+setmsg = "SET %s %s %s" %(use_id, var, value)
 self._send(setmsg)
+return use_id

-def do_get(self, var, id=0):
-getmsg = "GET %s %s" %(id, var)
+def do_get(self, var, use_id=None):
+if use_id is None:
+use_id = self.next_id()
+getmsg = "GET %s %s" %(use_id, var)
 self._send(getmsg)
+return use_id

 def __enter__(self):
 self.connect()

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21519
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I698faa013eb14f88759685d50d925f5d82d80aa0
Gerrit-Change-Number: 21519
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: osmo_ctrl.py: add RateCounters

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21522 )

Change subject: osmo_ctrl.py: add RateCounters
..

osmo_ctrl.py: add RateCounters

First user will be the upcoming handover_2G/handover.py test in
I0b2671304165a1aaae2b386af46fbd8b098e3bd8.

Change-Id: Id799b3bb81eb9c04d13c26ff611e40363920300e
---
A selftest/rate_ctrs_test/_prep.py
A selftest/rate_ctrs_test/rate_ctrs_test.err
A selftest/rate_ctrs_test/rate_ctrs_test.ok
A selftest/rate_ctrs_test/rate_ctrs_test.py
M src/osmo_gsm_tester/obj/osmo_ctrl.py
5 files changed, 453 insertions(+), 0 deletions(-)



diff --git a/selftest/rate_ctrs_test/_prep.py b/selftest/rate_ctrs_test/_prep.py
new file mode 100644
index 000..773f190
--- /dev/null
+++ b/selftest/rate_ctrs_test/_prep.py
@@ -0,0 +1,16 @@
+import sys, os
+
+script_dir = sys.path[0]
+top_dir = os.path.join(script_dir, '..', '..')
+src_dir = os.path.join(top_dir, 'src')
+
+# to find the osmo_gsm_tester py module
+sys.path.append(src_dir)
+
+from osmo_gsm_tester.core import log
+
+log.TestsTarget()
+log.set_all_levels(log.L_DBG)
+
+if '-v' in sys.argv:
+log.style_change(trace=True)
diff --git a/selftest/rate_ctrs_test/rate_ctrs_test.err 
b/selftest/rate_ctrs_test/rate_ctrs_test.err
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/selftest/rate_ctrs_test/rate_ctrs_test.err
diff --git a/selftest/rate_ctrs_test/rate_ctrs_test.ok 
b/selftest/rate_ctrs_test/rate_ctrs_test.ok
new file mode 100644
index 000..489f58f
--- /dev/null
+++ b/selftest/rate_ctrs_test/rate_ctrs_test.ok
@@ -0,0 +1,155 @@
+- empty RateCounters()
+|
+- initialized RateCounters, single var
+| rate_ctr.abs.inst.0.var = 0
+- incremented inst.var
+| rate_ctr.abs.inst.0.var = 1
+- incremented inst.var again
+| rate_ctr.abs.inst.0.var = 2
+- incremented inst.var by 5
+| rate_ctr.abs.inst.0.var = 7
+- initialized RateCounters, two vars
+| rate_ctr.abs.inst.0.foo = 0
+| rate_ctr.abs.inst.0.var = 0
+- incremented foo and var
+| rate_ctr.abs.inst.0.foo = 1
+| rate_ctr.abs.inst.0.var = 1
+- incremented var again
+| rate_ctr.abs.inst.0.foo = 1
+| rate_ctr.abs.inst.0.var = 2
+- incremented foo by 5
+| rate_ctr.abs.inst.0.foo = 6
+| rate_ctr.abs.inst.0.var = 2
+- initialized RateCounters, two vars, three instances
+| rate_ctr.abs.inst.0.foo = 0
+| rate_ctr.abs.inst.0.var = 0
+| rate_ctr.abs.inst.1.foo = 0
+| rate_ctr.abs.inst.1.var = 0
+| rate_ctr.abs.inst.2.foo = 0
+| rate_ctr.abs.inst.2.var = 0
+- incremented foo and var on separate instances
+| rate_ctr.abs.inst.0.foo = 1
+| rate_ctr.abs.inst.0.var = 0
+| rate_ctr.abs.inst.1.foo = 0
+| rate_ctr.abs.inst.1.var = 1
+| rate_ctr.abs.inst.2.foo = 0
+| rate_ctr.abs.inst.2.var = 0
+- incremented var on instance 2
+| rate_ctr.abs.inst.0.foo = 1
+| rate_ctr.abs.inst.0.var = 0
+| rate_ctr.abs.inst.1.foo = 0
+| rate_ctr.abs.inst.1.var = 1
+| rate_ctr.abs.inst.2.foo = 0
+| rate_ctr.abs.inst.2.var = 1
+- incremented foo by 5 on instances 1,2
+| rate_ctr.abs.inst.0.foo = 1
+| rate_ctr.abs.inst.0.var = 0
+| rate_ctr.abs.inst.1.foo = 5
+| rate_ctr.abs.inst.1.var = 1
+| rate_ctr.abs.inst.2.foo = 5
+| rate_ctr.abs.inst.2.var = 1
+- copy
+| rate_ctr.abs.inst.0.foo = 1
+| rate_ctr.abs.inst.0.var = 0
+| rate_ctr.abs.inst.1.foo = 5
+| rate_ctr.abs.inst.1.var = 1
+| rate_ctr.abs.inst.2.foo = 5
+| rate_ctr.abs.inst.2.var = 1
+- increment two vars by 100 on all three instances
+| rate_ctr.abs.inst.0.foo = 101
+| rate_ctr.abs.inst.0.var = 100
+| rate_ctr.abs.inst.1.foo = 105
+| rate_ctr.abs.inst.1.var = 101
+| rate_ctr.abs.inst.2.foo = 105
+| rate_ctr.abs.inst.2.var = 101
+- subtract original copy
+| rate_ctr.abs.inst.0.foo = 100
+| rate_ctr.abs.inst.0.var = 100
+| rate_ctr.abs.inst.1.foo = 100
+| rate_ctr.abs.inst.1.var = 100
+| rate_ctr.abs.inst.2.foo = 100
+| rate_ctr.abs.inst.2.var = 100
+- add original copy
+| rate_ctr.abs.inst.0.foo = 101
+| rate_ctr.abs.inst.0.var = 100
+| rate_ctr.abs.inst.1.foo = 105
+| rate_ctr.abs.inst.1.var = 101
+| rate_ctr.abs.inst.2.foo = 105
+| rate_ctr.abs.inst.2.var = 101
+- increment types per_hour, per_day by 23
+| rate_ctr.abs.inst.0.foo = 101
+| rate_ctr.abs.inst.0.var = 100
+| rate_ctr.abs.inst.1.foo = 105
+| rate_ctr.abs.inst.1.var = 101
+| rate_ctr.abs.inst.2.foo = 105
+| rate_ctr.abs.inst.2.var = 101
+| rate_ctr.per_day.inst.0.foo = 23
+| rate_ctr.per_day.inst.0.moo = 23
+| rate_ctr.per_day.inst.0.var = 23
+| rate_ctr.per_day.inst.1.foo = 23
+| rate_ctr.per_day.inst.1.moo = 23
+| rate_ctr.per_day.inst.1.var = 23
+| rate_ctr.per_day.inst.2.foo = 23
+| rate_ctr.per_day.inst.2.moo = 23
+| rate_ctr.per_day.inst.2.var = 23
+| rate_ctr.per_hour.inst.0.foo = 23
+| rate_ctr.per_hour.inst.0.moo = 23
+| rate_ctr.per_hour.inst.0.var = 23
+| rate_ctr.per_hour.inst.1.foo = 23
+| rate_ctr.per_hour.inst.1.moo = 23
+| rate_ctr.per_hour.inst.1.var = 23
+| rate_ctr.per_hour.inst.2.foo = 23
+| rate_ctr.per_hour.inst.2.moo = 23
+| rate_ctr.per_hour.inst.2.var = 23
+- copy

Change in osmo-gsm-tester[master]: OsmoCtrl cleanup: get_var(), set_var(), get_trap()

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21564 )

Change subject: OsmoCtrl cleanup: get_var(), set_var(), get_trap()
..

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
---
M src/osmo_gsm_tester/obj/bsc_osmo.py
M src/osmo_gsm_tester/obj/msc_osmo.py
M src/osmo_gsm_tester/obj/nitb_osmo.py
M src/osmo_gsm_tester/obj/osmo_ctrl.py
4 files changed, 186 insertions(+), 127 deletions(-)



diff --git a/src/osmo_gsm_tester/obj/bsc_osmo.py 
b/src/osmo_gsm_tester/obj/bsc_osmo.py
index 158bf93..510063a 100644
--- a/src/osmo_gsm_tester/obj/bsc_osmo.py
+++ b/src/osmo_gsm_tester/obj/bsc_osmo.py
@@ -149,8 +149,10 @@
 # over this list, we have a 1:1 match in indexes.
 return self.bts.index(bts)

-def bts_is_connected(self, bts):
-return OsmoBscCtrl(self).bts_is_connected(self.bts_num(bts))
+def bts_is_connected(self, bts, use_ctrl=None):
+if use_ctrl is None:
+use_ctrl = self.ctrl()
+return use_ctrl.bts_is_connected(self.bts_num(bts))

 def running(self):
 return not self.process.terminated()
@@ -160,32 +162,16 @@
 self.vty.disconnect()
 self.vty = None

-class OsmoBscCtrl(log.Origin):
-PORT = 4249
-BTS_OML_STATE_VAR = "bts.%d.oml-connection-state"
-BTS_OML_STATE_RE = re.compile("GET_REPLY (\d+) 
bts.\d+.oml-connection-state (?P\w+)")
-
-def __init__(self, bsc):
-self.bsc = bsc
-super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.bsc.addr(), 
OsmoBscCtrl.PORT))
-
 def ctrl(self):
-return osmo_ctrl.OsmoCtrl(self.bsc.addr(), OsmoBscCtrl.PORT)
+return OsmoBscCtrl(self)
+
+class OsmoBscCtrl(osmo_ctrl.OsmoCtrl):
+def __init__(self, bsc, port=4249):
+self.bsc = bsc
+super().__init__(bsc.addr(), port)

 def bts_is_connected(self, bts_num):
-with self.ctrl() as ctrl:
-ctrl.do_get(OsmoBscCtrl.BTS_OML_STATE_VAR % bts_num)
-data = ctrl.receive()
-while (len(data) > 0):
-(answer, data) = ctrl.remove_ipa_ctrl_header(data)
-answer_str = answer.decode('utf-8')
-answer_str = answer_str.replace('\n', ' ')
-res = OsmoBscCtrl.BTS_OML_STATE_RE.match(answer_str)
-if res:
-oml_state = str(res.group('oml_state'))
-if oml_state == 'connected':
-return True
-return False
+return self.get_var('bts.%d.oml-connection-state' % bts_num) == 
'connected'

 class OsmoBscVty(osmo_vty.OsmoVty):
 def __init__(self, bsc, port=4242):
diff --git a/src/osmo_gsm_tester/obj/msc_osmo.py 
b/src/osmo_gsm_tester/obj/msc_osmo.py
index 67e1d31..5a7c0ba 100644
--- a/src/osmo_gsm_tester/obj/msc_osmo.py
+++ b/src/osmo_gsm_tester/obj/msc_osmo.py
@@ -157,29 +157,12 @@
 return not self.process.terminated()


-class OsmoMscCtrl(log.Origin):
-PORT = 4255
-SUBSCR_LIST_ACTIVE_VAR = 'subscriber-list-active-v1'
-
-def __init__(self, msc):
+class OsmoMscCtrl(osmo_ctrl.OsmoCtrl):
+def __init__(self, msc, port=4255):
 self.msc = msc
-super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.msc.addr(), 
self.PORT))
-
-def ctrl(self):
-return osmo_ctrl.OsmoCtrl(self.msc.addr(), self.PORT)
+super().__init__(self.msc.addr(), port)

 def subscriber_list_active(self):
-aslist_str = ""
-with self.ctrl() as ctrl:
-ctrl.do_get(self.SUBSCR_LIST_ACTIVE_VAR)
-

Change in osmo-gsm-tester[master]: report fragment: strip ansi colors from junit XML

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21517 )

Change subject: report fragment: strip ansi colors from junit XML
..

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
 text, to make it less annoying to read those on jenkins.

Change-Id: I656ecc23bbfd3f25bdf012c890e0c998168844d3
---
M src/osmo_gsm_tester/core/log.py
M src/osmo_gsm_tester/core/report.py
2 files changed, 6 insertions(+), 1 deletion(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/core/log.py b/src/osmo_gsm_tester/core/log.py
index a573f05..f7c210a 100644
--- a/src/osmo_gsm_tester/core/log.py
+++ b/src/osmo_gsm_tester/core/log.py
@@ -22,6 +22,7 @@
 import time
 import traceback
 import atexit
+import re
 from datetime import datetime # we need this for strftime as the one from time 
doesn't carry microsecond info
 from inspect import getframeinfo, stack

diff --git a/src/osmo_gsm_tester/core/report.py 
b/src/osmo_gsm_tester/core/report.py
index c5e185f..476fa0b 100644
--- a/src/osmo_gsm_tester/core/report.py
+++ b/src/osmo_gsm_tester/core/report.py
@@ -41,11 +41,15 @@
 invalid_xml_char_ranges_str = ['%s-%s' % (chr(low), chr(high))
for (low, high) in invalid_xml_char_ranges]
 invalid_xml_char_ranges_regex = re.compile('[%s]' % 
''.join(invalid_xml_char_ranges_str))
+ansi_color_re = re.compile('\033[0-9;]{1,4}m')

 def escape_xml_invalid_characters(str):
 replacement_char = '\uFFFD' # Unicode replacement character
 return invalid_xml_char_ranges_regex.sub(replacement_char, escape(str))

+def strip_ansi_colors(text):
+return ''.join(ansi_color_re.split(text))
+
 def hash_info_to_junit(testsuite, hash_info):
 properties = et.SubElement(testsuite, 'properties')
 for key, val in hash_info.items():
@@ -156,7 +160,7 @@

 if report_fragment.output:
 sout = et.SubElement(el, 'system-out')
-sout.text = 
escape_xml_invalid_characters(report_fragment.output)
+sout.text = 
escape_xml_invalid_characters(strip_ansi_colors(report_fragment.output))
 testsuite.append(el)

 testsuite.set('errors', str(errors))

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21517
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I656ecc23bbfd3f25bdf012c890e0c998168844d3
Gerrit-Change-Number: 21517
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: add test.report_fragment()

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21516 )

Change subject: add test.report_fragment()
..

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
---
M selftest/suite_test/suite_test.ok
M selftest/suite_test/suite_test.ok.ign
M selftest/suite_test/suite_test.py
A selftest/suite_test/suitedirA/test_suite/test_report_fragment.py
M src/osmo_gsm_tester/core/report.py
M src/osmo_gsm_tester/core/test.py
6 files changed, 174 insertions(+), 12 deletions(-)



diff --git a/selftest/suite_test/suite_test.ok 
b/selftest/suite_test/suite_test.ok
index 3790e1a..9f60b70 100644
--- a/selftest/suite_test/suite_test.ok
+++ b/selftest/suite_test/suite_test.ok
@@ -168,15 +168,67 @@
 -
 trial test_suite PASS
 -
-PASS: test_suite (pass: 1, skip: 7)
+PASS: test_suite (pass: 1, skip: 8)
 pass: hello_world.py (N.N sec)
 skip: mo_mt_sms.py
 skip: mo_sms.py
 skip: test_error.py
 skip: test_fail.py
 skip: test_fail_raise.py
+skip: test_report_fragment.py
 skip: test_suite_params.py
 skip: test_timeout.py
+- run report fragment test
+
+-
+trial test_suite
+-
+
+--
+trial test_suite test_report_fragment.py
+--
+tst test_report_fragment.py:[LINENR]: a step in the first fragment  
[test_suite↪test_report_fragment.py:[LINENR]]
+tst test_report_fragment.py:[LINENR]: - Report fragment: 
test_suite/test_report_fragment.py/fragment1: pass (N.Ns)  
[test_suite↪test_report_fragment.py:[LINENR]]
+tst test_report_fragment.py:[LINENR]: a step in the second fragment  
[test_suite↪test_report_fragment.py:[LINENR]]
+tst test_report_fragment.py:[LINENR]: - Report fragment: 
test_suite/test_report_fragment.py/fragment2: pass (N.Ns)  
[test_suite↪test_report_fragment.py:[LINENR]]
+tst test_report_fragment.py:[LINENR]: a step in the third fragment  
[test_suite↪test_report_fragment.py:[LINENR]]
+tst test_report_fragment.py:[LINENR]: - Report fragment: 
test_suite/test_report_fragment.py/fragment3: FAIL (N.Ns)  
[test_suite↪test_report_fragment.py:[LINENR]]
+tst test_report_fragment.py:[LINENR]: ERR: Exception: failure in the third 
fragment  [test_suite↪test_report_fragment.py:[LINENR]]
+tst test_report_fragment.py:[LINENR]: Test FAILED (N.N sec)  
[test_suite↪test_report_fragment.py:[LINENR]]
+-
+trial test_suite FAIL
+-
+FAIL: test_suite (fail: 1, skip: 8)
+skip: hello_world.py (N.N sec)
+skip: mo_mt_sms.py
+skip: mo_sms.py
+skip: test_error.py
+skip: test_fail.py
+skip: test_fail_raise.py
+FAIL: test_report_fragment.py (N.N sec) Exception: failure in the third 
fragment
+skip: test_suite_params.py
+skip: test_timeout.py
+
+
+### junit XML:
+
+--
+trial test_suite hello_world.py
+--
+[TIMESTAMP] tst hello_world.py:[LINENR]: hello world
+[TIMESTAMP] tst hello_world.py:[LINENR]: I am 'test_suite' / 
'hello_world.py'
+[TIMESTAMP] tst hello_world.py:[LINENR]: one
+two
+three
+[TIMESTAMP] tst   hello_world.py:[LINENR] Test passed (N.N sec)
+test log file not 
availabletest log file not 
availabletest log file not 
availabletest log file not 
availabletest log file not 
availablefailure 
in the third fragment[BACKTRACE]
+raise Exception('failure in the third fragment')
+
+Exception: failure in the third fragment
+test log file 
not availabletest log file not 
available
+###
+
+

 - a test with an error

@@ -193,13 +245,14 @@
 -
 trial test_suite FAIL

Change in osmo-gsm-tester[master]: implement test.get_log_output()

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21515 )

Change subject: implement test.get_log_output()
..

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
---
M src/osmo_gsm_tester/core/log.py
M src/osmo_gsm_tester/core/test.py
2 files changed, 42 insertions(+), 0 deletions(-)



diff --git a/src/osmo_gsm_tester/core/log.py b/src/osmo_gsm_tester/core/log.py
index 7a13bdd..a573f05 100644
--- a/src/osmo_gsm_tester/core/log.py
+++ b/src/osmo_gsm_tester/core/log.py
@@ -264,6 +264,15 @@
 lines.insert(0, '')
 self.log_write_func('\n'.join(lines))

+def get_mark(self):
+# implemented in FileLogTarget
+return 0
+
+def get_output(self, since_mark=0):
+# implemented in FileLogTarget
+return ''
+
+
 def level_str(level):
 if level == L_TRACEBACK:
 return L_TRACEBACK
@@ -569,6 +578,21 @@
 def log_file_path(self):
 return self.path

+def get_mark(self):
+if self.path is None:
+return 0
+# return current file length
+with open(self.path, 'r') as logfile:
+return logfile.seek(0, 2)
+
+def get_output(self, since_mark=0):
+if self.path is None:
+return ''
+with open(self.path, 'r') as logfile:
+if since_mark:
+logfile.seek(since_mark)
+return logfile.read()
+
 def run_logging_exceptions(func, *func_args, return_on_failure=None, 
**func_kwargs):
 try:
 return func(*func_args, **func_kwargs)
diff --git a/src/osmo_gsm_tester/core/test.py b/src/osmo_gsm_tester/core/test.py
index cf910ea..ec85c45 100644
--- a/src/osmo_gsm_tester/core/test.py
+++ b/src/osmo_gsm_tester/core/test.py
@@ -165,4 +165,22 @@
 else:
 return 'test log file not available'

+def log_file(self):
+for lt in self.log_targets:
+if isinstance(lt, log.FileLogTarget):
+return lt
+return None
+
+def get_log_mark(self):
+lt = self.log_file()
+if lt is None:
+return 0
+return lt.get_mark()
+
+def get_log_output(self, since_mark=0):
+lt = self.log_file()
+if lt is None:
+return ''
+return lt.get_output(since_mark)
+
 # vim: expandtab tabstop=4 shiftwidth=4

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21515
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Idfa0a45f3e6a18dd4fe692e81d732c70b5cffb76
Gerrit-Change-Number: 21515
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: log: process.py: fix weird space in stdout/stderr log output

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21514 )

Change subject: log: process.py: fix weird space in stdout/stderr log output
..

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
---
M src/osmo_gsm_tester/core/process.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/core/process.py 
b/src/osmo_gsm_tester/core/process.py
index bff8dba..9cde7de 100644
--- a/src/osmo_gsm_tester/core/process.py
+++ b/src/osmo_gsm_tester/core/process.py
@@ -291,13 +291,13 @@
 m = self.get_stdout_tail(prefix='| ')
 if not m:
 return
-self.log('stdout:\n', m, '\n')
+self.log('stdout:', '\n' + m, '\n')

 def log_stderr_tail(self):
 m = self.get_stderr_tail(prefix='| ')
 if not m:
 return
-self.log('stderr:\n', m, '\n')
+self.log('stderr:', '\n' + m, '\n')

 def close_output_logs(self):
 for k, v in self.outputs.items():

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21514
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I4202e7dfbb550acaf55a6c6487fc07819ab18b94
Gerrit-Change-Number: 21514
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: do not redirect_stdout in test scripts

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21513 )

Change subject: do not redirect_stdout in test scripts
..

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
---
M selftest/suite_test/suite_test.ok
M src/osmo_gsm_tester/core/log.py
M src/osmo_gsm_tester/core/test.py
M src/osmo_gsm_tester/testenv.py
4 files changed, 24 insertions(+), 55 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/selftest/suite_test/suite_test.ok 
b/selftest/suite_test/suite_test.ok
index caf5a5b..3790e1a 100644
--- a/selftest/suite_test/suite_test.ok
+++ b/selftest/suite_test/suite_test.ok
@@ -161,9 +161,9 @@
 --
 tst hello_world.py:[LINENR]: hello world  [test_suite↪hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py'  
[test_suite↪hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: one  [test_suite↪hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: two  [test_suite↪hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: three  [test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: one
+two
+three  [test_suite↪hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR] Test passed (N.N sec)  [test_suite↪hello_world.py]
 -
 trial test_suite PASS
@@ -390,9 +390,9 @@
 --
 tst hello_world.py:[LINENR]: hello world  [test_suite↪hello_world.py:[LINENR]] 
 [hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py'  
[test_suite↪hello_world.py:[LINENR]]  [hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: one  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: two  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: three  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: one
+two
+three  [test_suite↪hello_world.py:[LINENR]]  [hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR] Test passed (N.N sec)  [test_suite↪hello_world.py] 
 [test.py:[LINENR]]
 -
 trial test_suite PASS
@@ -545,9 +545,9 @@
 --
 tst hello_world.py:[LINENR]: hello world  [test_suite↪hello_world.py:[LINENR]] 
 [hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py'  
[test_suite↪hello_world.py:[LINENR]]  [hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: one  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: two  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: three  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: one
+two
+three  [test_suite↪hello_world.py:[LINENR]]  [hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR] Test passed (N.N sec)  [test_suite↪hello_world.py] 
 [test.py:[LINENR]]
 -
 trial test_suite PASS
@@ -746,9 +746,9 @@
 --
 tst hello_world.py:[LINENR]: hello world  [test_suite↪hello_world.py:[LINENR]] 
 [hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py'  
[test_suite↪hello_world.py:[LINENR]]  [hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: one  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: two  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
-

Change in osmo-gsm-tester[master]: typo / newline in selftest log output

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21542 )

Change subject: typo / newline in selftest log output
..

typo / newline in selftest log output

...because it otherwise causes confusing selftest log changes in
upcoming I0972c66b9165bd7f2b0b387e0335172849199193

Change-Id: I1eec31c5baba5ef33d0c8441b1e94a00d79af9bf
---
M selftest/suite_test/suite_test.ok
M selftest/suite_test/suitedirB/suiteC/test_template_overlay.py
M selftest/template_test/template_test.ok
M selftest/template_test/template_test.py
4 files changed, 4 insertions(+), 6 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/selftest/suite_test/suite_test.ok 
b/selftest/suite_test/suite_test.ok
index 2c49c19..caf5a5b 100644
--- a/selftest/suite_test/suite_test.ok
+++ b/selftest/suite_test/suite_test.ok
@@ -1003,8 +1003,7 @@
 --
 tst test_template_overlay.py:[LINENR]: - Testing: expect to fail on invalid 
templates overlay dir  [suiteC↪test_template_overlay.py:[LINENR]]  
[test_template_overlay.py:[LINENR]]
 tst test_template_overlay.py:[LINENR] DBG: template dir overlay set: 
[PATH]/selftest/suite_test/suitedirB/suiteC/nonexistent-templatedir  
[suiteC↪test_template_overlay.py:[LINENR]↪test_template_overlay.py]  
[testenv.py:[LINENR]]
-tst test_template_overlay.py:[LINENR]: sucess: setting non-existing templates 
dir raised RuntimeError  [suiteC↪test_template_overlay.py:[LINENR]]  
[test_template_overlay.py:[LINENR]]
-tst test_template_overlay.py:[LINENR]:   
[suiteC↪test_template_overlay.py:[LINENR]]  [test_template_overlay.py:[LINENR]]
+tst test_template_overlay.py:[LINENR]: success: setting non-existing templates 
dir raised RuntimeError  [suiteC↪test_template_overlay.py:[LINENR]]  
[test_template_overlay.py:[LINENR]]
 tst test_template_overlay.py:[LINENR] DBG: template dir overlay set: 
[PATH]/selftest/suite_test/suitedirB/suiteC/mytemplatedir  
[suiteC↪test_template_overlay.py:[LINENR]↪test_template_overlay.py]  
[testenv.py:[LINENR]]
 --- ReservedResources: DBG: requesting use of ip_address {specifics={}}  
[resource.py:[LINENR]]
 tst suiteC: Using 1 x ip_address (candidates: 1)  [resource.py:[LINENR]]
diff --git a/selftest/suite_test/suitedirB/suiteC/test_template_overlay.py 
b/selftest/suite_test/suitedirB/suiteC/test_template_overlay.py
index 2dd9378..7d35138 100644
--- a/selftest/suite_test/suitedirB/suiteC/test_template_overlay.py
+++ b/selftest/suite_test/suitedirB/suiteC/test_template_overlay.py
@@ -11,7 +11,7 @@
 sys.stderr.write('Error: setting non-existing templates dir should raise 
RuntimeError\n')
 assert(False)
 except RuntimeError:
-print('sucess: setting non-existing templates dir raised RuntimeError\n')
+print('success: setting non-existing templates dir raised RuntimeError')
 pass

 mytemplatedir = os.path.join(os.path.dirname(__file__), 'mytemplatedir')
diff --git a/selftest/template_test/template_test.ok 
b/selftest/template_test/template_test.ok
index 718ef6e..39b0cd3 100644
--- a/selftest/template_test/template_test.ok
+++ b/selftest/template_test/template_test.ok
@@ -189,8 +189,7 @@
  bind val_ip_address

 - Testing: expect to fail on invalid templates dir
-sucess: setting non-existing templates dir raised RuntimeError
-
+success: setting non-existing templates dir raised RuntimeError
 - Testing: template directory overlay (still can find default one?)
 cnf Templates: DBG: rendering osmo-nitb.cfg.tmpl
 ! Configuration rendered by osmo-gsm-tester
diff --git a/selftest/template_test/template_test.py 
b/selftest/template_test/template_test.py
index 52976e5..9dc967f 100755
--- a/selftest/template_test/template_test.py
+++ b/selftest/template_test/template_test.py
@@ -89,7 +89,7 @@
 assert(False)
 except RuntimeError:
 # not logging exception to omit non-constant path name from expected output
-print('sucess: setting non-existing templates dir raised RuntimeError\n')
+print('success: setting non-existing templates dir raised RuntimeError')
 pass

 mytemplatedir = os.path.join(os.path.dirname(__file__), 'mytemplatedir')

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21542
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I1eec31c5baba5ef33d0c8441b1e94a00d79af9bf
Gerrit-Change-Number: 21542
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: fix: line nr in test name in wrong places

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21541 )

Change subject: fix: line nr in test name in wrong places
..

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
---
M selftest/suite_test/suite_test.ok
M src/osmo_gsm_tester/core/log.py
M src/osmo_gsm_tester/core/test.py
3 files changed, 17 insertions(+), 11 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/selftest/suite_test/suite_test.ok 
b/selftest/suite_test/suite_test.ok
index dfc8d41..2c49c19 100644
--- a/selftest/suite_test/suite_test.ok
+++ b/selftest/suite_test/suite_test.ok
@@ -160,7 +160,7 @@
 trial test_suite hello_world.py
 --
 tst hello_world.py:[LINENR]: hello world  [test_suite↪hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]'  
[test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py'  
[test_suite↪hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: one  [test_suite↪hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: two  [test_suite↪hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: three  [test_suite↪hello_world.py:[LINENR]]
@@ -187,7 +187,7 @@
 --
 trial test_suite test_error.py
 --
-tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]'  
[test_suite↪test_error.py:[LINENR]]  [test_error.py:[LINENR]]
+tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py'  
[test_suite↪test_error.py:[LINENR]]  [test_error.py:[LINENR]]
 tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: 
assert False  [test_suite↪test_error.py:[LINENR]]  [test_error.py:[LINENR]: 
assert False]
 tst test_error.py:[LINENR]: Test FAILED (N.N sec)  
[test_suite↪test_error.py:[LINENR]]  [test.py:[LINENR]]
 -
@@ -212,7 +212,7 @@
 --
 trial test_suite test_fail.py
 --
-tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]'  
[test_suite↪test_fail.py:[LINENR]]  [test_fail.py:[LINENR]]
+tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py'  
[test_suite↪test_fail.py:[LINENR]]  [test_fail.py:[LINENR]]
 tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected  
[test_suite↪test_fail.py:[LINENR]]  [test_fail.py:[LINENR]]
 tst test_fail.py:[LINENR]: Test FAILED (N.N sec)  
[test_suite↪test_fail.py:[LINENR]]  [test.py:[LINENR]]
 -
@@ -389,7 +389,7 @@
 trial test_suite hello_world.py
 --
 tst hello_world.py:[LINENR]: hello world  [test_suite↪hello_world.py:[LINENR]] 
 [hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]'  
[test_suite↪hello_world.py:[LINENR]]  [hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py'  
[test_suite↪hello_world.py:[LINENR]]  [hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: one  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: two  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
 tst hello_world.py:[LINENR]: three  [test_suite↪hello_world.py:[LINENR]]  
[hello_world.py:[LINENR]]
@@ -544,7 +544,7 @@
 trial test_suite hello_world.py
 --
 tst hello_world.py:[LINENR]: hello world  [test_suite↪hello_world.py:[LINENR]] 
 [hello_world.py:[LINENR]]
-tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]'  
[test_suite↪hello_world.py:[LINENR]]  [hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: I am 'test_su

Change in osmo-gsm-tester[master]: process: add get_output_mark() and grep_output()

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21512 )

Change subject: process: add get_output_mark() and grep_output()
..

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
---
M src/osmo_gsm_tester/core/process.py
1 file changed, 53 insertions(+), 8 deletions(-)



diff --git a/src/osmo_gsm_tester/core/process.py 
b/src/osmo_gsm_tester/core/process.py
index 0b96f2e..bff8dba 100644
--- a/src/osmo_gsm_tester/core/process.py
+++ b/src/osmo_gsm_tester/core/process.py
@@ -23,6 +23,7 @@
 import signal
 from abc import ABCMeta, abstractmethod
 from datetime import datetime
+import re

 from . import log
 from .event_loop import MainLoop
@@ -320,13 +321,24 @@
 self.poll()
 return self.process_obj is not None and self.result is None

-def get_output(self, which):
-''' Read process output '''
+@staticmethod
+def end_ansi_colors(txt):
+'''Make sure no ANSI colors leak out of logging output'''
+color_off = '\033[0;m'
+color_any = '\033['
+if txt.rfind(color_any) > txt.rfind(color_off):
+return txt + color_off
+return txt
+
+def get_output(self, which, since_mark=0):
+''' Read process output. For since_mark, see get_output_mark(). '''
 path = self.get_output_file(which)
 if path is None:
 return None
-with open(path, 'r') as f2:
-return f2.read()
+with open(path, 'r') as f:
+if since_mark > 0:
+f.seek(since_mark)
+return f.read()

 def get_output_file(self, which):
 ''' Return filename for given output '''
@@ -344,11 +356,44 @@
 tail = min(len(out), tail)
 return prefix + ('\n' + prefix).join(out[-tail:])

-def get_stdout(self):
-return self.get_output('stdout')
+def get_output_mark(self, which):
+'''Usage:
+ # remember a start marker
+ my_mark = my_process.get_output_mark('stderr')

-def get_stderr(self):
-return self.get_output('stderr')
+ do_actions_that_produce_log_output()
+
+ my_log = my_process.get_output('stderr', since_mark=my_mark)
+ # my_log contains the stderr of that process since the start 
marker.
+'''
+path = self.get_output_file(which)
+if path is None:
+return None
+with open(path, 'r') as f:
+return f.seek(0, 2)
+
+def grep_output(self, which, regex, since_mark=0, line_nrs=False):
+lines = self.get_output(which, since_mark=since_mark).splitlines()
+if not lines:
+return None
+matches = []
+r = re.compile(regex)
+line_nr = since_mark
+for line in lines:
+line_nr += 1
+if r.search(line):
+line = self.end_ansi_colors(line)
+if line_nrs:
+matches.append((line_nr, line))
+else:
+matches.append(line)
+return matches
+
+def get_stdout(self, since_mark=0):
+return self.get_output('stdout', since_mark=since_mark)
+
+def get_stderr(self, since_mark=0):
+return self.get_output('stderr', since_mark=since_mark)

 def get_stdout_tail(self, tail=10, prefix=''):
 return self.get_output_tail('stdout', tail, prefix)

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21512
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ib6569f7486e9d961bd79a5f24232e58d053667a1
Gerrit-Change-Number: 21512
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: configure fixed ARFCN per bts

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21511 )

Change subject: configure fixed ARFCN per bts
..

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
---
M selftest/resource_test/conf/resources.conf
M selftest/resource_test/resource_test.ok
M selftest/resource_test/resource_test.py
M selftest/suite_test/resources.conf
M src/osmo_gsm_tester/core/schema.py
M src/osmo_gsm_tester/obj/bts_nanobts.py
M src/osmo_gsm_tester/obj/bts_oc2g.py
M sysmocom/defaults.conf
M sysmocom/resources.conf.prod
M sysmocom/resources.conf.rnd
10 files changed, 30 insertions(+), 179 deletions(-)



diff --git a/selftest/resource_test/conf/resources.conf 
b/selftest/resource_test/conf/resources.conf
index 84d0ab9..71d8ee0 100644
--- a/selftest/resource_test/conf/resources.conf
+++ b/selftest/resource_test/conf/resources.conf
@@ -43,28 +43,6 @@
   - 'a5_0'
   - 'a5_1'

-arfcn:
-  - arfcn: 512
-band: GSM-1800
-  - arfcn: 514
-band: GSM-1800
-  - arfcn: 516
-band: GSM-1800
-  - arfcn: 518
-band: GSM-1800
-  - arfcn: 520
-band: GSM-1800
-  - arfcn: 540
-band: GSM-1900
-  - arfcn: 542
-band: GSM-1900
-  - arfcn: 544
-band: GSM-1900
-  - arfcn: 546
-band: GSM-1900
-  - arfcn: 548
-band: GSM-1900
-
 modem:
 - label: sierra_1
   path: '/sierra_1'
diff --git a/selftest/resource_test/resource_test.ok 
b/selftest/resource_test/resource_test.ok
index 5f7d5f6..64cf39b 100644
--- a/selftest/resource_test/resource_test.ok
+++ b/selftest/resource_test/resource_test.ok
@@ -19,37 +19,7 @@
  'suites_dir': ['[PATH]/selftest/resource_test/conf/suite_test'],
  'trial_dir': '[PATH]/selftest/resource_test/conf/trial'}
 *** all resources:
-{'arfcn': [{'_hash': 'e620569450f8259b3f0212ec19c285dd07df063c',
-'arfcn': '512',
-'band': 'GSM-1800'},
-   {'_hash': '022621e513c5a5bf33b77430a1e9c886be676fa1',
-'arfcn': '514',
-'band': 'GSM-1800'},
-   {'_hash': '3199abf375a1dd899e554e9d63a552e06d7f38bf',
-'arfcn': '516',
-'band': 'GSM-1800'},
-   {'_hash': '57aa7bd1da62495f2857ae6b859193dd592a0a02',
-'arfcn': '518',
-'band': 'GSM-1800'},
-   {'_hash': '53dd2e2682b736f427abd2ce59a9a50ca8130678',
-'arfcn': '520',
-'band': 'GSM-1800'},
-   {'_hash': '31687a5e6d5140a4b3877606ca5f18244f11d706',
-'arfcn': '540',
-'band': 'GSM-1900'},
-   {'_hash': '1def43a5c88a83cdb21279eacab0679ea08ffaf3',
-'arfcn': '542',
-'band': 'GSM-1900'},
-   {'_hash': '1d6e3b08a3861fd4d748f111295ec5a93ecd3d23',
-'arfcn': '544',
-'band': 'GSM-1900'},
-   {'_hash': '8fb36927de15466fcdbee01f7f65704c312cb36c',
-'arfcn': '546',
-'band': 'GSM-1900'},
-   {'_hash': 'dc9ce027a257da087f31a5bc1ee6b4abd2637369',
-'arfcn': '548',
-'band': 'GSM-1900'}],
- 'bts': [{'_hash': 'd2aa7c1124943de352351b650ca0c751784da6b6',
+{'bts': [{'_hash': 'd2aa7c1124943de352351b650ca0c751784da6b6',
   'addr': '10.42.42.114',
   'band': 'GSM-1800',
   'ciphers': ['a5_0', 'a5_1'],
@@ -116,13 +86,6 @@
 *** end: all resources

 - request some resources
 testowner: Verifying 2 x arfcn (candidates: 10)
 testowner: DBG: Picked - _hash: e620569450f8259b3f0212ec19c285dd07df063c
-  arfcn: '512'
-  band: GSM-1800
-- _hash: 022621e513c5a5bf33b77430a1e9c886be676fa1
-  arfcn: '514'
-  band: GSM-1800
 --- testowner: Verifying 2 x bts (candidates: 3)
 --- testowner: DBG: Picked - _hash: d2aa7c1124943de352351b650ca0c751784da6b6
   addr: 10.42.42.114
@@ -169,13 +132,6 @@
   label: sierra_2
   path: /sierra_2
 --- testowner: DBG: FileWatch: scheduling watch for directory 
[PATH]/selftest/resource_test/conf/test_work/state_dir
 testowner: Reserving 2 x arfcn (candidates: 10)
 testowner: DBG: Picked - _hash: e620569450f8259b3f0212ec19c285dd07df063c
-  arfcn: '512'
-  band: GSM-1800
-- _

Change in osmo-gsm-tester[master]: log reserved resources

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21510 )

Change subject: log reserved resources
..

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
---
M selftest/suite_test/suite_test.ok
M src/osmo_gsm_tester/core/resource.py
M src/osmo_gsm_tester/core/suite.py
3 files changed, 67 insertions(+), 0 deletions(-)



diff --git a/selftest/suite_test/suite_test.ok 
b/selftest/suite_test/suite_test.ok
index 9d0493d..dfc8d41 100644
--- a/selftest/suite_test/suite_test.ok
+++ b/selftest/suite_test/suite_test.ok
@@ -145,6 +145,16 @@
   label: m7802
   path: /wavecom_1
 tst test_suite: DBG: FileWatch: unscheduling watch 
+tst test_suite: RESERVED RESOURCES for test_suite:
+bts
+  sysmoCell 5000
+  sysmoCell 5000
+  sysmoBTS 1002
+ip_address
+  10.42.42.1
+modem
+  m7801
+  m7802

 --
 trial test_suite hello_world.py
@@ -364,6 +374,16 @@
   path: /wavecom_1
   [resource.py:[LINENR]]
 tst test_suite: DBG: FileWatch: unscheduling watch   
[util.py:[LINENR]]
+tst test_suite: RESERVED RESOURCES for test_suite:
+bts
+  sysmoCell 5000
+  sysmoCell 5000
+  sysmoBTS 1002
+ip_address
+  10.42.42.1
+modem
+  m7801
+  m7802  [suite.py:[LINENR]]

 --
 trial test_suite hello_world.py
@@ -509,6 +529,16 @@
   path: /wavecom_1
   [resource.py:[LINENR]]
 tst test_suite: DBG: FileWatch: unscheduling watch   
[util.py:[LINENR]]
+tst test_suite: RESERVED RESOURCES for test_suite:
+bts
+  sysmoCell 5000
+  sysmoCell 5000
+  sysmoBTS 1002
+ip_address
+  10.42.42.1
+modem
+  m7801
+  m7802  [suite.py:[LINENR]]

 --
 trial test_suite hello_world.py
@@ -650,6 +680,16 @@
   path: /wavecom_1
   [resource.py:[LINENR]]
 tst test_suite: DBG: FileWatch: unscheduling watch   
[util.py:[LINENR]]
+tst test_suite: RESERVED RESOURCES for test_suite:
+bts
+  sysmoCell 5000
+  sysmoCell 5000
+  sysmoBTS 1002
+ip_address
+  10.42.42.1
+modem
+  m7801
+  m7802  [suite.py:[LINENR]]
 resources(test_suite)={'bts': [{'_hash': 
'a59640b8ba6a373552b24a6f9f65cadd2347bace',
   '_reserved_by': 'test_suite-[ID_NUM]-[ID_NUM]',
   'addr': '10.42.42.53',
@@ -841,6 +881,16 @@
   path: /wavecom_1
   [resource.py:[LINENR]]
 tst test_suite: DBG: FileWatch: unscheduling watch   
[util.py:[LINENR]]
+tst test_suite: RESERVED RESOURCES for test_suite:
+bts
+  sysmoCell 5000
+  sysmoCell 5000
+  sysmoBTS 1002
+ip_address
+  10.42.42.1
+modem
+  m7801
+  m7802  [suite.py:[LINENR]]
 resources(test_suite)={'bts': [{'_hash': 
'a59640b8ba6a373552b24a6f9f65cadd2347bace',
   '_reserved_by': 'test_suite-[ID_NUM]-[ID_NUM]',
   'addr': '10.42.42.53',
@@ -944,6 +994,9 @@
   addr: 10.42.42.2
   [resource.py:[LINENR]]
 tst suiteC: DBG: FileWatch: unscheduling watch   
[util.py:[LINENR]]
+tst suiteC: RESERVED RESOURCES for suiteC:
+ip_address
+  10.42.42.2  [suite.py:[LINENR]]

 --
 trial suiteC test_template_overlay.py
diff --git a/src/osmo_gsm_tester/core/resource.py 
b/src/osmo_gsm_tester/core/resource.py
index 621522b..223a8f9 100644
--- a/src/osmo_gsm_tester/core/resource.py
+++ b/src/osmo_gsm_tester/core/resource.py
@@ -485,6 +485,18 @@
 def __repr__(self):
 return 'resources(%s)=%s' % (self.origin.name(), 
pprint.pformat(self.reserved))

+def __str__(self):
+return repr(self)
+
+def summary_str(self, prefix=''):
+lines = []
+for key, reserved_list in sorted(self.reserved.items()):
+lines.append(key)
+for item in reserved_list:
+label = item.get('label') or item.get('addr') or 
item.get('type') or item.get('_hash') or '?'
+lines.append('  ' + label)
+return prefix + ('\n' + prefix).join(lines)
+
 def get(self, kind, specifics=None):
 if specifics is None:
 specifics = {}
diff --git a/src/osmo_gsm_tester/core/suite.py 
b/src/osmo_gsm_tester/core/suite.py
index 3860d19..3e9ecbf 100644
--- a/src/osmo_gsm_tester/core/suite.py
+++ b/src/osmo_gsm_tester/core/suite.py
@@ -160,6 +160,8 @@
 raise RuntimeError('Attempt to reserve resources twice for a 
SuiteRun')
 self.log('reserving resources in', self.resources_pool.state_dir, 
'...')
 self.reserved_resources = self.resources_pool.reserve(self, 
self.resource_requirements(), self.resource_modifiers())
+# short summary of labels
+self.log('RESERVED RESOURCES for ' + self.suite_name() + ':\n' + 
self.rese

Change in osmo-gsm-tester[master]: log passed tests

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21509 )

Change subject: log passed tests
..

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
---
M src/osmo_gsm_tester/core/report.py
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  fixeria: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/core/report.py 
b/src/osmo_gsm_tester/core/report.py
index d2c68c5..c3390fe 100644
--- a/src/osmo_gsm_tester/core/report.py
+++ b/src/osmo_gsm_tester/core/report.py
@@ -164,12 +164,14 @@
 return testcase

 def trial_to_text(trial):
+suite_passes = []
 suite_failures = []
 count_fail = 0
 count_pass = 0
 for suite in trial.suites:
 if suite.passed():
 count_pass += 1
+suite_passes.append(suite_to_text(suite))
 else:
 count_fail += 1
 suite_failures.append(suite_to_text(suite))
@@ -181,6 +183,7 @@
 summary.append('%d suites passed' % count_pass)
 msg = [', '.join(summary)]
 msg.extend(suite_failures)
+msg.extend(suite_passes)
 return '\n'.join(msg)

 def suite_to_text(suite):

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21509
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ib85a5b90e267c2ed2f844691187ecadc8939b1bb
Gerrit-Change-Number: 21509
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: bts: allow configuring ARFCN and BSIC: add to schema

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21507 )

Change subject: bts: allow configuring ARFCN and BSIC: add to schema
..

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
---
M src/osmo_gsm_tester/obj/bts.py
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/obj/bts.py b/src/osmo_gsm_tester/obj/bts.py
index 5b43642..76a6875 100644
--- a/src/osmo_gsm_tester/obj/bts.py
+++ b/src/osmo_gsm_tester/obj/bts.py
@@ -35,6 +35,7 @@
 'channel_allocator': schema.CHAN_ALLOCATOR,
 'gprs_mode': schema.GPRS_MODE,
 'emergency_calls_allowed': schema.BOOL_STR,
+'base_station_id_code': schema.UINT,
 'num_trx': schema.UINT,
 'max_trx': schema.UINT,
 'trx_list[].addr': schema.IPV4,
@@ -46,6 +47,7 @@
 'trx_list[].power_supply.type': schema.STR,
 'trx_list[].power_supply.device': schema.STR,
 'trx_list[].power_supply.port': schema.STR,
+'trx_list[].arfcn': schema.UINT,
 }
 schema.register_resource_schema('bts', resource_schema)


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21507
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I8e0583e9208d563c66b0bdc9f25b1b74f92403c2
Gerrit-Change-Number: 21507
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: bsc: add active lchan matching via vty

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21506 )

Change subject: bsc: add active lchan matching via vty
..

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
---
M src/osmo_gsm_tester/obj/bsc_osmo.py
1 file changed, 49 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/obj/bsc_osmo.py 
b/src/osmo_gsm_tester/obj/bsc_osmo.py
index bd8649b..158bf93 100644
--- a/src/osmo_gsm_tester/obj/bsc_osmo.py
+++ b/src/osmo_gsm_tester/obj/bsc_osmo.py
@@ -192,4 +192,53 @@
 self.bsc = bsc
 super().__init__(self.bsc.addr(), port)

+def get_active_lchans(self):
+lchan_summary = self.cmd('show lchan summary')
+
+re_lchan_summary = re.compile('BTS ([0-9]+), TRX ([0-9]+), Timeslot 
([0-9]+) *([^,]*), Lchan ([0-9]+),.* State ([A-Za-z_]+).*')
+active_lchans = set()
+for line in lchan_summary:
+m = re_lchan_summary.match(line)
+if m:
+bts, trx, ts, lchan_type, subslot, state = m.groups()
+active_lchans.add('%s-%s-%s-%s %s %s' % (bts, trx, ts, 
subslot, lchan_type, state))
+if not active_lchans:
+self.dbg('No active lchans')
+else:
+self.dbg('Active lchans:\n|', '\n| '.join(active_lchans), '\n');
+return active_lchans
+
+def active_lchans_match(self, expected=[], not_expected=[]):
+active_lchans = self.get_active_lchans()
+matches = []
+mismatches = []
+
+for expected_lchan in expected:
+found = False
+for active_lchan in active_lchans:
+if active_lchan.startswith(expected_lchan):
+found = True
+break
+if found:
+matches.append(expected_lchan)
+else:
+mismatches.append('missing: ' + expected_lchan)
+
+for not_expected_lchan in not_expected:
+found = False
+for active_lchan in active_lchans:
+if active_lchan.startswith(not_expected_lchan):
+found = True
+break
+if not found:
+matches.append('not: ' + not_expected_lchan)
+else:
+mismatches.append('unexpected: ' + not_expected_lchan)
+
+if matches:
+self.log('Found matching lchan activity (%d of %d requirements):' 
% (len(matches), len(expected) + len(not_expected)), matches)
+if mismatches:
+self.err('Found unexpected lchan activity (%d of %d 
requirements):' % (len(mismatches), len(expected) + len(not_expected)), 
mismatches)
+return not mismatches
+
 # vim: expandtab tabstop=4 shiftwidth=4

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21506
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I03df8f3ae2ee47930eee311c7ce104c36dbb3154
Gerrit-Change-Number: 21506
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: add osmo_vty.py

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21504 )

Change subject: add osmo_vty.py
..

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
---
A src/osmo_gsm_tester/obj/osmo_vty.py
1 file changed, 247 insertions(+), 0 deletions(-)



diff --git a/src/osmo_gsm_tester/obj/osmo_vty.py 
b/src/osmo_gsm_tester/obj/osmo_vty.py
new file mode 100644
index 000..3f8abf7
--- /dev/null
+++ b/src/osmo_gsm_tester/obj/osmo_vty.py
@@ -0,0 +1,247 @@
+# osmo_gsm_tester: VTY connection
+#
+# Copyright (C) 2020 by sysmocom - s.f.m.c. GmbH
+#
+# Author: Neels Hofmeyr 
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+import socket
+import struct
+import re
+import time
+import sys
+
+from ..core import log
+from ..core.event_loop import MainLoop
+
+class VtyInterfaceExn(Exception):
+pass
+
+class OsmoVty(log.Origin):
+'''Suggested usage:
+ with OsmoVty(...) as vty:
+ vty.cmds('enable', 'configure network', 'net')
+ response = vty.cmd('foo 1 2 3')
+ print('\n'.join(response))
+
+   Using 'with' ensures that the connection is closed again.
+   There should not be nested 'with' statements on this object.
+'''
+
+##
+# PROTECTED
+##
+
+def __init__(self, host, port, prompt=None):
+super().__init__(log.C_BUS, 'Vty', host=host, port=port)
+self.host = host
+self.port = port
+self.sck = None
+self.prompt = prompt
+self.re_prompt = None
+self.this_node = None
+self.this_prompt_char = None
+self.last_node = None
+self.last_prompt_char = None
+
+def try_connect(self):
+'''Do a connection attempt, return True when successful, False 
otherwise.
+   Does not raise exceptions, but logs them to the debug log.'''
+assert self.sck is None
+try:
+self.dbg('Connecting')
+sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+try:
+sck.connect((self.host, self.port))
+except:
+sck.close()
+raise
+# set self.sck only after the connect was successful
+self.sck = sck
+return True
+except:
+self.dbg('Failed to connect', sys.exc_info()[0])
+return False
+
+def _command(self, command_str, timeout=10, strict=True):
+'''Send a command and return the response.'''
+# (copied from 
https://git.osmocom.org/python/osmo-python-tests/tree/osmopy/osmo_interact/vty.py)
+self.dbg('Sending', command_str=command_str)
+self.sck.send(command_str.encode())
+
+waited_since = time.time()
+received_lines = []
+last_line = ''
+
+# (not using MainLoop.wait() to accumulate received responses across
+# iterations)
+while True:
+new_data = self.sck.recv(4096).decode('utf-8')
+
+last_line = "%s%s" % (last_line, new_data)
+
+if last_line:
+# Separate the received response into lines.
+# But note: the VTY logging currently separates with '\n\r', 
not '\r\n',
+# see _vty_output() in libosmocore logging_vty.c.
+# So we need to jump through hoops to not separate 
'abc\n\rdef' as
+# [ 'abc', '', 'def' ]; but also not to convert '\r\n\r\n' to 
'\r\n\n' ('\r{\r\n}\n')
+# Simplest is to just drop all the '\r' and only care about 
the '\n'.
+last_line = last_line.replace('\r', '')
+lines = last_line.splitlines()
+if last_line.endswith('\n'):
+received_lines.extend(lines)
+last_line = ""
+else:
+# if pkt buffer ends in the middle of a line, we need to 
keep
+# last non-finished line:
+received_lines.extend(lines[:-1])
+last_line = lines[-1]
+
+match = self.re_prompt

Change in osmo-gsm-tester[master]: add bsc.vty: always keep a BSC VTY connection ready

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21505 )

Change subject: add bsc.vty: always keep a BSC VTY connection ready
..

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
---
M src/osmo_gsm_tester/obj/bsc_osmo.py
M src/osmo_gsm_tester/obj/osmo_vty.py
M src/osmo_gsm_tester/testenv.py
3 files changed, 21 insertions(+), 2 deletions(-)



diff --git a/src/osmo_gsm_tester/obj/bsc_osmo.py 
b/src/osmo_gsm_tester/obj/bsc_osmo.py
index 1763dcd..bd8649b 100644
--- a/src/osmo_gsm_tester/obj/bsc_osmo.py
+++ b/src/osmo_gsm_tester/obj/bsc_osmo.py
@@ -20,10 +20,11 @@
 import os
 import re
 import pprint
+import re

 from ..core import log, util, config, template, process
 from ..core import schema
-from . import osmo_ctrl, pcap_recorder
+from . import osmo_ctrl, osmo_vty, pcap_recorder

 def on_register_schemas():
 config_schema = {
@@ -48,6 +49,7 @@
 self.msc = msc
 self.mgw = mgw
 self.stp = stp
+self.vty = None

 def start(self):
 self.log('Starting osmo-bsc')
@@ -79,6 +81,9 @@
 self.testenv.remember_to_stop(self.process)
 self.process.launch()

+self.vty = OsmoBscVty(self)
+self.vty.connect()
+
 def configure(self):
 self.config_file = self.run_dir.new_file('osmo-bsc.cfg')
 self.dbg(config_file=self.config_file)
@@ -150,6 +155,10 @@
 def running(self):
 return not self.process.terminated()

+def cleanup(self):
+if self.vty is not None:
+self.vty.disconnect()
+self.vty = None

 class OsmoBscCtrl(log.Origin):
 PORT = 4249
@@ -178,4 +187,9 @@
 return True
 return False

+class OsmoBscVty(osmo_vty.OsmoVty):
+def __init__(self, bsc, port=4242):
+self.bsc = bsc
+super().__init__(self.bsc.addr(), port)
+
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/obj/osmo_vty.py 
b/src/osmo_gsm_tester/obj/osmo_vty.py
index 3f8abf7..6fee5dc 100644
--- a/src/osmo_gsm_tester/obj/osmo_vty.py
+++ b/src/osmo_gsm_tester/obj/osmo_vty.py
@@ -38,6 +38,9 @@

Using 'with' ensures that the connection is closed again.
There should not be nested 'with' statements on this object.
+
+   Note that test env objects (like tenv.bsc()) may keep a VTY connected 
until the test exits. A 'with' should not
+   be used on those.
 '''

 ##
diff --git a/src/osmo_gsm_tester/testenv.py b/src/osmo_gsm_tester/testenv.py
index a74891d..ebc8f91 100644
--- a/src/osmo_gsm_tester/testenv.py
+++ b/src/osmo_gsm_tester/testenv.py
@@ -235,7 +235,9 @@
 from .obj.bsc_osmo import OsmoBsc
 if ip_address is None:
 ip_address = self.ip_address()
-return OsmoBsc(self, msc, mgw, stp, ip_address)
+bsc_obj = OsmoBsc(self, msc, mgw, stp, ip_address)
+self.register_for_cleanup(bsc_obj)
+return bsc_obj

 def stp(self, ip_address=None):
 from .obj.stp_osmo import OsmoStp

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21505
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I06652db04fc9e48748f3c2196334f5352e9cc48a
Gerrit-Change-Number: 21505
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: keep Ctrl connections open for bsc, msc and nitb objects

2020-12-10 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21670 )


Change subject: keep Ctrl connections open for bsc, msc and nitb objects
..

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
---
M src/osmo_gsm_tester/obj/bsc_osmo.py
M src/osmo_gsm_tester/obj/msc_osmo.py
M src/osmo_gsm_tester/obj/nitb_osmo.py
M src/osmo_gsm_tester/testenv.py
4 files changed, 37 insertions(+), 14 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/70/21670/1

diff --git a/src/osmo_gsm_tester/obj/bsc_osmo.py 
b/src/osmo_gsm_tester/obj/bsc_osmo.py
index 510063a..877db29 100644
--- a/src/osmo_gsm_tester/obj/bsc_osmo.py
+++ b/src/osmo_gsm_tester/obj/bsc_osmo.py
@@ -50,6 +50,7 @@
 self.mgw = mgw
 self.stp = stp
 self.vty = None
+self.ctrl = None
 
 def start(self):
 self.log('Starting osmo-bsc')
@@ -84,6 +85,9 @@
 self.vty = OsmoBscVty(self)
 self.vty.connect()

+self.ctrl = OsmoBscCtrl(self)
+self.ctrl.connect()
+
 def configure(self):
 self.config_file = self.run_dir.new_file('osmo-bsc.cfg')
 self.dbg(config_file=self.config_file)
@@ -149,10 +153,8 @@
 # over this list, we have a 1:1 match in indexes.
 return self.bts.index(bts)

-def bts_is_connected(self, bts, use_ctrl=None):
-if use_ctrl is None:
-use_ctrl = self.ctrl()
-return use_ctrl.bts_is_connected(self.bts_num(bts))
+def bts_is_connected(self, bts):
+return self.ctrl.bts_is_connected(self.bts_num(bts))

 def running(self):
 return not self.process.terminated()
@@ -161,9 +163,9 @@
 if self.vty is not None:
 self.vty.disconnect()
 self.vty = None
-
-def ctrl(self):
-return OsmoBscCtrl(self)
+if self.ctrl is not None:
+self.ctrl.disconnect()
+self.ctrl = None

 class OsmoBscCtrl(osmo_ctrl.OsmoCtrl):
 def __init__(self, bsc, port=4249):
diff --git a/src/osmo_gsm_tester/obj/msc_osmo.py 
b/src/osmo_gsm_tester/obj/msc_osmo.py
index 5a7c0ba..550fb87 100644
--- a/src/osmo_gsm_tester/obj/msc_osmo.py
+++ b/src/osmo_gsm_tester/obj/msc_osmo.py
@@ -49,6 +49,7 @@
 self.mgw = mgw
 self.stp = stp
 self.smsc = smsc.Smsc((ip_address.get('addr'), 2775))
+self.ctrl = None

 def start(self):
 self.log('Starting osmo-msc')
@@ -75,6 +76,9 @@
 self.testenv.remember_to_stop(self.process)
 self.process.launch()

+self.ctrl = OsmoMscCtrl(self)
+self.ctrl.connect()
+
 def configure(self):
 self.config_file = self.run_dir.new_file('osmo-msc.cfg')
 self.dbg(config_file=self.config_file)
@@ -147,7 +151,7 @@
 return all([(imsi in attached) for imsi in imsis])

 def imsi_list_attached(self):
-return OsmoMscCtrl(self).subscriber_list_active()
+return self.ctrl.subscriber_list_active()

 def set_emergency_call_msisdn(self, msisdn):
 self.dbg('Setting Emergency Call MSISDN', msisdn=msisdn)
@@ -156,6 +160,11 @@
 def running(self):
 return not self.process.terminated()

+def cleanup(self):
+if self.ctrl is not None:
+self.ctrl.disconnect()
+self.ctrl = None
+

 class OsmoMscCtrl(osmo_ctrl.OsmoCtrl):
 def __init__(self, msc, port=4255):
diff --git a/src/osmo_gsm_tester/obj/nitb_osmo.py 
b/src/osmo_gsm_tester/obj/nitb_osmo.py
index ea00a75..a978b71 100644
--- a/src/osmo_gsm_tester/obj/nitb_osmo.py
+++ b/src/osmo_gsm_tester/obj/nitb_osmo.py
@@ -36,6 +36,7 @@
 self.ip_address = ip_address
 self.bts = []
 self.smsc = smsc.Smsc((ip_address.get('addr'), 2775))
+self.ctrl = None

 def start(self):
 self.log('Starting osmo-nitb')
@@ -62,6 +63,9 @@
 self.testenv.remember_to_stop(self.process)
 self.process.launch()

+self.ctrl = OsmoNitbCtrl(self)
+self.ctrl.connect()
+
 def configure(self):
 self.config_file = self.run_dir.new_file('osmo-nitb.cfg')
 self.dbg(config_file=self.config_file)
@@ -134,11 +138,11 @@
 raise log.Error("Auth algo %r selected and no KI specified" % algo)

 self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi())
-OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msi

Change in osmo-gsm-tester[master]: process output: do not leak ANSI colors past logged stdout/stderr

2020-12-10 Thread neels
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21565

to look at the new patch set (#2).

Change subject: process output: do not leak ANSI colors past logged 
stdout/stderr
..

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
---
M src/osmo_gsm_tester/core/process.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/65/21565/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21565
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ib9ac1eea4a12d6d43ac8614491f016bbe9ca17b1
Gerrit-Change-Number: 21565
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: add handover_2G suite, with handover.py test

2020-12-10 Thread neels
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21523

to look at the new patch set (#4).

Change subject: add handover_2G suite, with handover.py test
..

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
---
M src/osmo_gsm_tester/testenv.py
A sysmocom/handover-suites.conf
A sysmocom/scenarios/bts1-nanobts.conf
A sysmocom/scenarios/bts1-oc2g.conf
A sysmocom/scenarios/bts1-octphy.conf
A sysmocom/scenarios/bts1-sysmo.conf
A sysmocom/scenarios/bts1-trx-b200.conf
A sysmocom/scenarios/bts1-trx-lms-limenet-micro.conf
A sysmocom/scenarios/bts1-trx-lms.conf
A sysmocom/scenarios/bts1-trx-sysmocell5000.conf
A sysmocom/scenarios/bts1-trx-umtrx.conf
A sysmocom/suites/handover_2G/handover.py
A sysmocom/suites/handover_2G/suite.conf
13 files changed, 309 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/23/21523/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21523
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I0b2671304165a1aaae2b386af46fbd8b098e3bd8
Gerrit-Change-Number: 21523
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: add test.report_fragment()

2020-12-10 Thread neels
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21516

to look at the new patch set (#4).

Change subject: add test.report_fragment()
..

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
---
M selftest/suite_test/suite_test.ok
M selftest/suite_test/suite_test.ok.ign
M selftest/suite_test/suite_test.py
A selftest/suite_test/suitedirA/test_suite/test_report_fragment.py
M src/osmo_gsm_tester/core/report.py
M src/osmo_gsm_tester/core/test.py
6 files changed, 174 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/16/21516/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21516
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I4ca9100b6f8db24d1f7e0a09b3b7ba88b8ae3b59
Gerrit-Change-Number: 21516
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: log reserved resources

2020-12-10 Thread neels
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21510

to look at the new patch set (#4).

Change subject: log reserved resources
..

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
---
M selftest/suite_test/suite_test.ok
M src/osmo_gsm_tester/core/resource.py
M src/osmo_gsm_tester/core/suite.py
3 files changed, 67 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/10/21510/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21510
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ic23556eafee654c93d13c5ef405028da09bd51d7
Gerrit-Change-Number: 21510
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: OsmoCtrl cleanup: get_var(), set_var(), get_trap()

2020-12-10 Thread neels
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21564

to look at the new patch set (#2).

Change subject: OsmoCtrl cleanup: get_var(), set_var(), get_trap()
..

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
---
M src/osmo_gsm_tester/obj/bsc_osmo.py
M src/osmo_gsm_tester/obj/msc_osmo.py
M src/osmo_gsm_tester/obj/nitb_osmo.py
M src/osmo_gsm_tester/obj/osmo_ctrl.py
4 files changed, 186 insertions(+), 127 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/64/21564/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21564
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Id561e5a55d8057a997a8ec9e7fa6f94840194df1
Gerrit-Change-Number: 21564
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: osmo_ctrl.py: add RateCounters

2020-12-10 Thread neels
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21522

to look at the new patch set (#4).

Change subject: osmo_ctrl.py: add RateCounters
..

osmo_ctrl.py: add RateCounters

First user will be the upcoming handover_2G/handover.py test in
I0b2671304165a1aaae2b386af46fbd8b098e3bd8.

Change-Id: Id799b3bb81eb9c04d13c26ff611e40363920300e
---
A selftest/rate_ctrs_test/_prep.py
A selftest/rate_ctrs_test/rate_ctrs_test.err
A selftest/rate_ctrs_test/rate_ctrs_test.ok
A selftest/rate_ctrs_test/rate_ctrs_test.py
M src/osmo_gsm_tester/obj/osmo_ctrl.py
5 files changed, 453 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/22/21522/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21522
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Id799b3bb81eb9c04d13c26ff611e40363920300e
Gerrit-Change-Number: 21522
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: configure fixed ARFCN per bts

2020-12-10 Thread neels
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21511

to look at the new patch set (#4).

Change subject: configure fixed ARFCN per bts
..

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
---
M selftest/resource_test/conf/resources.conf
M selftest/resource_test/resource_test.ok
M selftest/resource_test/resource_test.py
M selftest/suite_test/resources.conf
M src/osmo_gsm_tester/core/schema.py
M src/osmo_gsm_tester/obj/bts_nanobts.py
M src/osmo_gsm_tester/obj/bts_oc2g.py
M sysmocom/defaults.conf
M sysmocom/resources.conf.prod
M sysmocom/resources.conf.rnd
10 files changed, 30 insertions(+), 179 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/11/21511/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21511
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I0a6c60544226f4261f9106013478d6a27fc39f38
Gerrit-Change-Number: 21511
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: implement test.get_log_output()

2020-12-10 Thread neels
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21515

to look at the new patch set (#4).

Change subject: implement test.get_log_output()
..

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
---
M src/osmo_gsm_tester/core/log.py
M src/osmo_gsm_tester/core/test.py
2 files changed, 42 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/15/21515/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21515
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Idfa0a45f3e6a18dd4fe692e81d732c70b5cffb76
Gerrit-Change-Number: 21515
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: process: add get_output_mark() and grep_output()

2020-12-10 Thread neels
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21512

to look at the new patch set (#4).

Change subject: process: add get_output_mark() and grep_output()
..

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
---
M src/osmo_gsm_tester/core/process.py
1 file changed, 53 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/12/21512/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21512
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ib6569f7486e9d961bd79a5f24232e58d053667a1
Gerrit-Change-Number: 21512
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: add bsc.vty: always keep a BSC VTY connection ready

2020-12-10 Thread neels
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21505

to look at the new patch set (#4).

Change subject: add bsc.vty: always keep a BSC VTY connection ready
..

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
---
M src/osmo_gsm_tester/obj/bsc_osmo.py
M src/osmo_gsm_tester/obj/osmo_vty.py
M src/osmo_gsm_tester/testenv.py
3 files changed, 21 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/05/21505/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21505
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I06652db04fc9e48748f3c2196334f5352e9cc48a
Gerrit-Change-Number: 21505
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: add osmo_vty.py

2020-12-10 Thread neels
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21504

to look at the new patch set (#4).

Change subject: add osmo_vty.py
..

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
---
A src/osmo_gsm_tester/obj/osmo_vty.py
1 file changed, 247 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/04/21504/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21504
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I7c17b143b7c690b8c4105ee7c6272670046fa91d
Gerrit-Change-Number: 21504
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: implement test.get_log_output()

2020-12-10 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21515 )

Change subject: implement test.get_log_output()
..


Patch Set 3:

> Patch Set 2:
>
> I'm not sure what are you attempting here, AFAIR we already printing test 
> output to the junit file.
> And if you want to put specific output instead (like a one line summarizing 
> some KPIs) that can be done from within the test. This is being used by 
> srsLTE objects/tests already.

The key element is getting a partial log, for ReportFragment.
A test like handover.py has an overall PASS/FAIL entry in the jenkins junit,
but there are also N sub-fragments representing a part of the test (like bts 
connect).
The use of this is so that when i click on jenkins on a fragment, i only see 
the logging for that part of the test. it saves scrolling in the overall log 
output to find the right place, and possibly confuse things.


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21515
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Idfa0a45f3e6a18dd4fe692e81d732c70b5cffb76
Gerrit-Change-Number: 21515
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 10 Dec 2020 23:15:59 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: configure fixed ARFCN per bts

2020-12-10 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21511 )

Change subject: configure fixed ARFCN per bts
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21511/2/sysmocom/resources.conf.prod
File sysmocom/resources.conf.prod:

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21511/2/sysmocom/resources.conf.prod@37
PS2, Line 37:   - arfcn: 870
> See sysmocom/default.conf: […]
the automatic arfcn overlay is gone with this patch.
the idea is that you always configure the arfcns in the resources.conf when 
there are two trx to be used.

i didn't realize there's still a default arfcn in defaults.conf

i also didn't realize that there's a mod file setting more trx after the fact,
so i thought all of our tests use only one trx.
so imo resources.conf should then put two fixed arfcns in the list that stay 
that way.

(a scenario mod could still put a different arfcn there if we wanted that)



--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21511
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I0a6c60544226f4261f9106013478d6a27fc39f38
Gerrit-Change-Number: 21511
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 10 Dec 2020 23:11:19 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: cfg templates: log level and source basename last, log no category-hex

2020-12-10 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21503 )

Change subject: cfg templates: log level and source basename last, log no 
category-hex
..

cfg templates: log level and source basename last, log no category-hex

Makes for saner log output in stderr files.

Change-Id: I2755beffd18d6779367c04e4aaaed119d66eb3be
---
M selftest/suite_test/suite_test.ok
M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-bts-oc2g.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-bts-virtual.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-ggsn.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-mgcpgw.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-pcu-oc2g.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-pcu-sysmo.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-pcu.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-sgsn.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-trx.cfg.tmpl
17 files changed, 51 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/selftest/suite_test/suite_test.ok 
b/selftest/suite_test/suite_test.ok
index 150a4e9..9d0493d 100644
--- a/selftest/suite_test/suite_test.ok
+++ b/selftest/suite_test/suite_test.ok
@@ -974,6 +974,9 @@
  logging filter all 1
  logging color 1
  logging print category 1
+ logging print category-hex 0
+ logging print level 1
+ logging print file basename last
  logging print extended-timestamp 1
  logging level set-all debug
 line vty
@@ -1001,6 +1004,9 @@
  logging filter all 1
  logging color 1
  logging print category 1
+ logging print category-hex 0
+ logging print level 1
+ logging print file basename last
  logging print extended-timestamp 1
  logging level set-all debug
 line vty
diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
index 66fa9e5..dd27da0 100644
--- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
@@ -3,6 +3,9 @@
  logging filter all 1
  logging color 1
  logging print category 1
+ logging print category-hex 0
+ logging print level 1
+ logging print file basename last
  logging print extended-timestamp 1
  logging level set-all debug
 line vty
diff --git a/src/osmo_gsm_tester/templates/osmo-bts-oc2g.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bts-oc2g.cfg.tmpl
index d4f73ad..7419729 100644
--- a/src/osmo_gsm_tester/templates/osmo-bts-oc2g.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bts-oc2g.cfg.tmpl
@@ -3,6 +3,9 @@
   logging color 1
   logging print extended-timestamp 1
   logging print category 1
+  logging print category-hex 0
+  logging print level 1
+  logging print file basename last
   logging level abis debug
   logging level oml debug
   logging level pag debug
diff --git a/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl
index b816036..5bc6cd4 100644
--- a/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl
@@ -3,6 +3,9 @@
   logging color 1
   logging print extended-timestamp 1
   logging print category 1
+  logging print category-hex 0
+  logging print level 1
+  logging print file basename last
   logging level abis debug
   logging level oml debug
   logging level pag debug
diff --git a/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl
index 2533354..a27f57d 100644
--- a/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl
@@ -3,6 +3,9 @@
   logging color 1
   logging print extended-timestamp 1
   logging print category 1
+  logging print category-hex 0
+  logging print level 1
+  logging print file basename last
   logging level abis debug
   logging level oml debug
   logging level pag debug
diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
index b202880..10a44e2 100644
--- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
@@ -3,6 +3,9 @@
   logging color 1
   logging print extended-timestamp 1
   logging print category 1
+  logging print category-hex 0
+  logging print level 1
+  logging print file basename last
   logging level abis debug
   logging level oml debug
   logging level pag debug
diff --git a/src/osmo_gsm_tester/templates/osmo-bts-virtual.cfg.tmpl 
b/src/osmo_gsm_tester/templates/

Change in osmo-ttcn3-hacks[master]: sgsn+pcu: Port suspend/resume cases to new BSSGP_CT:GLOBAL port

2020-12-10 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21669 )


Change subject: sgsn+pcu: Port suspend/resume cases to new BSSGP_CT:GLOBAL port
..

sgsn+pcu: Port suspend/resume cases to new BSSGP_CT:GLOBAL port

For 12+ days, suspend/resume related SGSN + PCU TTCN3 tets have been failing.

It was the introduction of the BSSGP_CT:GLOBAL test port in
I40d973d80709f5d56f59247e8647b52754f09bc8 +
I805372f3024a0ec2491a24422e02c0bc6dc669d2 which caused the related PDUs
now to no longer show up where they used to.

Change-Id: I1977302fef4868dc1c330bc6f48f6a6608949393
Closes: OS#4902
---
M library/BSSGP_Emulation.ttcnpp
M pcu/PCU_Tests.ttcn
M pcu/SGSN_Components.ttcn
M sgsn/SGSN_Tests.ttcn
4 files changed, 12 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/69/21669/1

diff --git a/library/BSSGP_Emulation.ttcnpp b/library/BSSGP_Emulation.ttcnpp
index 633eee2..5eef645 100644
--- a/library/BSSGP_Emulation.ttcnpp
+++ b/library/BSSGP_Emulation.ttcnpp
@@ -155,6 +155,7 @@
/* one port array for each client; allows talking to up to 3 BVC/Cell 
(handover, ...) */
port BSSGP_PT BSSGP[3]; /* PTP-BVC */
port BSSGP_PT BSSGP_SIG[3]; /* Signaling BVC */
+   port BSSGP_PT BSSGP_GLOBAL[3];  /* Signaling BVC */
port BSSGP_PROC_PT BSSGP_PROC[3];   /* registration / 
deregistration */
 };

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index dad0873..0c56348 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -327,7 +327,7 @@

T.start(2.0);
alt {
-   [] BSSGP_SIG[0].receive(tr_BSSGP_SUSPEND(tlli, 
mp_gb_cfg.bvc[0].cell_id.ra_id)) {
+   [] BSSGP_GLOBAL[0].receive(tr_BSSGP_SUSPEND(tlli, 
mp_gb_cfg.bvc[0].cell_id.ra_id)) {
setverdict(pass);
}
[] T.timeout {
diff --git a/pcu/SGSN_Components.ttcn b/pcu/SGSN_Components.ttcn
index ca1dec6..18f3992 100644
--- a/pcu/SGSN_Components.ttcn
+++ b/pcu/SGSN_Components.ttcn
@@ -101,6 +101,7 @@
connect(self:BSSGP_PROC[i], vc_BVC:BSSGP_PROC);
f_bssgp_client_register(mmctx.imsi, mmctx.tlli);
}
+   connect(self:BSSGP_GLOBAL[0], bssgp_component:GLOBAL);
 }

 /* Establish BSSGP connection to PCU */
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 0b298bb..8e7d6e4 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -480,14 +480,17 @@
connect(vc_conn:BSSGP[0], gb[0].vc_BSSGP_BVC[0]:BSSGP_SP);
connect(vc_conn:BSSGP_SIG[0], gb[0].vc_BSSGP_BVC[0]:BSSGP_SP_SIG);
connect(vc_conn:BSSGP_PROC[0], gb[0].vc_BSSGP_BVC[0]:BSSGP_PROC);
+   connect(vc_conn:BSSGP_GLOBAL[0], gb[0].vc_BSSGP:GLOBAL);

connect(vc_conn:BSSGP[1], gb[1].vc_BSSGP_BVC[0]:BSSGP_SP);
connect(vc_conn:BSSGP_SIG[1], gb[1].vc_BSSGP_BVC[0]:BSSGP_SP_SIG);
connect(vc_conn:BSSGP_PROC[1], gb[1].vc_BSSGP_BVC[0]:BSSGP_PROC);
+   connect(vc_conn:BSSGP_GLOBAL[1], gb[1].vc_BSSGP:GLOBAL);

connect(vc_conn:BSSGP[2], gb[2].vc_BSSGP_BVC[0]:BSSGP_SP);
connect(vc_conn:BSSGP_SIG[2], gb[2].vc_BSSGP_BVC[0]:BSSGP_SP_SIG);
connect(vc_conn:BSSGP_PROC[2], gb[2].vc_BSSGP_BVC[0]:BSSGP_PROC);
+   connect(vc_conn:BSSGP_GLOBAL[2], gb[2].vc_BSSGP:GLOBAL);

/* FIXME: support multiple RNCs */
if (g_ranap_enable) {
@@ -868,13 +871,13 @@
 friend function f_bssgp_suspend(integer ran_idx := 0) runs on BSSGP_ConnHdlr 
return OCT1 {
timer T := 5.0;
var PDU_BSSGP rx_pdu;
-   BSSGP_SIG[ran_idx].send(ts_BSSGP_SUSPEND(g_pars.tlli, 
g_pars.bssgp_cell_id[ran_idx].ra_id));
+   BSSGP_GLOBAL[ran_idx].send(ts_BSSGP_SUSPEND(g_pars.tlli, 
g_pars.bssgp_cell_id[ran_idx].ra_id));
T.start;
alt {
-   [] BSSGP_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_ACK(g_pars.tlli, 
g_pars.bssgp_cell_id[ran_idx].ra_id, ?)) -> value rx_pdu {
+   [] BSSGP_GLOBAL[ran_idx].receive(tr_BSSGP_SUSPEND_ACK(g_pars.tlli, 
g_pars.bssgp_cell_id[ran_idx].ra_id, ?)) -> value rx_pdu {
return 
rx_pdu.pDU_BSSGP_SUSPEND_ACK.suspend_Reference_Number.suspend_Reference_Number_value;
}
-   [] BSSGP_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_NACK(g_pars.tlli, 
g_pars.bssgp_cell_id[ran_idx].ra_id, ?)) -> value rx_pdu {
+   [] BSSGP_GLOBAL[ran_idx].receive(tr_BSSGP_SUSPEND_NACK(g_pars.tlli, 
g_pars.bssgp_cell_id[ran_idx].ra_id, ?)) -> value rx_pdu {
setverdict(fail, "SUSPEND-NACK in response to SUSPEND for TLLI 
", g_pars.tlli);
mtc.stop;
}
@@ -888,11 +891,11 @@

 friend function f_bssgp_resume(OCT1 susp_ref, integer ran_idx := 0) runs on 
BSSGP_ConnHdlr {
timer T := 5.0;
-   BSSGP_SIG[ran_idx].send(ts_BSSGP_RESUME(g_pars.tlli, 
g_pars.bssgp_cell_id[ran_idx].ra_id, susp_ref));
+   BSSGP_GLOBAL[ran_idx].send(ts_BSSGP_RESUME(g

Change in osmo-sgsn[master]: gbproxy: Don't create an extra msgb copy for SGSN DL SIG

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/21615 )

Change subject: gbproxy: Don't create an extra msgb copy for SGSN DL SIG
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21615
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I207a869ffac8bf60104f80f9ed58faf0021e5e95
Gerrit-Change-Number: 21615
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Comment-Date: Thu, 10 Dec 2020 21:16:38 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: gbproxy: Add test for FLOW-CONTROL-MS procedure (TC_fc_ms)

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21635 )

Change subject: gbproxy: Add test for FLOW-CONTROL-MS procedure (TC_fc_ms)
..

gbproxy: Add test for FLOW-CONTROL-MS procedure (TC_fc_ms)

Change-Id: Ie087ee8e8adfb963d21f35c60628214d4297250d
Closes: SYS#5210
---
M gbproxy/GBProxy_Tests.ttcn
M library/Osmocom_Gb_Types.ttcn
2 files changed, 134 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 5e81c13..655e396 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -2393,6 +2393,37 @@
f_cleanup();
 }

+/***
+ * FLOW-CONTROL-MS procedure
+ ***/
+
+private function f_TC_fc_ms(charstring id) runs on BSSGP_ConnHdlr {
+   var BssgpBvci bvci := g_pars.pcu[0].cfg.bvc[0].bvci;
+
+   var template (value) PDU_BSSGP fc_tx := ts_BVC_FC_MS(g_pars.tlli, 100, 
200, '12'O);
+   /* we cannot use pdu_tx as there are some subtle differences in the 
length field :/ */
+   var template (present) PDU_BSSGP fc_rx := tr_BVC_FC_MS(g_pars.tlli, 
100, 200, '12'O);
+   var template (value) PDU_BSSGP ack_tx := ts_BVC_FC_MS_ACK(g_pars.tlli, 
'12'O);
+
+   f_pcu2sgsn(fc_tx, fc_rx, use_sig := false);
+   f_sgsn2pcu(ack_tx, ack_tx, use_sig := false);
+
+   setverdict(pass);
+}
+/* Send a FLOW-CONTROL-MS from BSS side and expect it to show up on SGSN (PTP 
BVC) */
+testcase TC_fc_ms() runs on test_CT
+{
+   var BSSGP_ConnHdlr vc_conn;
+   f_init();
+
+   vc_conn := f_start_handler(refers(f_TC_fc_ms), testcasename(), g_pcu, 
g_sgsn, 21);
+   vc_conn.done;
+   /* TODO: start multiple handlers (UEs) on various cells on same and 
other NSEs */
+
+   f_cleanup();
+}
+
+

 control {
execute( TC_BVC_bringup() );
@@ -2456,6 +2487,7 @@

execute( TC_flush_ll() );
execute( TC_fc_bvc() );
+   execute( TC_fc_ms() );
 }


diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn
index ba05f7d..c532772 100644
--- a/library/Osmocom_Gb_Types.ttcn
+++ b/library/Osmocom_Gb_Types.ttcn
@@ -1262,6 +1262,108 @@
}
}

+   template (value) PDU_BSSGP ts_BVC_FC_MS(GprsTlli tlli, uint16_t bmax, 
uint16_t bucket_leak_rate,
+   OCT1 tag) := {
+   pDU_BSSGP_FLOW_CONTROL_MS := {
+   bssgpPduType := '28'O,
+   tLLI := ts_BSSGP_TLLI(tlli),
+   tag := {
+   iEI := '1E'O,
+   ext := '1'B,
+   lengthIndicator := {
+   length1 := 1
+   },
+   unstructured_Value := tag
+   },
+   mS_Bucket_Size := {
+   iEI := '12'O,
+   ext := '1'B,
+   lengthIndicator := {
+   length1 := 2
+   },
+   bmax := f_oct_or_wc(bmax, 2)
+   },
+   bucket_Leak_Rate := {
+   iEI := '03'O,
+   ext := '1'B,
+   lengthIndicator := {
+   length1 := 2
+   },
+   r_Value := f_oct_or_wc(bucket_leak_rate, 2)
+   },
+   bucket_Full_Ratio := omit,
+   flow_Control_Granularity := omit
+   }
+   }
+   template (present) PDU_BSSGP tr_BVC_FC_MS(template (present) GprsTlli 
tlli := ?,
+ template (present) uint16_t 
bmax := ?,
+ template (present) uint16_t 
bucket_leak_rate := ?,
+ template (present) OCT1 tag 
:= ?) := {
+   pDU_BSSGP_FLOW_CONTROL_MS := {
+   bssgpPduType := '28'O,
+   tLLI := ts_BSSGP_TLLI(tlli),
+   tag := {
+   iEI := '1E'O,
+   ext := '1'B,
+   lengthIndicator := {
+   length1 := 1
+   },
+   unstructured_Value := tag
+   },
+   mS_Bucket_Size := {
+   iEI := '12'O,
+ 

Change in osmo-ttcn3-hacks[master]: gbproxy: Add test for FLOW-CONTROL-MS procedure (TC_fc_ms)

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21635 )

Change subject: gbproxy: Add test for FLOW-CONTROL-MS procedure (TC_fc_ms)
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21635
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie087ee8e8adfb963d21f35c60628214d4297250d
Gerrit-Change-Number: 21635
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 10 Dec 2020 21:14:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: deps: Update AF_PACKET dependency to version with socket/bind race fix

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21668 )

Change subject: deps: Update AF_PACKET dependency to version with socket/bind 
race fix
..

deps: Update AF_PACKET dependency to version with socket/bind race fix

Change-Id: Icd773273d3ff8ff6d36ce472b8bd2e8a9b1e2e19
---
M deps/Makefile
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/deps/Makefile b/deps/Makefile
index 5435da2..61bab99 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -112,7 +112,7 @@
 titan.ProtocolModules.SUA_commit=  R.5.A-5-gcf1137a
 titan.ProtocolModules.TCP_commit=  R.3.A-5-g39e5f45
 titan.ProtocolModules.UDP_commit=  R.4.A-5-geea8aa3
-titan.TestPorts.AF_PACKET_commit=  0.1
+titan.TestPorts.AF_PACKET_commit=  0.1-1-gcd69809
 titan.TestPorts.Common_Components.Socket-API_commit=   R.6.A-6-gf4380d0
 titan.TestPorts.Common_Components.Abstract_Socket_commit=  R.9.B-4-gbd41994
 titan.TestPorts.HTTPmsg_commit=R.9.B-4-g9a0dfde

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21668
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icd773273d3ff8ff6d36ce472b8bd2e8a9b1e2e19
Gerrit-Change-Number: 21668
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: deps: Update AF_PACKET dependency to version with socket/bind race fix

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21668 )

Change subject: deps: Update AF_PACKET dependency to version with socket/bind 
race fix
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21668
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icd773273d3ff8ff6d36ce472b8bd2e8a9b1e2e19
Gerrit-Change-Number: 21668
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 10 Dec 2020 21:14:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_fr.c: Skip extraneous FIONBIO

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/21665 )

Change subject: gprs_ns2_fr.c: Skip extraneous FIONBIO
..

gprs_ns2_fr.c: Skip extraneous FIONBIO

The socket is marked non-blocking inside osmo_fd_register(), there
is no need to do it twice.

Change-Id: I2068ce8280357b14970d01e5c86de5c59c933650
---
M src/gb/gprs_ns2_fr.c
1 file changed, 1 insertion(+), 9 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 8befe1c..c774e11 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -303,7 +303,7 @@
 {
struct sockaddr_ll addr;
int ifindex;
-   int fd, rc, on = 1;
+   int fd, rc;

ifindex = devname2ifindex(ifname);
if (ifindex < 0) {
@@ -322,14 +322,6 @@
return fd;
}

-   if (ioctl(fd, FIONBIO, (unsigned char *)&on) < 0) {
-   LOGP(DLGLOBAL, LOGL_ERROR,
-   "cannot set this socket unblocking: %s\n",
-   strerror(errno));
-   close(fd);
-   return -EINVAL;
-   }
-
rc = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
if (rc < 0) {
LOGP(DLNS, LOGL_ERROR, "Can not bind for interface %s\n", 
ifname);

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21665
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2068ce8280357b14970d01e5c86de5c59c933650
Gerrit-Change-Number: 21665
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in libosmocore[master]: gprs_ns2_fr: use ETH_P_HDLC instead of ETH_P_ALL

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/21667 )

Change subject: gprs_ns2_fr: use ETH_P_HDLC instead of ETH_P_ALL
..

gprs_ns2_fr: use ETH_P_HDLC instead of ETH_P_ALL

When opening the socket, use ETH_P_HLDC to restrict the socket to
packet received on HLDC interfaces.  This avoids packets from random
other (ethernet, ...) interfaces to appear before we can bind()
it to the actual hdlc-net-device we're interested in.

We still are racing against other HLDC net-devices, but those have
lower PPS and throughput ratese as 1G/10G or even higher speed ethernet
devices that might exist on the same machine.

Change-Id: I6a556e6e2d012c17a2777cc8b30fed0f318db178
---
M src/gb/gprs_ns2_fr.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 0e4e2d3..2d5b021 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -317,7 +317,7 @@
addr.sll_protocol = htons(ETH_P_ALL);
addr.sll_ifindex = ifindex;

-   fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+   fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_HDLC));
if (fd < 0) {
LOGP(DLNS, LOGL_ERROR, "Can not create AF_PACKET socket. Are 
you root or have CAP_RAW_SOCKET?\n");
return fd;

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21667
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6a556e6e2d012c17a2777cc8b30fed0f318db178
Gerrit-Change-Number: 21667
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in libosmocore[master]: gprs_ns2_fr: guard against race between socket(AF_PACKET) and bind()

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/21666 )

Change subject: gprs_ns2_fr: guard against race between socket(AF_PACKET) and 
bind()
..

gprs_ns2_fr: guard against race between socket(AF_PACKET) and bind()

An AF_PACKET socket will immediately receive packets of _all_ interfaces
until it is bound to one specific interface.  This introduces a race
condition between the socket() and the bind() syscall.

Let's use the ifindex passed for each packet in recvmsg() to drop
any packets received for other interfaces.

Change-Id: I8f708ba4f9b7f76525acce17b24a8f7b125a1c1c
Related: SYS#5245
---
M src/gb/gprs_ns2_fr.c
1 file changed, 23 insertions(+), 12 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index c774e11..0e4e2d3 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -86,6 +86,7 @@
struct osmo_fd fd;
char netif[IF_NAMESIZE];
struct osmo_fr_link *link;
+   int ifindex;
bool if_running;
 };

@@ -196,12 +197,14 @@
struct gprs_ns2_vc_bind *bind = bfd->data;
struct priv_bind *priv = bind->priv;
struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "Gb/NS/FR/GRE Rx");
+   struct sockaddr_ll sll;
+   socklen_t sll_len = sizeof(sll);
int rc = 0;

if (!msg)
return -ENOMEM;

-   rc = read(bfd->fd, msg->data, NS_ALLOC_SIZE);
+   rc = recvfrom(bfd->fd, msg->data, NS_ALLOC_SIZE, 0, (struct sockaddr 
*)&sll, &sll_len);
if (rc < 0) {
LOGP(DLNS, LOGL_ERROR, "recv error %s during NS-FR-GRE recv\n",
 strerror(errno));
@@ -210,6 +213,11 @@
goto out_err;
}

+   /* ignore any packets that we might have received for a different 
interface, between
+* the socket() and the bind() call */
+   if (sll.sll_ifindex != priv->ifindex)
+   goto out_err;
+
msgb_put(msg, rc);
msg->dst = priv->link;
return osmo_fr_rx(msg);
@@ -299,18 +307,11 @@
return ifr.ifr_ifindex;
 }

-static int open_socket(const char *ifname)
+static int open_socket(int ifindex)
 {
struct sockaddr_ll addr;
-   int ifindex;
int fd, rc;

-   ifindex = devname2ifindex(ifname);
-   if (ifindex < 0) {
-   LOGP(DLNS, LOGL_ERROR, "Can not get interface index for 
interface %s\n", ifname);
-   return ifindex;
-   }
-
memset(&addr, 0, sizeof(addr));
addr.sll_family = AF_PACKET;
addr.sll_protocol = htons(ETH_P_ALL);
@@ -318,13 +319,16 @@

fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
if (fd < 0) {
-   LOGP(DLNS, LOGL_ERROR, "Can not get socket for interface %s. 
Are you root or have CAP_RAW_SOCKET?\n", ifname);
+   LOGP(DLNS, LOGL_ERROR, "Can not create AF_PACKET socket. Are 
you root or have CAP_RAW_SOCKET?\n");
return fd;
}

+   /* there's a race condition between the above syscall and the bind() 
call below,
+* causing other packets to be received in between */
+
rc = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
if (rc < 0) {
-   LOGP(DLNS, LOGL_ERROR, "Can not bind for interface %s\n", 
ifname);
+   LOGP(DLNS, LOGL_ERROR, "Can not bind AF_PACKET socket to 
ifindex %d\n", ifindex);
close(fd);
return rc;
}
@@ -496,7 +500,14 @@
fr_link->tx_cb = fr_tx_cb;
fr_link->tx_cb_data = bind;
priv->link = fr_link;
-   priv->fd.fd = rc = open_socket(netif);
+
+   priv->ifindex = devname2ifindex(netif);
+   if (priv->ifindex < 0) {
+   LOGP(DLNS, LOGL_ERROR, "Can not get interface index for 
interface %s\n", netif);
+   goto err_fr;
+   }
+
+   priv->fd.fd = rc = open_socket(priv->ifindex);
if (rc < 0)
goto err_fr;


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21666
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8f708ba4f9b7f76525acce17b24a8f7b125a1c1c
Gerrit-Change-Number: 21666
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in libosmocore[master]: gprs_ns2_fr: use ETH_P_HDLC instead of ETH_P_ALL

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/21667 )

Change subject: gprs_ns2_fr: use ETH_P_HDLC instead of ETH_P_ALL
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21667
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6a556e6e2d012c17a2777cc8b30fed0f318db178
Gerrit-Change-Number: 21667
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 10 Dec 2020 21:13:47 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: deps: Update AF_PACKET dependency to version with socket/bind race fix

2020-12-10 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21668 )


Change subject: deps: Update AF_PACKET dependency to version with socket/bind 
race fix
..

deps: Update AF_PACKET dependency to version with socket/bind race fix

Change-Id: Icd773273d3ff8ff6d36ce472b8bd2e8a9b1e2e19
---
M deps/Makefile
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/68/21668/1

diff --git a/deps/Makefile b/deps/Makefile
index 5435da2..61bab99 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -112,7 +112,7 @@
 titan.ProtocolModules.SUA_commit=  R.5.A-5-gcf1137a
 titan.ProtocolModules.TCP_commit=  R.3.A-5-g39e5f45
 titan.ProtocolModules.UDP_commit=  R.4.A-5-geea8aa3
-titan.TestPorts.AF_PACKET_commit=  0.1
+titan.TestPorts.AF_PACKET_commit=  0.1-1-gcd69809
 titan.TestPorts.Common_Components.Socket-API_commit=   R.6.A-6-gf4380d0
 titan.TestPorts.Common_Components.Abstract_Socket_commit=  R.9.B-4-gbd41994
 titan.TestPorts.HTTPmsg_commit=R.9.B-4-g9a0dfde

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21668
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icd773273d3ff8ff6d36ce472b8bd2e8a9b1e2e19
Gerrit-Change-Number: 21668
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in titan.TestPorts.AF_PACKET[master]: guard against race between socket(AF_PACKET) and bind()

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/titan.TestPorts.AF_PACKET/+/21664 )

Change subject: guard against race between socket(AF_PACKET) and bind()
..

guard against race between socket(AF_PACKET) and bind()

An AF_PACKET socket will immediately receive packets of _all_ interfaces
until it is bound to one specific interface.  This introduces a race
condition between the socket() and the bind() syscall.

Let's use the ifindex passed for each packet in recvmsg() to drop
any packets received for other interfaces.

Change-Id: Icd0b23eb1d6f75ca3a05e5dd1a569fa389903fdf
---
M src/AF_PACKET_PT.cc
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved; Verified



diff --git a/src/AF_PACKET_PT.cc b/src/AF_PACKET_PT.cc
index 3f46216..aa2def6 100644
--- a/src/AF_PACKET_PT.cc
+++ b/src/AF_PACKET_PT.cc
@@ -118,14 +118,23 @@
return;

if (is_readable) {
+   struct sockaddr_ll sll;
+   socklen_t sll_len = sizeof(sll);
int rc;

-   rc = read(fd, mRxBuf, sizeof(mRxBuf));
+   rc = recvfrom(fd, mRxBuf, sizeof(mRxBuf), 0, (struct sockaddr 
*)&sll, &sll_len);
if (rc < 0)
TTCN_error("Error reading from socket: %s", 
strerror(errno));
if (rc == 0)
TTCN_error("Dead socket: %s", strerror(errno));

+   /* ignore any packets that we might have received for a 
different interface, between
+* the socket() and the bind() call */
+   if (sll.sll_ifindex != mIfindex)
+   return;
+
+   /* TODO: report the other meta-data fields like sll_pkttype via 
the port */
+
incoming_message(AF__PACKET__Unitdata(OCTETSTRING(rc, mRxBuf)));
}
 }

--
To view, visit https://gerrit.osmocom.org/c/titan.TestPorts.AF_PACKET/+/21664
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: titan.TestPorts.AF_PACKET
Gerrit-Branch: master
Gerrit-Change-Id: Icd0b23eb1d6f75ca3a05e5dd1a569fa389903fdf
Gerrit-Change-Number: 21664
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in titan.TestPorts.AF_PACKET[master]: guard against race between socket(AF_PACKET) and bind()

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/titan.TestPorts.AF_PACKET/+/21664 )

Change subject: guard against race between socket(AF_PACKET) and bind()
..


Patch Set 2: Verified+1 Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/titan.TestPorts.AF_PACKET/+/21664
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: titan.TestPorts.AF_PACKET
Gerrit-Branch: master
Gerrit-Change-Id: Icd0b23eb1d6f75ca3a05e5dd1a569fa389903fdf
Gerrit-Change-Number: 21664
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 10 Dec 2020 21:10:51 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_fr.c: Skip extraneous FIONBIO

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/21665 )

Change subject: gprs_ns2_fr.c: Skip extraneous FIONBIO
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21665
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2068ce8280357b14970d01e5c86de5c59c933650
Gerrit-Change-Number: 21665
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 10 Dec 2020 21:10:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_fr: guard against race between socket(AF_PACKET) and bind()

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/21666 )

Change subject: gprs_ns2_fr: guard against race between socket(AF_PACKET) and 
bind()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21666
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8f708ba4f9b7f76525acce17b24a8f7b125a1c1c
Gerrit-Change-Number: 21666
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 10 Dec 2020 21:10:25 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_fr: use ETH_P_HDLC instead of ETH_P_ALL

2020-12-10 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/21667 )


Change subject: gprs_ns2_fr: use ETH_P_HDLC instead of ETH_P_ALL
..

gprs_ns2_fr: use ETH_P_HDLC instead of ETH_P_ALL

When opening the socket, use ETH_P_HLDC to restrict the socket to
packet received on HLDC interfaces.  This avoids packets from random
other (ethernet, ...) interfaces to appear before we can bind()
it to the actual hdlc-net-device we're interested in.

We still are racing against other HLDC net-devices, but those have
lower PPS and throughput ratese as 1G/10G or even higher speed ethernet
devices that might exist on the same machine.

Change-Id: I6a556e6e2d012c17a2777cc8b30fed0f318db178
---
M src/gb/gprs_ns2_fr.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/21667/1

diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 0e4e2d3..2d5b021 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -317,7 +317,7 @@
addr.sll_protocol = htons(ETH_P_ALL);
addr.sll_ifindex = ifindex;

-   fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+   fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_HDLC));
if (fd < 0) {
LOGP(DLNS, LOGL_ERROR, "Can not create AF_PACKET socket. Are 
you root or have CAP_RAW_SOCKET?\n");
return fd;

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21667
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6a556e6e2d012c17a2777cc8b30fed0f318db178
Gerrit-Change-Number: 21667
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in libosmocore[master]: gprs_ns2_fr: guard against race between socket(AF_PACKET) and bind()

2020-12-10 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/21666 )


Change subject: gprs_ns2_fr: guard against race between socket(AF_PACKET) and 
bind()
..

gprs_ns2_fr: guard against race between socket(AF_PACKET) and bind()

An AF_PACKET socket will immediately receive packets of _all_ interfaces
until it is bound to one specific interface.  This introduces a race
condition between the socket() and the bind() syscall.

Let's use the ifindex passed for each packet in recvmsg() to drop
any packets received for other interfaces.

Change-Id: I8f708ba4f9b7f76525acce17b24a8f7b125a1c1c
Related: SYS#5245
---
M src/gb/gprs_ns2_fr.c
1 file changed, 23 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/21666/1

diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index c774e11..0e4e2d3 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -86,6 +86,7 @@
struct osmo_fd fd;
char netif[IF_NAMESIZE];
struct osmo_fr_link *link;
+   int ifindex;
bool if_running;
 };

@@ -196,12 +197,14 @@
struct gprs_ns2_vc_bind *bind = bfd->data;
struct priv_bind *priv = bind->priv;
struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "Gb/NS/FR/GRE Rx");
+   struct sockaddr_ll sll;
+   socklen_t sll_len = sizeof(sll);
int rc = 0;
 
if (!msg)
return -ENOMEM;

-   rc = read(bfd->fd, msg->data, NS_ALLOC_SIZE);
+   rc = recvfrom(bfd->fd, msg->data, NS_ALLOC_SIZE, 0, (struct sockaddr 
*)&sll, &sll_len);
if (rc < 0) {
LOGP(DLNS, LOGL_ERROR, "recv error %s during NS-FR-GRE recv\n",
 strerror(errno));
@@ -210,6 +213,11 @@
goto out_err;
}

+   /* ignore any packets that we might have received for a different 
interface, between
+* the socket() and the bind() call */
+   if (sll.sll_ifindex != priv->ifindex)
+   goto out_err;
+
msgb_put(msg, rc);
msg->dst = priv->link;
return osmo_fr_rx(msg);
@@ -299,18 +307,11 @@
return ifr.ifr_ifindex;
 }

-static int open_socket(const char *ifname)
+static int open_socket(int ifindex)
 {
struct sockaddr_ll addr;
-   int ifindex;
int fd, rc;

-   ifindex = devname2ifindex(ifname);
-   if (ifindex < 0) {
-   LOGP(DLNS, LOGL_ERROR, "Can not get interface index for 
interface %s\n", ifname);
-   return ifindex;
-   }
-
memset(&addr, 0, sizeof(addr));
addr.sll_family = AF_PACKET;
addr.sll_protocol = htons(ETH_P_ALL);
@@ -318,13 +319,16 @@

fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
if (fd < 0) {
-   LOGP(DLNS, LOGL_ERROR, "Can not get socket for interface %s. 
Are you root or have CAP_RAW_SOCKET?\n", ifname);
+   LOGP(DLNS, LOGL_ERROR, "Can not create AF_PACKET socket. Are 
you root or have CAP_RAW_SOCKET?\n");
return fd;
}

+   /* there's a race condition between the above syscall and the bind() 
call below,
+* causing other packets to be received in between */
+
rc = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
if (rc < 0) {
-   LOGP(DLNS, LOGL_ERROR, "Can not bind for interface %s\n", 
ifname);
+   LOGP(DLNS, LOGL_ERROR, "Can not bind AF_PACKET socket to 
ifindex %d\n", ifindex);
close(fd);
return rc;
}
@@ -496,7 +500,14 @@
fr_link->tx_cb = fr_tx_cb;
fr_link->tx_cb_data = bind;
priv->link = fr_link;
-   priv->fd.fd = rc = open_socket(netif);
+
+   priv->ifindex = devname2ifindex(netif);
+   if (priv->ifindex < 0) {
+   LOGP(DLNS, LOGL_ERROR, "Can not get interface index for 
interface %s\n", netif);
+   goto err_fr;
+   }
+
+   priv->fd.fd = rc = open_socket(priv->ifindex);
if (rc < 0)
goto err_fr;


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21666
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8f708ba4f9b7f76525acce17b24a8f7b125a1c1c
Gerrit-Change-Number: 21666
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in libosmocore[master]: gprs_ns2_fr.c: Skip extraneous FIONBIO

2020-12-10 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/21665 )


Change subject: gprs_ns2_fr.c: Skip extraneous FIONBIO
..

gprs_ns2_fr.c: Skip extraneous FIONBIO

The socket is marked non-blocking inside osmo_fd_register(), there
is no need to do it twice.

Change-Id: I2068ce8280357b14970d01e5c86de5c59c933650
---
M src/gb/gprs_ns2_fr.c
1 file changed, 1 insertion(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/65/21665/1

diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 8befe1c..c774e11 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -303,7 +303,7 @@
 {
struct sockaddr_ll addr;
int ifindex;
-   int fd, rc, on = 1;
+   int fd, rc;

ifindex = devname2ifindex(ifname);
if (ifindex < 0) {
@@ -322,14 +322,6 @@
return fd;
}

-   if (ioctl(fd, FIONBIO, (unsigned char *)&on) < 0) {
-   LOGP(DLGLOBAL, LOGL_ERROR,
-   "cannot set this socket unblocking: %s\n",
-   strerror(errno));
-   close(fd);
-   return -EINVAL;
-   }
-
rc = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
if (rc < 0) {
LOGP(DLNS, LOGL_ERROR, "Can not bind for interface %s\n", 
ifname);

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21665
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2068ce8280357b14970d01e5c86de5c59c933650
Gerrit-Change-Number: 21665
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in titan.TestPorts.AF_PACKET[master]: guard against race between socket(AF_PACKET) and bind()

2020-12-10 Thread laforge
laforge has uploaded a new patch set (#2). ( 
https://gerrit.osmocom.org/c/titan.TestPorts.AF_PACKET/+/21664 )

Change subject: guard against race between socket(AF_PACKET) and bind()
..

guard against race between socket(AF_PACKET) and bind()

An AF_PACKET socket will immediately receive packets of _all_ interfaces
until it is bound to one specific interface.  This introduces a race
condition between the socket() and the bind() syscall.

Let's use the ifindex passed for each packet in recvmsg() to drop
any packets received for other interfaces.

Change-Id: Icd0b23eb1d6f75ca3a05e5dd1a569fa389903fdf
---
M src/AF_PACKET_PT.cc
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/titan.TestPorts.AF_PACKET 
refs/changes/64/21664/2
--
To view, visit https://gerrit.osmocom.org/c/titan.TestPorts.AF_PACKET/+/21664
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: titan.TestPorts.AF_PACKET
Gerrit-Branch: master
Gerrit-Change-Id: Icd0b23eb1d6f75ca3a05e5dd1a569fa389903fdf
Gerrit-Change-Number: 21664
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-MessageType: newpatchset


Change in titan.TestPorts.AF_PACKET[master]: guard against race between socket(AF_PACKET) and bind()

2020-12-10 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/titan.TestPorts.AF_PACKET/+/21664 )


Change subject: guard against race between socket(AF_PACKET) and bind()
..

guard against race between socket(AF_PACKET) and bind()

An AF_PACKET socket will immediately receive packets of _all_ interfaces
until it is bound to one specific interface.  This introduces a race
condition between the socket() and the bind() syscall.

Let's use the ifindex passed for each packet in recvmsg() to drop
any packets received for other interfaces.

Change-Id: Icd0b23eb1d6f75ca3a05e5dd1a569fa389903fdf
---
M src/AF_PACKET_PT.cc
1 file changed, 10 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/titan.TestPorts.AF_PACKET 
refs/changes/64/21664/1

diff --git a/src/AF_PACKET_PT.cc b/src/AF_PACKET_PT.cc
index 3f46216..a1ccfe8 100644
--- a/src/AF_PACKET_PT.cc
+++ b/src/AF_PACKET_PT.cc
@@ -118,14 +118,23 @@
return;

if (is_readable) {
+   struct sockaddr_ll sll;
+   socklen_t sll_len = sizeof(sll);
int rc;

-   rc = read(fd, mRxBuf, sizeof(mRxBuf));
+   rc = recvfrom(fd, mRxBuf, sizeof(mRxBuf), 0, (struct sockaddr 
*)&sll, &sll_len);
if (rc < 0)
TTCN_error("Error reading from socket: %s", 
strerror(errno));
if (rc == 0)
TTCN_error("Dead socket: %s", strerror(errno));

+   /* ignore any packets that we might have received for a 
different inerface, between
+* the socket() and the bind() call */
+   if (sll.sll_ifindex != mIfindex)
+   return;
+
+   /* TODO: report the other meta-data fields like sll_pkttype via 
the port */
+
incoming_message(AF__PACKET__Unitdata(OCTETSTRING(rc, mRxBuf)));
}
 }

--
To view, visit https://gerrit.osmocom.org/c/titan.TestPorts.AF_PACKET/+/21664
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: titan.TestPorts.AF_PACKET
Gerrit-Branch: master
Gerrit-Change-Id: Icd0b23eb1d6f75ca3a05e5dd1a569fa389903fdf
Gerrit-Change-Number: 21664
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in osmo-sgsn[master]: gbproxy: Don't create an extra msgb copy for SGSN DL SIG

2020-12-10 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/21615 )

Change subject: gbproxy: Don't create an extra msgb copy for SGSN DL SIG
..


Patch Set 5: Code-Review+1

(2 comments)

https://gerrit.osmocom.org/c/osmo-sgsn/+/21615/4/src/gbproxy/gb_proxy.c
File src/gbproxy/gb_proxy.c:

https://gerrit.osmocom.org/c/osmo-sgsn/+/21615/4/src/gbproxy/gb_proxy.c@929
PS4, Line 929:  msgb_free(msg);
> We should not free the msg here at all, this is done in 
> gprs_ns_prim_status_cb()
Done


https://gerrit.osmocom.org/c/osmo-sgsn/+/21615/4/src/gbproxy/gb_proxy.c@1030
PS4, Line 1030: msgb_free(msg);
> Same (and it's used in the line just below)
Done



--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21615
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I207a869ffac8bf60104f80f9ed58faf0021e5e95
Gerrit-Change-Number: 21615
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Comment-Date: Thu, 10 Dec 2020 17:21:04 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: daniel 
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: gbproxy: Introduce new DOBJ log category; log object allocation/release

2020-12-10 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/21614 )

Change subject: gbproxy: Introduce new DOBJ log category; log object 
allocation/release
..


Patch Set 5: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21614
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I43bcbcda8667d193e7a17fd8e8e9109597b01484
Gerrit-Change-Number: 21614
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Comment-Date: Thu, 10 Dec 2020 17:19:52 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: gbproxy: Use "(nsei << 16) | bvci" as rate_ctr_group index

2020-12-10 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/21613 )

Change subject: gbproxy: Use "(nsei << 16) | bvci" as rate_ctr_group index
..


Patch Set 5: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21613
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I13f3c9e69562a56ad7d3742fdeb2ba48f134fdaa
Gerrit-Change-Number: 21613
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Comment-Date: Thu, 10 Dec 2020 17:19:18 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: gbproxy major rewrite for SGSN pool support

2020-12-10 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/21612 )

Change subject: gbproxy major rewrite for SGSN pool support
..


Patch Set 5: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21612
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie0746f17927a9509c3806cc80dc1a31d25df7937
Gerrit-Change-Number: 21612
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Comment-Date: Thu, 10 Dec 2020 17:18:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: gbproxy: Fix bvci check in gbprox_rx_ptp_from_*

2020-12-10 Thread daniel
daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/21663 )


Change subject: gbproxy: Fix bvci check in gbprox_rx_ptp_from_*
..

gbproxy: Fix bvci check in gbprox_rx_ptp_from_*

The check for bvci in _rx_ptp_from_* was always false.

Change-Id: I16a0284ba3201c146c307db6997a416589d7e693
Related: OS#4472
---
M src/gbproxy/gb_proxy.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/63/21663/1

diff --git a/src/gbproxy/gb_proxy.c b/src/gbproxy/gb_proxy.c
index 06023c4..ed4dbeb 100644
--- a/src/gbproxy/gb_proxy.c
+++ b/src/gbproxy/gb_proxy.c
@@ -250,7 +250,7 @@

LOGP(DGPRS, LOGL_DEBUG, "%s Rx %s\n", log_pfx, pdut_name);

-   if (ns_bvci == 0 && ns_bvci == 1) {
+   if (ns_bvci == 0 || ns_bvci == 1) {
LOGP(DGPRS, LOGL_NOTICE, "%s BVCI=%05u is not PTP\n", log_pfx, 
ns_bvci);
return bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, msg);
}
@@ -360,7 +360,7 @@

LOGP(DGPRS, LOGL_DEBUG, "%s Rx %s\n", log_pfx, pdut_name);

-   if (ns_bvci == 0 && ns_bvci == 1) {
+   if (ns_bvci == 0 || ns_bvci == 1) {
LOGP(DGPRS, LOGL_NOTICE, "%s BVCI is not PTP\n", log_pfx);
return bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, msg);
}

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I16a0284ba3201c146c307db6997a416589d7e693
Gerrit-Change-Number: 21663
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-MessageType: newchange


Change in osmo-sgsn[master]: gbproxy: Don't create an extra msgb copy for SGSN DL SIG

2020-12-10 Thread daniel
daniel has uploaded a new patch set (#5) to the change originally created by 
laforge. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/21615 )

Change subject: gbproxy: Don't create an extra msgb copy for SGSN DL SIG
..

gbproxy: Don't create an extra msgb copy for SGSN DL SIG

That copy may have made sense while we were doing patching/buffering,
but we're not doing any of that anymore.

Related: OS#4472
Change-Id: I207a869ffac8bf60104f80f9ed58faf0021e5e95
---
M src/gbproxy/gb_proxy.c
1 file changed, 9 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/15/21615/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21615
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I207a869ffac8bf60104f80f9ed58faf0021e5e95
Gerrit-Change-Number: 21615
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-MessageType: newpatchset


Change in osmo-sgsn[master]: gbproxy major rewrite for SGSN pool support

2020-12-10 Thread daniel
daniel has uploaded a new patch set (#5) to the change originally created by 
laforge. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/21612 )

Change subject: gbproxy major rewrite for SGSN pool support
..

gbproxy major rewrite for SGSN pool support

Rewrite of a large part of osmo-gbproxy in order to prepare
for SGSN pool support.  The amount of changes are of such fundamental
nature that it doesn't make sense to try to split this into hundreds
of individual changesets.

Related: OS#4472
Change-Id: Ie0746f17927a9509c3806cc80dc1a31d25df7937
---
M include/osmocom/sgsn/gb_proxy.h
M src/gbproxy/gb_proxy.c
M src/gbproxy/gb_proxy_ctrl.c
M src/gbproxy/gb_proxy_main.c
M src/gbproxy/gb_proxy_peer.c
M src/gbproxy/gb_proxy_vty.c
M tests/vty_test_runner.py
7 files changed, 868 insertions(+), 480 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/12/21612/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21612
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie0746f17927a9509c3806cc80dc1a31d25df7937
Gerrit-Change-Number: 21612
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-MessageType: newpatchset


Change in osmo-sgsn[master]: gbproxy: Don't create an extra msgb copy for SGSN DL SIG

2020-12-10 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/21615 )

Change subject: gbproxy: Don't create an extra msgb copy for SGSN DL SIG
..


Patch Set 4:

(2 comments)

https://gerrit.osmocom.org/c/osmo-sgsn/+/21615/4/src/gbproxy/gb_proxy.c
File src/gbproxy/gb_proxy.c:

https://gerrit.osmocom.org/c/osmo-sgsn/+/21615/4/src/gbproxy/gb_proxy.c@929
PS4, Line 929:  msgb_free(msg);
We should not free the msg here at all, this is done in gprs_ns_prim_status_cb()


https://gerrit.osmocom.org/c/osmo-sgsn/+/21615/4/src/gbproxy/gb_proxy.c@1030
PS4, Line 1030: msgb_free(msg);
Same (and it's used in the line just below)



--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21615
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I207a869ffac8bf60104f80f9ed58faf0021e5e95
Gerrit-Change-Number: 21615
Gerrit-PatchSet: 4
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: daniel 
Gerrit-Comment-Date: Thu, 10 Dec 2020 17:13:13 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: gbproxy major rewrite for SGSN pool support

2020-12-10 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/21612 )

Change subject: gbproxy major rewrite for SGSN pool support
..


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/c/osmo-sgsn/+/21612/4/src/gbproxy/gb_proxy_vty.c
File src/gbproxy/gb_proxy_vty.c:

https://gerrit.osmocom.org/c/osmo-sgsn/+/21612/4/src/gbproxy/gb_proxy_vty.c@223
PS4, Line 223:  vty_out(vty, "NSE not found%s", VTY_NEWLINE);
This breaks jenkins/VTY test expectations



--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21612
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie0746f17927a9509c3806cc80dc1a31d25df7937
Gerrit-Change-Number: 21612
Gerrit-PatchSet: 4
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: daniel 
Gerrit-Comment-Date: Thu, 10 Dec 2020 17:13:06 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in openbsc[master]: Bump version: 1.3.3.4-e5e69 → 1.4.0

2020-12-10 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/openbsc/+/21658 )

Change subject: Bump version: 1.3.3.4-e5e69 → 1.4.0
..

Bump version: 1.3.3.4-e5e69 → 1.4.0

Change-Id: I80698b962666b94310a84306149d67ae09153c8e
---
M debian/changelog
1 file changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/debian/changelog b/debian/changelog
index 170c84d..6d6405b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+openbsc (1.4.0) unstable; urgency=medium
+
+  [ Harald Welte ]
+  * Migrate from BSC_FD_* to OSMO_FD_*
+  * Add very clear obsolescence / unmaintained warnings
+
+  [ Pau Espin Pedrol ]
+  * bsc-nat: generate coredump and exit upon SIGABRT received
+  * osmo-nitb: generate coredump and exit upon SIGABRT received
+
+ -- Pau Espin Pedrol   Thu, 10 Dec 2020 17:07:14 +0100
+
 openbsc (1.3.3) unstable; urgency=medium

   [ Keith ]

--
To view, visit https://gerrit.osmocom.org/c/openbsc/+/21658
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Change-Id: I80698b962666b94310a84306149d67ae09153c8e
Gerrit-Change-Number: 21658
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in openbsc[master]: Bump version: 1.3.3.4-e5e69 → 1.4.0

2020-12-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/openbsc/+/21658 )

Change subject: Bump version: 1.3.3.4-e5e69 → 1.4.0
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/openbsc/+/21658
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Change-Id: I80698b962666b94310a84306149d67ae09153c8e
Gerrit-Change-Number: 21658
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 10 Dec 2020 16:44:43 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in docker-playground[master]: ttcn3-bts-test: fix: sleep 2 seconds before respawning the IUT

2020-12-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/21640 )

Change subject: ttcn3-bts-test: fix: sleep 2 seconds before respawning the IUT
..


Patch Set 2:

I'm still not understanding why you change the sleep time for virtual and why 
you insist on removing the parameter.


--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/21640
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I09e5a8e7c4d28424cd0d004a8bae3cf0ade2d838
Gerrit-Change-Number: 21640
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: daniel 
Gerrit-Comment-Date: Thu, 10 Dec 2020 16:26:13 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: handover_test: adjust logging for reproducability

2020-12-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21661 )

Change subject: handover_test: adjust logging for reproducability
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/21661/1/tests/handover/handover_test.c
File tests/handover/handover_test.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/21661/1/tests/handover/handover_test.c@1302
PS1, Line 1302: log_set_print_timestamp(osmo_stderr_target, 0);
while at it: I don't see color being disabled (is it by default?). It's worth 
disabling it since color may change in the future (and we already had issues in 
the past with unit tests using colors and color otput changing due to a bug 
being fixed).



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21661
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8ebcaf16cd14881a3a41616dcff175e173db9ae8
Gerrit-Change-Number: 21661
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 10 Dec 2020 16:22:45 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: handover_test: set a fake osmo_mgcpc_ep_ci pointer

2020-12-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21662 )

Change subject: handover_test: set a fake osmo_mgcpc_ep_ci pointer
..


Patch Set 1: Code-Review+1

A bit hacky, maybe better adding an static struct and pass a pointer to it.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21662
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ibc22001bf9e9874dd3f44f0acac8b6a4c1069aa7
Gerrit-Change-Number: 21662
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: pespin 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Thu, 10 Dec 2020 16:21:00 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: handover_test: send ho detection

2020-12-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21660 )

Change subject: handover_test: send ho detection
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21660
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib676e74f23ef9cd1b55262117822b0e110013bdc
Gerrit-Change-Number: 21660
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: pespin 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Thu, 10 Dec 2020 16:15:52 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: handover_test: log sending ho complete

2020-12-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21659 )

Change subject: handover_test: log sending ho complete
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21659
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I540e880f9aafb92be03c35086340de1968b26836
Gerrit-Change-Number: 21659
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: pespin 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Thu, 10 Dec 2020 16:14:11 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in docker-playground[master]: ttcn3-bts-test: fix: sleep 2 seconds before respawning the IUT

2020-12-10 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/21640 )

Change subject: ttcn3-bts-test: fix: sleep 2 seconds before respawning the IUT
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/c/docker-playground/+/21640/2/ttcn3-bts-test/jenkins.sh
File ttcn3-bts-test/jenkins.sh:

https://gerrit.osmocom.org/c/docker-playground/+/21640/2/ttcn3-bts-test/jenkins.sh@37
PS2, Line 37:   -e "SLEEP_BEFORE_RESPAWN=1" \
Is this a flag for sleeping or the actual time we should sleep?
If the latter then the commit message is off-by-one.



--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/21640
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I09e5a8e7c4d28424cd0d004a8bae3cf0ade2d838
Gerrit-Change-Number: 21640
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: daniel 
Gerrit-Comment-Date: Thu, 10 Dec 2020 16:13:37 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: handover_test: adjust logging for reproducability

2020-12-10 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21661 )


Change subject: handover_test: adjust logging for reproducability
..

handover_test: adjust logging for reproducability

Do not show source file and line numbers in the log, so that the log
output remains unchanged for unrelated changes.

Also show the log level.

Change-Id: I8ebcaf16cd14881a3a41616dcff175e173db9ae8
---
M tests/handover/handover_test.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/61/21661/1

diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 41211ac..da620a5 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1295,9 +1295,11 @@

osmo_init_logging2(ctx, &log_info);

+   log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE);
log_set_print_category(osmo_stderr_target, 1);
log_set_print_category_hex(osmo_stderr_target, 0);
-   log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME);
+   log_set_print_level(osmo_stderr_target, 1);
+   log_set_print_timestamp(osmo_stderr_target, 0);
osmo_fsm_log_addr(false);

bsc_network_alloc();

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21661
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8ebcaf16cd14881a3a41616dcff175e173db9ae8
Gerrit-Change-Number: 21661
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: handover_test: set a fake osmo_mgcpc_ep_ci pointer

2020-12-10 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21662 )


Change subject: handover_test: set a fake osmo_mgcpc_ep_ci pointer
..

handover_test: set a fake osmo_mgcpc_ep_ci pointer

The handover_fsm activates voice on a target lchan only when the source
lchan has an osmo_mgcpc_ep_ci pointer for the BTS side. Since that
struct is opaque, set a fake pointer and override the
osmo_mgcpc_ep_ci_name() function so that the pointer is never
dereferenced.

This more accurately models the RTP stream setup events during handover.

Change-Id: Ibc22001bf9e9874dd3f44f0acac8b6a4c1069aa7
---
M tests/handover/handover_test.c
1 file changed, 10 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/62/21662/1

diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index da620a5..8d93a6f 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -381,6 +381,8 @@
lchan->fi->state = LCHAN_ST_ESTABLISHED;
lchan->ts->fi->state = TS_ST_IN_USE;
lchan->type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H;
+   /* Fake osmo_mgcpc_ep_ci to indicate that the lchan is used for voice */
+   lchan->mgw_endpoint_ci_bts = (void*)1;

if (lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_TCH_H_PDCH)
lchan->ts->pchan_is = full_rate ? GSM_PCHAN_TCH_F : 
GSM_PCHAN_TCH_H;
@@ -1393,3 +1395,11 @@
 void osmo_bsc_sigtran_reset(void) {}
 void bssmap_reset_alloc(void) {}
 void bssmap_reset_is_conn_ready(void) {}
+const char *osmo_mgcpc_ep_name(const struct osmo_mgcpc_ep *ep)
+{
+   return "fake-ep";
+}
+const char *osmo_mgcpc_ep_ci_name(const struct osmo_mgcpc_ep_ci *ci)
+{
+   return "fake-ci";
+}

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21662
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ibc22001bf9e9874dd3f44f0acac8b6a4c1069aa7
Gerrit-Change-Number: 21662
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: handover_test: log sending ho complete

2020-12-10 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21659 )


Change subject: handover_test: log sending ho complete
..

handover_test: log sending ho complete

Change-Id: I540e880f9aafb92be03c35086340de1968b26836
---
M tests/handover/handover_test.c
1 file changed, 5 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/59/21659/1

diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 08bc26d..4ee02c2 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -618,6 +618,11 @@
send_est_ind(lchan);
osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RTP_READY, 0);

+   if (success)
+   fprintf(stderr, "- Send HO COMPLETE for %s\n", 
gsm_lchan_name(lchan));
+   else
+   fprintf(stderr, "- Send HO FAIL to %s\n", 
gsm_lchan_name(lchan));
+
rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh));
rh->c.msg_discr = ABIS_RSL_MDISC_RLL;
rh->c.msg_type = RSL_MT_DATA_IND;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21659
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I540e880f9aafb92be03c35086340de1968b26836
Gerrit-Change-Number: 21659
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: handover_test: send ho detection

2020-12-10 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21660 )


Change subject: handover_test: send ho detection
..

handover_test: send ho detection

So far we skipped the HO Detection message, because the FSM also accepts
a handover when the Handover Complete arrives without a Detection.
Rather model the real behavior.

Also send the EST IND message and RTP-ready events from the ho
detection.

Change-Id: Ib676e74f23ef9cd1b55262117822b0e110013bdc
---
M tests/handover/handover_test.c
1 file changed, 44 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/60/21660/1

diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 4ee02c2..41211ac 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -605,7 +605,32 @@
abis_rsl_rcvmsg(msg);
 }

-/* send handover complete */
+static void send_ho_detect(struct gsm_lchan *lchan)
+{
+   struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL");
+   struct abis_rsl_rll_hdr *rh;
+   uint8_t chan_nr = gsm_lchan2chan_nr(lchan);
+
+   fprintf(stderr, "- Send HO DETECT for %s\n", gsm_lchan_name(lchan));
+
+   rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh));
+   rh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN;
+   rh->c.msg_type = RSL_MT_HANDO_DET;
+   rh->ie_chan = RSL_IE_CHAN_NR;
+   rh->chan_nr = chan_nr;
+   rh->ie_link_id = RSL_IE_LINK_IDENT;
+   rh->link_id = 0x00;
+
+   msg->dst = lchan->ts->trx->bts->c0->rsl_link;
+   msg->l2h = (unsigned char *)rh;
+
+   abis_rsl_rcvmsg(msg);
+
+   send_est_ind(lchan);
+   osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RTP_READY, 0);
+
+}
+
 static void send_ho_complete(struct gsm_lchan *lchan, bool success)
 {
struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL");
@@ -615,9 +640,6 @@
struct gsm48_hdr *gh;
struct gsm48_ho_cpl *hc;

-   send_est_ind(lchan);
-   osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RTP_READY, 0);
-
if (success)
fprintf(stderr, "- Send HO COMPLETE for %s\n", 
gsm_lchan_name(lchan));
else
@@ -975,6 +997,22 @@
return CMD_SUCCESS;
 }

+DEFUN(ho_detection, ho_detection_cmd,
+  "ho-detect",
+  "Send Handover Detection to the most recent HO target lchan\n")
+{
+   if (!got_chan_req) {
+   fprintf(stderr, "Cannot ack handover/assignment, because no 
chan request\n");
+   exit(1);
+   }
+   if (!got_ho_req) {
+   fprintf(stderr, "Cannot ack handover/assignment, because no ho 
request\n");
+   exit(1);
+   }
+   send_ho_detect(chan_req_lchan);
+   return CMD_SUCCESS;
+}
+
 DEFUN(ho_complete, ho_complete_cmd,
   "ho-complete",
   "Send Handover Complete for the most recent HO target lchan\n")
@@ -1005,6 +1043,7 @@
_expect_chan_activ(to);
_ack_chan_activ(to);
_expect_ho_req(from);
+   send_ho_detect(to);
send_ho_complete(to, true);
lchan_release_ack(from);
return CMD_SUCCESS;
@@ -1135,6 +1174,7 @@
install_element(CONFIG_NODE, &expect_chan_cmd);
install_element(CONFIG_NODE, &ack_chan_cmd);
install_element(CONFIG_NODE, &expect_ho_req_cmd);
+   install_element(CONFIG_NODE, &ho_detection_cmd);
install_element(CONFIG_NODE, &ho_complete_cmd);
install_element(CONFIG_NODE, &expect_ho_cmd);
install_element(CONFIG_NODE, &ho_failed_cmd);

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21660
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib676e74f23ef9cd1b55262117822b0e110013bdc
Gerrit-Change-Number: 21660
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in openbsc[master]: Bump version: 1.3.3.4-e5e69 → 1.4.0

2020-12-10 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/openbsc/+/21658 )


Change subject: Bump version: 1.3.3.4-e5e69 → 1.4.0
..

Bump version: 1.3.3.4-e5e69 → 1.4.0

Change-Id: I80698b962666b94310a84306149d67ae09153c8e
---
M debian/changelog
1 file changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/58/21658/1

diff --git a/debian/changelog b/debian/changelog
index 170c84d..6d6405b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+openbsc (1.4.0) unstable; urgency=medium
+
+  [ Harald Welte ]
+  * Migrate from BSC_FD_* to OSMO_FD_*
+  * Add very clear obsolescence / unmaintained warnings
+
+  [ Pau Espin Pedrol ]
+  * bsc-nat: generate coredump and exit upon SIGABRT received
+  * osmo-nitb: generate coredump and exit upon SIGABRT received
+
+ -- Pau Espin Pedrol   Thu, 10 Dec 2020 17:07:14 +0100
+
 openbsc (1.3.3) unstable; urgency=medium

   [ Keith ]

--
To view, visit https://gerrit.osmocom.org/c/openbsc/+/21658
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Change-Id: I80698b962666b94310a84306149d67ae09153c8e
Gerrit-Change-Number: 21658
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-bts[master]: sched_lchan_tchh: fix frame number and fill FACCH gap

2020-12-10 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21329 )

Change subject: sched_lchan_tchh: fix frame number and fill FACCH gap
..


Patch Set 2:

> It's 9 days later now without any progress.

Sorry, I was/am busy with other tasks.
Is it a high-priority one? I see 'Normal' in Redmine.

> Can you two please coordinate to exchange your ideas on that?

Don't get me wrong (it might be a cultural barrier), but I would expect the 
author of this change to schedule a call or contact me somehow, not vice versa. 
I am generally interested to get the measurement logic fixed, and I offered my 
help, but I have other tasks to work on, and it's impossible to keep everything 
in mind. Since I didn't get any response back so far, I assume that either the 
author has more important tasks to work on, or no further 
clarification/discussion is needed.

Feel free to ping me in the IRC/Jabber, so we can discuss possible solutions.
Alternatively, I can take care of this task once I am finished the BS Power 
Control (soon).


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21329
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I1ad9fa3815feb2b4da608ab7df716a87ba1f2f91
Gerrit-Change-Number: 21329
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 10 Dec 2020 15:53:46 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in docker-playground[master]: Introduce osmo-ran docker image set up

2020-12-10 Thread pespin
pespin has uploaded a new patch set (#6). ( 
https://gerrit.osmocom.org/c/docker-playground/+/21263 )

Change subject: Introduce osmo-ran docker image set up
..

Introduce osmo-ran docker image set up

See osmo-ran/README.md in this commit for a description.

Related: SYS#4889
Change-Id: If5d22e9fa818310cbb4adc34bd7aceb4416ec969
---
M jenkins-common.sh
M make/Makefile
A osmo-ran/Dockerfile
A osmo-ran/Makefile
A osmo-ran/README.md
A osmo-ran/Release.key
A osmo-ran/jenkins.sh
A osmo-ran/osmocom/osmo-bsc.cfg
A osmo-ran/osmocom/osmo-bts-trx.cfg
A osmo-ran/osmocom/osmo-mgw.cfg
A osmo-ran/osmocom/osmo-pcu.cfg
A osmo-ran/osmocom/osmo-trx-ipc.cfg
A osmo-ran/osmocom/osmo-trx-uhd.cfg
A osmo-ran/split/jenkins-split.sh
A osmo-ran/split/ran-bsc_mgw/Dockerfile
A osmo-ran/split/ran-bsc_mgw/Makefile
A osmo-ran/split/ran-bsc_mgw/Release.key
A osmo-ran/split/ran-bsc_mgw/osmocom/osmo-bsc.cfg
A osmo-ran/split/ran-bsc_mgw/osmocom/osmo-mgw.cfg
A osmo-ran/split/ran-bts_pcu/Dockerfile
A osmo-ran/split/ran-bts_pcu/Makefile
A osmo-ran/split/ran-bts_pcu/Release.key
A osmo-ran/split/ran-bts_pcu/osmocom/osmo-bts-trx.cfg
A osmo-ran/split/ran-bts_pcu/osmocom/osmo-pcu.cfg
A osmo-ran/split/ran-trx-ipc/Dockerfile
A osmo-ran/split/ran-trx-ipc/Makefile
A osmo-ran/split/ran-trx-ipc/Release.key
A osmo-ran/split/ran-trx-ipc/osmocom/osmo-trx-ipc.cfg
A osmo-ran/split/ran-trx-uhd/Dockerfile
A osmo-ran/split/ran-trx-uhd/Makefile
A osmo-ran/split/ran-trx-uhd/Release.key
A osmo-ran/split/ran-trx-uhd/osmocom/osmo-trx-uhd.cfg
A systemd/Dockerfile
A systemd/Makefile
34 files changed, 1,278 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/docker-playground 
refs/changes/63/21263/6
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/21263
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: If5d22e9fa818310cbb4adc34bd7aceb4416ec969
Gerrit-Change-Number: 21263
Gerrit-PatchSet: 6
Gerrit-Owner: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: gsm_lchan_name: assert on NULL lchan

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21637 )

Change subject: gsm_lchan_name: assert on NULL lchan
..

gsm_lchan_name: assert on NULL lchan

Steve Langasek  submitted some patches
against downstream osmo-bsc 1.3.0 because some possible null derefences
were detected by the compiler on Ubuntu s390x. Code has eveolved since
then and patch doesn't apply directly anymore, since related code
changed (we now use osmo_count in bsc_subscr_get).
The compiled allegedly claimed some null dereference in gsm_lchan_name.
In general code using that function seems to be doing checks for
existing lchan before calling it, or assuming the lchan pointer is not
null, so I couldn't find any major issue.
However, let's add a OSMO_ASSERT to make sure we can easily identify the
issue if an issue ever happens there, since the gsm_lchan_name should
clearly only be called on non null pointers.

Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387
---
M include/osmocom/bsc/gsm_data.h
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 6904266..584c0e6 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -937,6 +937,7 @@

 static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)
 {
+   OSMO_ASSERT(lchan);
return lchan->name;
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21637
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387
Gerrit-Change-Number: 21637
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-bsc[master]: gsm_lchan_name: assert on NULL lchan

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21637 )

Change subject: gsm_lchan_name: assert on NULL lchan
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21637
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387
Gerrit-Change-Number: 21637
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 10 Dec 2020 15:28:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: vty: fix dump_lchan_trx_ts(): dump dedicated channels only

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21450 )

Change subject: vty: fix dump_lchan_trx_ts(): dump dedicated channels only
..

vty: fix dump_lchan_trx_ts(): dump dedicated channels only

It does not make sense to dump CCCH/CBCH as dedicated channels:

  OsmoBTS# show lchan
  BTS 0, TRX 0, Timeslot 0, Lchan 4: Type CCCH
State: ACTIVE
BS (Downlink) Power Control (autonomous):
  Channel reduction: 0 dB (max 0 dB)
  TRX reduction: 0 dB
  Actual / Nominal power: 13 dBm / 13 dBm
MS (Uplink) Power Control (autonomous):
  Current power level: 0, -39 dBm (max 0, -39 dBm)
Channel Mode / Codec: SIGNALLING
LAPDm SAPIs: DCCH --, SACCH --
Valid System Information: 0x0060
MS Timing Offset: 0, propagation delay: 0 symbols
Radio Link Failure Counter 'S': 0

so let's only dump SDCCH, TCH/F, and TCH/H.

Change-Id: Id7880de56a93cc9fa4ca576b094cef35ee269822
---
M src/common/vty.c
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/vty.c b/src/common/vty.c
index ada871a..7284bfa 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1449,7 +1449,15 @@
const struct gsm_lchan *lchan = &ts->lchan[lchan_nr];
if (lchan->state == LCHAN_S_NONE)
continue;
-   dump_cb(vty, lchan);
+   switch (lchan->type) {
+   case GSM_LCHAN_SDCCH:
+   case GSM_LCHAN_TCH_F:
+   case GSM_LCHAN_TCH_H:
+   dump_cb(vty, lchan);
+   break;
+   default:
+   continue;
+   }
}

return CMD_SUCCESS;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21450
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id7880de56a93cc9fa4ca576b094cef35ee269822
Gerrit-Change-Number: 21450
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-bts[master]: vty: fix dump_lchan_trx_ts(): dump dedicated channels only

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21450 )

Change subject: vty: fix dump_lchan_trx_ts(): dump dedicated channels only
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21450
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id7880de56a93cc9fa4ca576b094cef35ee269822
Gerrit-Change-Number: 21450
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 10 Dec 2020 15:27:27 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: hodec 2: prefer moving TCH/H from half-used dyn TS

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21236 )

Change subject: hodec 2: prefer moving TCH/H from half-used dyn TS
..

hodec 2: prefer moving TCH/H from half-used dyn TS

Change-Id: I427dc9faa3790c24119127ae227d8cc802dd50e6
---
M src/osmo-bsc/handover_decision_2.c
M tests/handover/handover_test.c
2 files changed, 23 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/osmo-bsc/handover_decision_2.c 
b/src/osmo-bsc/handover_decision_2.c
index 4e54368..9fab1fc 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -1368,6 +1368,17 @@
|| lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_PDCH;
 }

+static unsigned int ts_usage_count(struct gsm_bts_trx_ts *ts)
+{
+   struct gsm_lchan *lchan;
+   unsigned int count = 0;
+   ts_for_each_lchan(lchan, ts) {
+   if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED))
+   count++;
+   }
+   return count;
+}
+
 /* Given two candidates, pick the one that should rather be moved during 
handover.
  * Return the better candidate in out-parameters best_cand and best_avg_db.
  */
@@ -1384,10 +1395,17 @@
goto return_other;

/* The two lchans have identical ratings, prefer picking a dynamic 
timeslot: free PDCH and allow more timeslot
-* type flexibility for further congestion resolution. If both are 
dynamic, it does not matter which one is
-* picked. */
-   if (lchan_is_on_dynamic_ts(other_cand->lchan))
+* type flexibility for further congestion resolution. */
+   if (lchan_is_on_dynamic_ts(other_cand->lchan)) {
+   /* If both are dynamic, prefer one that completely (or to a 
higher degree) frees its timeslot. */
+   if (lchan_is_on_dynamic_ts((*best_cand_p)->lchan)
+   && ts_usage_count((*best_cand_p)->lchan->ts) < 
ts_usage_count(other_cand->lchan->ts))
+   return;
+   /* If both equally satisfy these preferences, it does not 
matter which one is picked.
+* Give slight preference to moving later dyn TS, so that a 
free dyn TS may group with following static
+* PDCH, though this depends on how the user configured the TS 
-- not harmful to do so anyway. */
goto return_other;
+   }

/* keep the same candidate. */
return;
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 62c01f0..28d87db 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1765,10 +1765,9 @@
"congestion-check",
"expect-chan", "0", "1",
"ack-chan",
-   /* Not so good: should move the half-used TCH/H instead of "halving" 
another dyn TS */
-   "expect-ho", "0", "4",
+   "expect-ho", "0", "3",
"ho-complete",
-   "expect-ts-use", "0", "0",  "*", "TCH/F", "TCH/HH", "TCH/H-", "TCH/H-", 
"PDCH", "-", "-",
+   "expect-ts-use", "0", "0",  "*", "TCH/F", "TCH/HH", "PDCH", "TCH/HH", 
"PDCH", "-", "-",
NULL
 };


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21236
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I427dc9faa3790c24119127ae227d8cc802dd50e6
Gerrit-Change-Number: 21236
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-trx[master]: ipc-driver-test: Allow setting dir prefix for UD socket

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/21594 )

Change subject: ipc-driver-test: Allow setting dir prefix for UD socket
..

ipc-driver-test: Allow setting dir prefix for UD socket

Change-Id: I35282b38a1d560fb3440fe0aa9a27808d9d116cc
---
M Transceiver52M/device/ipc/ipc-driver-test.c
M Transceiver52M/device/ipc/shm.h
2 files changed, 24 insertions(+), 11 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/Transceiver52M/device/ipc/ipc-driver-test.c 
b/Transceiver52M/device/ipc/ipc-driver-test.c
index da53463..d8284c7 100644
--- a/Transceiver52M/device/ipc/ipc-driver-test.c
+++ b/Transceiver52M/device/ipc/ipc-driver-test.c
@@ -49,6 +49,7 @@
 #include "ipc_sock.h"

 #define DEFAULT_SHM_NAME "/osmo-trx-ipc-driver-shm2"
+#define IPC_SOCK_PATH_PREFIX "/tmp"

 static void *tall_ctx;
 struct ipc_sock_state *global_ipc_sock_state;
@@ -63,6 +64,11 @@

 static struct ipc_shm_region *decoded_region;

+static struct {
+   int msocknum;
+   char *ud_prefix_dir;
+} cmdline_cfg;
+
 static const struct log_info_cat default_categories[] = {
[DMAIN] = {
.name = "DMAIN",
@@ -185,8 +191,8 @@

chan_info = ipc_prim->u.open_cnf.chan_info;
for (i = 0; i < num_chans; i++) {
-   snprintf(chan_info->chan_ipc_sk_path, 
sizeof(chan_info->chan_ipc_sk_path), "%s_%d",
-IPC_SOCK_PATH_PREFIX, i);
+   snprintf(chan_info->chan_ipc_sk_path, 
sizeof(chan_info->chan_ipc_sk_path),"%s/ipc_sock%d_%d",
+cmdline_cfg.ud_prefix_dir, cmdline_cfg.msocknum, i);
/* FIXME: dynamc chan limit, currently 8 */
if (i < 8)
ipc_sock_init(chan_info->chan_ipc_sk_path, 
&global_ctrl_socks[i], ipc_chan_sock_accept, i);
@@ -413,20 +419,20 @@
 {
printf("ipc-driver-test Usage:\n"
   " -h  --help This message\n"
+  " -u  --unix-sk-dir DIR  Existing directory where to create the 
Master socket\n"
   " -n  --sock-num NR  Master socket suffix number NR\n");
 }

-static int msocknum = 0;
-
 static void handle_options(int argc, char **argv)
 {
while (1) {
int option_index = 0, c;
const struct option long_options[] = { { "help", 0, 0, 'h' },
+  { "unix-sk-dir", 1, 0, 
'u' },
   { "sock-num", 1, 0, 'n' 
},
   { 0, 0, 0, 0 } };

-   c = getopt_long(argc, argv, "hn:", long_options, &option_index);
+   c = getopt_long(argc, argv, "hu:n:", long_options, 
&option_index);
if (c == -1)
break;

@@ -435,9 +441,13 @@
print_help();
exit(0);
break;
-   case 'n':
-   msocknum = atoi(optarg);
+   case 'u':
+   cmdline_cfg.ud_prefix_dir = talloc_strdup(tall_ctx, 
optarg);
break;
+   case 'n':
+   cmdline_cfg.msocknum = atoi(optarg);
+   break;
+
default:
exit(2);
break;
@@ -452,14 +462,19 @@

 int main(int argc, char **argv)
 {
-   char ipc_msock_path[sizeof(IPC_SOCK_PATH_PREFIX) + 3];
+   char ipc_msock_path[128];
tall_ctx = talloc_named_const(NULL, 0, "OsmoTRX");
msgb_talloc_ctx_init(tall_ctx, 0);
osmo_init_logging2(tall_ctx, &log_infox);
log_enable_multithread();

handle_options(argc, argv);
-   snprintf(ipc_msock_path, sizeof(ipc_msock_path), "%s%d", 
IPC_SOCK_PATH_PREFIX, msocknum);
+
+   if (!cmdline_cfg.ud_prefix_dir)
+   cmdline_cfg.ud_prefix_dir = talloc_strdup(tall_ctx, 
IPC_SOCK_PATH_PREFIX);
+
+
+   snprintf(ipc_msock_path, sizeof(ipc_msock_path), "%s/ipc_sock%d", 
cmdline_cfg.ud_prefix_dir, cmdline_cfg.msocknum);

LOGP(DMAIN, LOGL_INFO, "Starting %s\n", argv[0]);
ipc_sock_init(ipc_msock_path, &global_ipc_sock_state, ipc_sock_accept, 
0);
diff --git a/Transceiver52M/device/ipc/shm.h b/Transceiver52M/device/ipc/shm.h
index fcddd54..46c3add 100644
--- a/Transceiver52M/device/ipc/shm.h
+++ b/Transceiver52M/device/ipc/shm.h
@@ -79,8 +79,6 @@
 //
 // Master socket
 //
-
-#define IPC_SOCK_PATH_PREFIX "/tmp/ipc_sock"
 #define IPC_SOCK_API_VERSION 1

 /* msg_type */

--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/21594
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I35282b38a1d560fb3440fe0aa9a27808d9d116cc
Gerrit-Change-Number: 21594
G

Change in osmo-trx[master]: ipc-driver-test: Allow setting dir prefix for UD socket

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/21594 )

Change subject: ipc-driver-test: Allow setting dir prefix for UD socket
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/21594
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I35282b38a1d560fb3440fe0aa9a27808d9d116cc
Gerrit-Change-Number: 21594
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 10 Dec 2020 15:26:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-trx[master]: vty: fix swapped documentation for 'filler type' command

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/21604 )

Change subject: vty: fix swapped documentation for 'filler type' command
..

vty: fix swapped documentation for 'filler type' command

vty_cmd_string_from_valstr() expands the given 'struct value_string'
sequentionally, so the order of entries in both filler_{types,docs}
shall match (regardless of the value assigned).

Change-Id: Ieb3bbc4fb30f303c47555ca77d03a9e965bc72b5
---
M CommonLibs/trx_vty.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c
index e672928..0bb83fe 100644
--- a/CommonLibs/trx_vty.c
+++ b/CommonLibs/trx_vty.c
@@ -68,8 +68,8 @@
 };

 static const struct value_string filler_docs[] = {
-   { FILLER_ZERO,  "Send an empty burst (default)" },
{ FILLER_DUMMY, "Send a Dummy Burst on C0 (TRX0) and empty 
burst on other channels" },
+   { FILLER_ZERO,  "Send an empty burst (default)" },
{ FILLER_NORM_RAND, "Send a GMSK modulated Normal Burst with random 
bits (spectrum mask testing)" },
{ FILLER_EDGE_RAND, "Send an 8-PSK modulated Normal Burst with 
random bits (spectrum mask testing)" },
{ FILLER_ACCESS_RAND,   "Send an Access Burst with random bits (Rx/Tx 
alignment testing)" },

--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/21604
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Ieb3bbc4fb30f303c47555ca77d03a9e965bc72b5
Gerrit-Change-Number: 21604
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-trx[master]: vty: fix swapped documentation for 'filler type' command

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/21604 )

Change subject: vty: fix swapped documentation for 'filler type' command
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/21604
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Ieb3bbc4fb30f303c47555ca77d03a9e965bc72b5
Gerrit-Change-Number: 21604
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 10 Dec 2020 15:26:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: mm_state_gb_fsm: Handle implicit detach from mm_standby

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/17080 )

Change subject: mm_state_gb_fsm: Handle implicit detach from mm_standby
..

mm_state_gb_fsm: Handle implicit detach from mm_standby

Change-Id: I63d04a2dcdc17b4df6616c515641c435d919c787
Related: OS#2737
---
M src/sgsn/gprs_mm_state_gb_fsm.c
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  lynxis lazus: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/sgsn/gprs_mm_state_gb_fsm.c b/src/sgsn/gprs_mm_state_gb_fsm.c
index 811f0c2..d3f2ea3 100644
--- a/src/sgsn/gprs_mm_state_gb_fsm.c
+++ b/src/sgsn/gprs_mm_state_gb_fsm.c
@@ -68,6 +68,9 @@
case E_MM_PDU_RECEPTION:
mm_state_gb_fsm_state_chg(fi, ST_MM_READY);
break;
+   case E_MM_IMPLICIT_DETACH:
+   mm_state_gb_fsm_state_chg(fi, ST_MM_IDLE);
+   break;
}
 }

@@ -86,7 +89,7 @@
.action = st_mm_ready,
},
[ST_MM_STANDBY] = {
-   .in_event_mask = X(E_MM_PDU_RECEPTION),
+   .in_event_mask = X(E_MM_PDU_RECEPTION) | 
X(E_MM_IMPLICIT_DETACH),
.out_state_mask = X(ST_MM_IDLE) | X(ST_MM_READY),
.name = "Standby",
.action = st_mm_standby,

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/17080
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I63d04a2dcdc17b4df6616c515641c435d919c787
Gerrit-Change-Number: 17080
Gerrit-PatchSet: 4
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmocom-bb[master]: firmware/layer1: invalidate hard-coded Measurement results

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/21422 )

Change subject: firmware/layer1: invalidate hard-coded Measurement results
..

firmware/layer1: invalidate hard-coded Measurement results

This is what the L1 sends to the network before the first SACCH
block is received from the higher layers.  The indicated values
are of course invalid because they're hard-coded.

According to 3GPP TS 44.018, table 10.5.2.20.1:

  0  The measurement results are valid
  1  The measurement results are not valid

Change-Id: I136307baef3fa2ddd1d5cec2a7f8c9e6d4602499
Related: I7da767e146aec7cef1de71e4d735d6a02b6c5642
Related: SYS#4918
---
M src/target/firmware/layer1/prim_utils.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/target/firmware/layer1/prim_utils.c 
b/src/target/firmware/layer1/prim_utils.c
index 9c58d15..7beab5f 100644
--- a/src/target/firmware/layer1/prim_utils.c
+++ b/src/target/firmware/layer1/prim_utils.c
@@ -51,13 +51,13 @@
 *   .0..  = DTX-USED: DTX was not used
 *   ..11 0110 = RXLEV-FULL-SERVING-CELL: -57 <= x < -56 dBm (54)
 *   0...  = 3G-BA-USED: 0
-*   .0..  = MEAS-VALID: The measurement results are valid
+*   .1..  = MEAS-VALID: The measurement results are not valid
 *   ..11 0110 = RXLEV-SUB-SERVING-CELL: -57 <= x < -56 dBm (54)
 *   0...  = SI23_BA_USED: 0
 *   .000  = RXQUAL-FULL-SERVING-CELL: BER < 0.2%, Mean value 0.14% 
(0)
 *    000. = RXQUAL-SUB-SERVING-CELL: BER < 0.2%, Mean value 0.14% 
(0)
 *    ...1  11..  = NO-NCELL-M: Neighbour cell information not 
available */
-   0x36, 0x36, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00,
+   0x36, 0x76, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/21422
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I136307baef3fa2ddd1d5cec2a7f8c9e6d4602499
Gerrit-Change-Number: 21422
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmocom-bb[master]: firmware/layer1: clarify the content of Measurement results

2020-12-10 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/21421 )

Change subject: firmware/layer1: clarify the content of Measurement results
..

firmware/layer1: clarify the content of Measurement results

Change-Id: I3203790c529f93d0084c82136645683a26faf986
Related: I26546dcbc853166e351d00260936b1b9d584ae03
---
M src/target/firmware/layer1/prim_utils.c
1 file changed, 15 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/target/firmware/layer1/prim_utils.c 
b/src/target/firmware/layer1/prim_utils.c
index c85da71..9c58d15 100644
--- a/src/target/firmware/layer1/prim_utils.c
+++ b/src/target/firmware/layer1/prim_utils.c
@@ -43,10 +43,22 @@
/* lapdm header */
0x01, 0x03, 0x49,

-   /* Measurement report */
-   0x06, 0x15, 0x36, 0x36, 0x01, 0xC0, 0x00, 0x00,
+   /* RR Management messages, Measurement Report */
+   0x06, 0x15,
+
+   /* Measurement results (see 3GPP TS 44.018, section 10.5.2.20):
+*   0...  = BA-USED: 0
+*   .0..  = DTX-USED: DTX was not used
+*   ..11 0110 = RXLEV-FULL-SERVING-CELL: -57 <= x < -56 dBm (54)
+*   0...  = 3G-BA-USED: 0
+*   .0..  = MEAS-VALID: The measurement results are valid
+*   ..11 0110 = RXLEV-SUB-SERVING-CELL: -57 <= x < -56 dBm (54)
+*   0...  = SI23_BA_USED: 0
+*   .000  = RXQUAL-FULL-SERVING-CELL: BER < 0.2%, Mean value 0.14% 
(0)
+*    000. = RXQUAL-SUB-SERVING-CELL: BER < 0.2%, Mean value 0.14% 
(0)
+*    ...1  11..  = NO-NCELL-M: Neighbour cell information not 
available */
+   0x36, 0x36, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-   0x00, 0x00
 };



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/21421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I3203790c529f93d0084c82136645683a26faf986
Gerrit-Change-Number: 21421
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmocom-bb[master]: firmware/layer1: clarify the content of Measurement results

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/21421 )

Change subject: firmware/layer1: clarify the content of Measurement results
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/21421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I3203790c529f93d0084c82136645683a26faf986
Gerrit-Change-Number: 21421
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 10 Dec 2020 15:25:06 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: firmware/layer1: invalidate hard-coded Measurement results

2020-12-10 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/21422 )

Change subject: firmware/layer1: invalidate hard-coded Measurement results
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/21422
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I136307baef3fa2ddd1d5cec2a7f8c9e6d4602499
Gerrit-Change-Number: 21422
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 10 Dec 2020 15:24:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


  1   2   >