[MERGED] osmo-gsm-tester[master]: Add support for osmo-bts-octphy

2017-11-06 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: Add support for osmo-bts-octphy
..


Add support for osmo-bts-octphy

Specific parts for this class:
- Runs osmo-bts-octphy binary, that requires CAP_NET_RAW capability
because it uses an AF_PACKET socket.
- As a consequence, it must use the previously added APIs to set the
capability and modify the RPATH of the binary before launching it. These
APIs require extra host setup and installed dependencies that will be
documented soon in osmo-gsm-tester manual.
- A num_trx() helper method is added because the binary requires that
parameter.
- A allocate_phy_instances() is added to help build/fill the conf
dictionary to be used in the tmpl to be able to easily set up trx, phy
and insances.

A config to use a osmo-bts-octphy at full power is used (4 trx) is added
in this commit to show how can it be configured. However our
current license only has support to use 1 TRX, and so next commit drops
most configurations to simplify the setup to use only 1 TRX.

Change-Id: Ia350964fa539083bb68d439cad0caa8fdf85d297
---
M example/defaults.conf
M example/resources.conf
A src/osmo_gsm_tester/bts_octphy.py
M src/osmo_gsm_tester/resource.py
A src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl
5 files changed, 273 insertions(+), 1 deletion(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/example/defaults.conf b/example/defaults.conf
index e2921a4..7711297 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -45,3 +45,43 @@
 - phys_chan_config: TCH/F
 - phys_chan_config: TCH/F
 - phys_chan_config: TCH/F
+
+osmo_bts_octphy:
+  trx_list:
+   - {}
+   - nominal_power: 23
+ max_power_red: 0
+ arfcn: 869
+ timeslot_list:
+ - phys_chan_config: CCCH+SDCCH4
+ - phys_chan_config: SDCCH8
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+   - nominal_power: 23
+ max_power_red: 0
+ arfcn: 870
+ timeslot_list:
+ - phys_chan_config: CCCH+SDCCH4
+ - phys_chan_config: SDCCH8
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+   - nominal_power: 23
+ max_power_red: 0
+ arfcn: 871
+ timeslot_list:
+ - phys_chan_config: CCCH+SDCCH4
+ - phys_chan_config: SDCCH8
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
diff --git a/example/resources.conf b/example/resources.conf
index bdf2347..b16ef1d 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -31,6 +31,21 @@
   trx_remote_ip: 10.42.42.112
   ciphers: [a5_0, a5_1]
 
+- label: OCTBTS 3500
+  type: osmo-bts-octphy
+  ipa_unit_id: 8
+  addr: 10.42.42.52
+  band: GSM-1800
+  trx_list:
+  - hw_addr: 00:0c:90:2e:80:1e
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:80:1e
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:87:52
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:87:52
+net_device: eth1
+
 arfcn:
   - arfcn: 512
 band: GSM-1800
diff --git a/src/osmo_gsm_tester/bts_octphy.py 
b/src/osmo_gsm_tester/bts_octphy.py
new file mode 100644
index 000..ae2e249
--- /dev/null
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -0,0 +1,168 @@
+# osmo_gsm_tester: specifics for running an osmo-bts-octphy
+#
+# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH
+#
+# Author: Pau Espin Pedrol 
+#
+# 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 os
+import pprint
+import tempfile
+from . import log, config, util, template, process, event_loop
+
+class OsmoBtsOctphy(log.Origin):
+suite_run = None
+bsc = None
+run_dir = None
+inst = None
+env = None
+pcu_sk_tmp_dir = None
+values = None
+
+BIN_BTS_OCTPHY = 'osmo-bts-octphy'
+
+CONF_BTS_OCTPHY = 'osmo-bts-octphy.cfg'
+
+def __init__(self, suite_run, conf):
+super().__init__(log.C_RUN, OsmoBtsOctphy.BIN_BTS_OCTPHY)
+self.suite_run = suite_run
+self.conf = conf
+

osmo-gsm-tester[master]: Add support for osmo-bts-octphy

2017-11-06 Thread Pau Espin Pedrol

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/4425
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia350964fa539083bb68d439cad0caa8fdf85d297
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: Add support for osmo-bts-octphy

2017-11-06 Thread Pau Espin Pedrol
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/4425

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

Add support for osmo-bts-octphy

Specific parts for this class:
- Runs osmo-bts-octphy binary, that requires CAP_NET_RAW capability
because it uses an AF_PACKET socket.
- As a consequence, it must use the previously added APIs to set the
capability and modify the RPATH of the binary before launching it. These
APIs require extra host setup and installed dependencies that will be
documented soon in osmo-gsm-tester manual.
- A num_trx() helper method is added because the binary requires that
parameter.
- A allocate_phy_instances() is added to help build/fill the conf
dictionary to be used in the tmpl to be able to easily set up trx, phy
and insances.

A config to use a osmo-bts-octphy at full power is used (4 trx) is added
in this commit to show how can it be configured. However our
current license only has support to use 1 TRX, and so next commit drops
most configurations to simplify the setup to use only 1 TRX.

Change-Id: Ia350964fa539083bb68d439cad0caa8fdf85d297
---
M example/defaults.conf
M example/resources.conf
A src/osmo_gsm_tester/bts_octphy.py
M src/osmo_gsm_tester/resource.py
A src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl
5 files changed, 273 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/25/4425/3

diff --git a/example/defaults.conf b/example/defaults.conf
index e2921a4..7711297 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -45,3 +45,43 @@
 - phys_chan_config: TCH/F
 - phys_chan_config: TCH/F
 - phys_chan_config: TCH/F
+
+osmo_bts_octphy:
+  trx_list:
+   - {}
+   - nominal_power: 23
+ max_power_red: 0
+ arfcn: 869
+ timeslot_list:
+ - phys_chan_config: CCCH+SDCCH4
+ - phys_chan_config: SDCCH8
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+   - nominal_power: 23
+ max_power_red: 0
+ arfcn: 870
+ timeslot_list:
+ - phys_chan_config: CCCH+SDCCH4
+ - phys_chan_config: SDCCH8
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+   - nominal_power: 23
+ max_power_red: 0
+ arfcn: 871
+ timeslot_list:
+ - phys_chan_config: CCCH+SDCCH4
+ - phys_chan_config: SDCCH8
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
diff --git a/example/resources.conf b/example/resources.conf
index 70c1c35..0237d7c 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -31,6 +31,21 @@
   trx_remote_ip: 10.42.42.112
   ciphers: [a5_0, a5_1]
 
+- label: OCTBTS 3500
+  type: osmo-bts-octphy
+  ipa_unit_id: 8
+  addr: 10.42.42.52
+  band: GSM-1800
+  trx_list:
+  - hw_addr: 00:0c:90:2e:80:1e
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:80:1e
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:87:52
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:87:52
+net_device: eth1
+
 arfcn:
   - arfcn: 512
 band: GSM-1800
diff --git a/src/osmo_gsm_tester/bts_octphy.py 
b/src/osmo_gsm_tester/bts_octphy.py
new file mode 100644
index 000..ae2e249
--- /dev/null
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -0,0 +1,168 @@
+# osmo_gsm_tester: specifics for running an osmo-bts-octphy
+#
+# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH
+#
+# Author: Pau Espin Pedrol 
+#
+# 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 os
+import pprint
+import tempfile
+from . import log, config, util, template, process, event_loop
+
+class OsmoBtsOctphy(log.Origin):
+suite_run = None
+bsc = None
+run_dir = None
+inst = None
+env = None
+pcu_sk_tmp_dir = None
+values = None
+
+BIN_BTS_OCTPHY = 'osmo-bts-octphy'
+
+CONF_BTS_OCTPHY = 'osmo-bts-octphy.cfg'
+
+def __init__(self, suite_run, conf):
+super().__init__(log.C_RUN, OsmoBtsOctphy.BIN_BTS_OCTPHY)
+self.suite_run = suite_run
+self.conf = conf
+self.env = {}
+

[PATCH] osmo-gsm-tester[master]: Add support for osmo-bts-octphy

2017-11-03 Thread Pau Espin Pedrol
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/4425

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

Add support for osmo-bts-octphy

Specific parts for this class:
- Runs osmo-bts-octphy binary, that requires CAP_NET_RAW capability
because it uses an AF_PACKET socket.
- As a consequence, it must use the previously added APIs to set the
capability and modify the RPATH of the binary before launching it. These
APIs require extra host setup and installed dependencies that will be
documented soon in osmo-gsm-tester manual.
- A num_trx() helper method is added because the binary requires that
parameter.
- A allocate_phy_instances() is added to help build/fill the conf
dictionary to be used in the tmpl to be able to easily set up trx, phy
and insances.

A config to use a osmo-bts-octphy at full power is used (4 trx) is added
in this commit to show how can it be configured. However our
current license only has support to use 1 TRX, and so next commit drops
most configurations to simplify the setup to use only 1 TRX.

Change-Id: Ia350964fa539083bb68d439cad0caa8fdf85d297
---
M example/defaults.conf
M example/resources.conf
A src/osmo_gsm_tester/bts_octphy.py
M src/osmo_gsm_tester/resource.py
A src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl
5 files changed, 273 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/25/4425/2

diff --git a/example/defaults.conf b/example/defaults.conf
index e2921a4..7711297 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -45,3 +45,43 @@
 - phys_chan_config: TCH/F
 - phys_chan_config: TCH/F
 - phys_chan_config: TCH/F
+
+osmo_bts_octphy:
+  trx_list:
+   - {}
+   - nominal_power: 23
+ max_power_red: 0
+ arfcn: 869
+ timeslot_list:
+ - phys_chan_config: CCCH+SDCCH4
+ - phys_chan_config: SDCCH8
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+   - nominal_power: 23
+ max_power_red: 0
+ arfcn: 870
+ timeslot_list:
+ - phys_chan_config: CCCH+SDCCH4
+ - phys_chan_config: SDCCH8
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+   - nominal_power: 23
+ max_power_red: 0
+ arfcn: 871
+ timeslot_list:
+ - phys_chan_config: CCCH+SDCCH4
+ - phys_chan_config: SDCCH8
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
+ - phys_chan_config: TCH/F
diff --git a/example/resources.conf b/example/resources.conf
index 70c1c35..0237d7c 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -31,6 +31,21 @@
   trx_remote_ip: 10.42.42.112
   ciphers: [a5_0, a5_1]
 
+- label: OCTBTS 3500
+  type: osmo-bts-octphy
+  ipa_unit_id: 8
+  addr: 10.42.42.52
+  band: GSM-1800
+  trx_list:
+  - hw_addr: 00:0c:90:2e:80:1e
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:80:1e
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:87:52
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:87:52
+net_device: eth1
+
 arfcn:
   - arfcn: 512
 band: GSM-1800
diff --git a/src/osmo_gsm_tester/bts_octphy.py 
b/src/osmo_gsm_tester/bts_octphy.py
new file mode 100644
index 000..5014f40
--- /dev/null
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -0,0 +1,168 @@
+# osmo_gsm_tester: specifics for running an osmo-bts-octphy
+#
+# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH
+#
+# Author: Pau Espin Pedrol 
+#
+# 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 os
+import pprint
+import tempfile
+from . import log, config, util, template, process, event_loop
+
+class OsmoBtsOctphy(log.Origin):
+suite_run = None
+bsc = None
+run_dir = None
+inst = None
+env = None
+pcu_sk_tmp_dir = None
+values = None
+
+BIN_BTS_OCTPHY = 'osmo-bts-octphy'
+
+CONF_BTS_OCTPHY = 'osmo-bts-octphy.cfg'
+
+def __init__(self, suite_run, conf):
+super().__init__(log.C_RUN, OsmoBtsOctphy.BIN_BTS_OCTPHY)
+self.suite_run = suite_run
+self.conf = conf
+self.env = {}
+

osmo-gsm-tester[master]: Add support for osmo-bts-octphy

2017-10-26 Thread Harald Welte

Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/4425/1/example/resources.conf
File example/resources.conf:

PS1, Line 34: Octphy
OCTPHY is the osmo-bts- backend name and the name of the PHY library.  "OCTBTS 
3500" is the product name, and we also have some "OCTBTS 3000".


-- 
To view, visit https://gerrit.osmocom.org/4425
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia350964fa539083bb68d439cad0caa8fdf85d297
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: Yes