From 391afe3b13dfa01e3a718762cb3cc7901d32d3a9 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 18 May 2017 19:22:12 +0200 Subject: remove bts_ocpthy.py We're not currently paying attention to the octphy in osmo-gsm-tester. So instead of maintaining dead code, remove the bts_octphy.py; we can re-add when the octphy is implemented properly. Change-Id: Ia5d5750d440ae7019634b51fa1efe7bbb2a1d1e2 --- src/osmo_gsm_tester/bts_octphy.py | 98 ---------------------- src/osmo_gsm_tester/resource.py | 9 +- .../templates/osmo-bts-octphy.cfg.tmpl | 45 ---------- 3 files changed, 4 insertions(+), 148 deletions(-) delete mode 100644 src/osmo_gsm_tester/bts_octphy.py delete mode 100644 src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl diff --git a/src/osmo_gsm_tester/bts_octphy.py b/src/osmo_gsm_tester/bts_octphy.py deleted file mode 100644 index f5eb8f7..0000000 --- a/src/osmo_gsm_tester/bts_octphy.py +++ /dev/null @@ -1,98 +0,0 @@ -# osmo_gsm_tester: specifics for running an osmo-bts-octphy -# -# Copyright (C) 2016-2017 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 Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -import os -from . import log, config, util, template, process - -class OsmoBtsOctphy(log.Origin): - suite_run = None - nitb = None - run_dir = None - inst = None - env = None - - BIN_BTS_OCTPHY = 'osmo-bts-octphy' - CONF_BTS_OCTPHY = 'osmo-bts-octphy.cfg' - - def __init__(self, suite_run, conf): - self.suite_run = suite_run - self.conf = conf - self.set_name(OsmoBtsOctphy.BIN_BTS_OCTPHY) - self.set_log_category(log.C_RUN) - self.env = {} - - def start(self): - if self.nitb is None: - raise RuntimeError('BTS needs to be added to a NITB before it can be started') - self.suite_run.poll() - - self.log('Starting to connect to', self.nitb) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) - self.configure() - - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsOctphy.BIN_BTS_OCTPHY))) - lib = self.inst.child('lib') - if not os.path.isdir(lib): - raise RuntimeError('No lib/ in %r' % self.inst) - self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } - - self.launch_process(OsmoBtsOctphy.BIN_BTS_OCTPHY, '-r', '1', - '-c', os.path.abspath(self.config_file), - '-i', self.nitb.addr()) - self.suite_run.poll() - - def launch_process(self, binary_name, *args): - binary = os.path.abspath(self.inst.child('bin', binary_name)) - run_dir = self.run_dir.new_dir(binary_name) - if not os.path.isfile(binary): - raise RuntimeError('Binary missing: %r' % binary) - proc = process.Process(binary_name, run_dir, - (binary,) + args, - env=self.env) - self.suite_run.remember_to_stop(proc) - proc.launch() - - def configure(self): - if self.nitb is None: - raise RuntimeError('BTS needs to be added to a NITB before it can be configured') - self.config_file = self.run_dir.new_file(OsmoBtsOctphy.CONF_BTS_OCTPHY) - self.dbg(config_file=self.config_file) - - values = dict(osmo_bts_octphy=config.get_defaults('osmo_bts_octphy')) - config.overlay(values, self.suite_run.config()) - config.overlay(values, dict(osmo_bts_octphy=dict(oml_remote_ip=self.nitb.addr()))) - config.overlay(values, dict(osmo_bts_octphy=self.conf)) - self.dbg(conf=values) - - with open(self.config_file, 'w') as f: - r = template.render(OsmoBtsOctphy.CONF_BTS_OCTPHY, values) - self.dbg(r) - f.write(r) - - def conf_for_nitb(self): - values = config.get_defaults('nitb_bts') - config.overlay(values, config.get_defaults('osmo_bts_octphy')) - config.overlay(values, self.conf) - self.dbg(conf=values) - return values - - def set_nitb(self, nitb): - self.nitb = nitb - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 2a64772..e660066 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -29,7 +29,7 @@ from . import util from . import schema from . import ofono_client from . import osmo_nitb -from . import bts_sysmo, bts_osmotrx, bts_octphy +from . import bts_sysmo, bts_osmotrx from .util import is_dict, is_list @@ -71,7 +71,6 @@ WANT_SCHEMA = util.dict_add( KNOWN_BTS_TYPES = { 'osmo-bts-sysmo': bts_sysmo.SysmoBts, 'osmo-bts-trx': bts_osmotrx.OsmoBtsTrx, - 'osmo-bts-octphy': bts_octphy.OsmoBtsOctphy, } def register_bts_type(name, clazz): @@ -112,11 +111,11 @@ class ResourcesPool(log.Origin): ResourcesPool may also be selected with narrowed down constraints. This would reserve one NITB IP address, two modems, one BTS of type - sysmo and one of type oct, plus 2 ARFCNs in the 1800 band: + sysmo and one of type trx, plus 2 ARFCNs in the 1800 band: { 'nitb_iface': [ { 'times': 1 } ], - 'bts': [ { 'type': 'sysmo', 'times': 1 }, { 'type': 'oct', 'times': 1 } ], + 'bts': [ { 'type': 'sysmo', 'times': 1 }, { 'type': 'trx', 'times': 1 } ], 'arfcn': [ { 'band': 'GSM-1800', 'times': 2 } ], 'modem': [ { 'times': 2 } ], } @@ -125,7 +124,7 @@ class ResourcesPool(log.Origin): { 'nitb_iface': [ {} ], - 'bts': [ { 'type': 'sysmo' }, { 'type': 'oct' } ], + 'bts': [ { 'type': 'sysmo' }, { 'type': 'trx' } ], 'arfcn': [ { 'band': 'GSM-1800', 'times': 2 } ], 'modem': [ { 'times': 2 } ], } diff --git a/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl deleted file mode 100644 index b3f95df..0000000 --- a/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl +++ /dev/null @@ -1,45 +0,0 @@ -! -! OsmoBTS () configuration saved from vty -!! -! -log stderr - logging color 1 - logging print extended-timestamp 1 - logging print category 1 - logging level abis debug - logging level oml debug - logging level pag debug - logging level rll debug - logging level rr debug - logging level rsl debug -! -line vty - no login -! -%for trx in osmo_bts_octphy.trx_list: -phy ${loop.index} - octphy hw-addr ${trx.hw_addr} - octphy net-device ${trx.net_device} - instance 0 -%endfor -bts 0 - band ${osmo_bts_octphy.band} - ipa unit-id ${osmo_bts_octphy.ipa_unit_id} 0 - oml remote-ip ${osmo_bts_octphy.oml_remote_ip} - gsmtap-sapi bcch - gsmtap-sapi ccch - gsmtap-sapi rach - gsmtap-sapi agch - gsmtap-sapi pch - gsmtap-sapi sdcch - gsmtap-sapi tch/f - gsmtap-sapi tch/h - gsmtap-sapi pacch - gsmtap-sapi pdtch - gsmtap-sapi ptcch - gsmtap-sapi cbch - gsmtap-sapi sacch -%for trx in osmo_bts_octphy.trx_list: - trx ${loop.index} - phy ${loop.index} instance 0 -%endfor -- cgit v1.2.3