summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-08-09 13:45:55 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-08-13 07:51:58 +0000
commit58603671c21b0af30d0d52fec862c5843c6e50d0 (patch)
treecb7f8b4fb0fca3e7895d8ffcab8c8a3cf91d1537 /src/osmo_gsm_tester
parent6caa5c11674d8b0041939b3488c8d9a517edc805 (diff)
Cleanup of class scoped variables
After bug described in OS#3456 and fixed in last commit, let's categorize and place variables in its correct plac to avoid similar issus. We leave under the class keyword (class scoped variables) the attributes which are to be used as static class attributes. All other ones are initialized during __init__(). This way w avoid scenarios in which while using an object from an instance attribute we end up reading a class scoped variable which is shared among all instances. Change-Id: I5ad4cac34a9f49eaf42966c01c9c5a4d3f3e9dc8
Diffstat (limited to 'src/osmo_gsm_tester')
-rw-r--r--src/osmo_gsm_tester/bts.py21
-rw-r--r--src/osmo_gsm_tester/bts_octphy.py6
-rw-r--r--src/osmo_gsm_tester/bts_osmo.py6
-rw-r--r--src/osmo_gsm_tester/bts_osmotrx.py7
-rw-r--r--src/osmo_gsm_tester/bts_sysmo.py8
-rw-r--r--src/osmo_gsm_tester/esme.py4
-rw-r--r--src/osmo_gsm_tester/event_loop.py15
-rw-r--r--src/osmo_gsm_tester/modem.py7
-rw-r--r--src/osmo_gsm_tester/osmo_bsc.py15
-rw-r--r--src/osmo_gsm_tester/osmo_ggsn.py8
-rw-r--r--src/osmo_gsm_tester/osmo_hlr.py7
-rw-r--r--src/osmo_gsm_tester/osmo_mgcpgw.py8
-rw-r--r--src/osmo_gsm_tester/osmo_mgw.py8
-rw-r--r--src/osmo_gsm_tester/osmo_msc.py17
-rw-r--r--src/osmo_gsm_tester/osmo_nitb.py12
-rw-r--r--src/osmo_gsm_tester/osmo_sgsn.py10
-rw-r--r--src/osmo_gsm_tester/osmo_stp.py8
-rw-r--r--src/osmo_gsm_tester/osmocon.py6
-rw-r--r--src/osmo_gsm_tester/pcu.py3
-rw-r--r--src/osmo_gsm_tester/pcu_osmo.py4
-rw-r--r--src/osmo_gsm_tester/pcu_sysmo.py14
-rw-r--r--src/osmo_gsm_tester/process.py8
-rw-r--r--src/osmo_gsm_tester/sms.py1
-rw-r--r--src/osmo_gsm_tester/smsc.py1
-rw-r--r--src/osmo_gsm_tester/suite.py22
-rw-r--r--src/osmo_gsm_tester/test.py3
-rw-r--r--src/osmo_gsm_tester/trial.py8
27 files changed, 92 insertions, 145 deletions
diff --git a/src/osmo_gsm_tester/bts.py b/src/osmo_gsm_tester/bts.py
index 0f3ef1c..041b2bc 100644
--- a/src/osmo_gsm_tester/bts.py
+++ b/src/osmo_gsm_tester/bts.py
@@ -25,24 +25,21 @@ from abc import ABCMeta, abstractmethod
from . import log, config, util, template, process, schema, pcu_osmo
class Bts(log.Origin, metaclass=ABCMeta):
- suite_run = None
- conf = None
- bsc = None
- sgsn = None
- lac = None
- rac = None
- cellid = None
- bvci = None
- defaults_cfg_name = None
- _num_trx = 1
- _max_trx = None
- overlay_trx_list = []
##############
# PROTECTED
##############
def __init__(self, suite_run, conf, name, defaults_cfg_name):
super().__init__(log.C_RUN, name)
+ self.bsc = None
+ self.sgsn = None
+ self.lac = None
+ self.rac = None
+ self.cellid = None
+ self.bvci = None
+ self._num_trx = 1
+ self._max_trx = None
+ self.overlay_trx_list = []
self.suite_run = suite_run
self.conf = conf
self.defaults_cfg_name = defaults_cfg_name
diff --git a/src/osmo_gsm_tester/bts_octphy.py b/src/osmo_gsm_tester/bts_octphy.py
index 318c30d..f1a0ce8 100644
--- a/src/osmo_gsm_tester/bts_octphy.py
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -27,16 +27,14 @@ class OsmoBtsOctphy(bts_osmo.OsmoBtsMainUnit):
##############
# PROTECTED
##############
- 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):
super().__init__(suite_run, conf, OsmoBtsOctphy.BIN_BTS_OCTPHY, 'osmo_bts_octphy')
+ self.run_dir = None
+ self.inst = None
self.env = {}
self.values = {}
diff --git a/src/osmo_gsm_tester/bts_osmo.py b/src/osmo_gsm_tester/bts_osmo.py
index b9b7fef..32784bd 100644
--- a/src/osmo_gsm_tester/bts_osmo.py
+++ b/src/osmo_gsm_tester/bts_osmo.py
@@ -24,14 +24,14 @@ from abc import ABCMeta, abstractmethod
from . import log, config, util, template, process, bts, pcu_osmo
class OsmoBts(bts.Bts, metaclass=ABCMeta):
- proc_bts = None
- _pcu = None
##############
# PROTECTED
##############
def __init__(self, suite_run, conf, name, defaults_cfg_name):
super().__init__(suite_run, conf, name, defaults_cfg_name)
+ self._pcu = None
+ self.proc_bts = None
if len(self.pcu_socket_path().encode()) > 107:
raise log.Error('Path for pcu socket is longer than max allowed len for unix socket path (107):', self.pcu_socket_path())
@@ -75,9 +75,9 @@ class OsmoBtsMainUnit(OsmoBts, metaclass=ABCMeta):
##############
# PROTECTED
##############
- pcu_sk_tmp_dir = None
def __init__(self, suite_run, conf, name, defaults_cfg_name):
+ self.pcu_sk_tmp_dir = None
super().__init__(suite_run, conf, name, defaults_cfg_name)
########################
diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py
index b9310f8..1584eb2 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -27,10 +27,6 @@ class OsmoBtsTrx(bts_osmo.OsmoBtsMainUnit):
##############
# PROTECTED
##############
- run_dir = None
- inst = None
- env = None
- trx = None
BIN_BTS_TRX = 'osmo-bts-trx'
BIN_PCU = 'osmo-pcu'
@@ -39,6 +35,9 @@ class OsmoBtsTrx(bts_osmo.OsmoBtsMainUnit):
def __init__(self, suite_run, conf):
super().__init__(suite_run, conf, OsmoBtsTrx.BIN_BTS_TRX, 'osmo_bts_trx')
+ self.run_dir = None
+ self.inst = None
+ self.trx = None
self.env = {}
def trx_remote_ip(self):
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index 65c9279..e3f4823 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -25,10 +25,6 @@ class SysmoBts(bts_osmo.OsmoBts):
##############
# PROTECTED
##############
- run_dir = None
- inst = None
- remote_inst = None
- remote_dir = None
REMOTE_DIR = '/osmo-gsm-tester-bts'
BTS_SYSMO_BIN = 'osmo-bts-sysmo'
@@ -36,6 +32,10 @@ class SysmoBts(bts_osmo.OsmoBts):
def __init__(self, suite_run, conf):
super().__init__(suite_run, conf, SysmoBts.BTS_SYSMO_BIN, 'osmo_bts_sysmo')
+ self.run_dir = None
+ self.inst = None
+ self.remote_inst = None
+ self.remote_dir = None
self.remote_user = 'root'
def _direct_pcu_enabled(self):
diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py
index 78421f6..9653fbf 100644
--- a/src/osmo_gsm_tester/esme.py
+++ b/src/osmo_gsm_tester/esme.py
@@ -34,8 +34,6 @@ MAX_SYS_ID_LEN = 16
MAX_PASSWD_LEN = 16
class Esme(log.Origin):
- client = None
- smsc = None
MSGMODE_TRANSACTION = smpplib.consts.SMPP_MSGMODE_FORWARD
MSGMODE_STOREFORWARD = smpplib.consts.SMPP_MSGMODE_STOREFORWARD
@@ -45,6 +43,8 @@ class Esme(log.Origin):
# Get last characters of msisdn to stay inside MAX_SYS_ID_LEN. Similar to modulus operator.
self.set_system_id('esme-' + self.msisdn[-11:])
super().__init__(log.C_TST, self.system_id)
+ self.client = None
+ self.smsc = None
self.set_password('esme-pwd')
self.connected = False
self.bound = False
diff --git a/src/osmo_gsm_tester/event_loop.py b/src/osmo_gsm_tester/event_loop.py
index 0f647c2..fe88ef4 100644
--- a/src/osmo_gsm_tester/event_loop.py
+++ b/src/osmo_gsm_tester/event_loop.py
@@ -23,10 +23,12 @@ from gi.repository import GLib, GObject
from . import log
class DeferredHandling:
- defer_queue = []
+
+ def __init__(self):
+ self.defer_queue = []
def handle_queue(self):
- while DeferredHandling.defer_queue:
+ while self.defer_queue:
handler, args, kwargs = self.defer_queue.pop(0)
handler(*args, **kwargs)
@@ -34,10 +36,10 @@ class DeferredHandling:
self.defer_queue.append((handler, args, kwargs))
class WaitRequest:
- timeout_ack = False
- condition_ack = False
def __init__(self, condition, condition_args, condition_kwargs, timeout, timestep):
+ self.timeout_ack = False
+ self.condition_ack = False
self.timeout_started = time.time()
self.timeout = timeout
self.condition = condition
@@ -53,12 +55,9 @@ class WaitRequest:
self.timeout_ack = True
class EventLoop:
- poll_funcs = []
- gloop = None
- gctx = None
- deferred_handling = None
def __init__(self):
+ self.poll_funcs = []
self.gloop = GLib.MainLoop()
self.gctx = self.gloop.get_context()
self.deferred_handling = DeferredHandling()
diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index 59fcc76..d0bbf23 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -321,10 +321,6 @@ class ModemDbusInteraction(log.Origin):
class Modem(log.Origin):
'convenience for ofono Modem interaction'
- msisdn = None
- sms_received_list = None
- _ki = None
- _imsi = None
CTX_PROT_IPv4 = 'ip'
CTX_PROT_IPv6 = 'ipv6'
@@ -336,6 +332,9 @@ class Modem(log.Origin):
self.dbuspath = get_dbuspath_from_syspath(self.syspath)
super().__init__(log.C_TST, self.dbuspath)
self.dbg('creating from syspath %s', self.syspath)
+ self.msisdn = None
+ self._ki = None
+ self._imsi = None
self.sms_received_list = []
self.dbus = ModemDbusInteraction(self.dbuspath)
self.register_attempts = 0
diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py
index 323b9ec..0e5bbbe 100644
--- a/src/osmo_gsm_tester/osmo_bsc.py
+++ b/src/osmo_gsm_tester/osmo_bsc.py
@@ -24,19 +24,14 @@ import pprint
from . import log, util, config, template, process, osmo_ctrl, pcap_recorder
class OsmoBsc(log.Origin):
- suite_run = None
- ip_address = None
- run_dir = None
- config_file = None
- process = None
- bts = None
- encryption = None
- rsl_ip = None
- mgw = None
- stp = None
def __init__(self, suite_run, msc, mgw, stp, ip_address):
super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr'))
+ self.run_dir = None
+ self.config_file = None
+ self.process = None
+ self.encryption = None
+ self.rsl_ip = None
self.suite_run = suite_run
self.ip_address = ip_address
self.bts = []
diff --git a/src/osmo_gsm_tester/osmo_ggsn.py b/src/osmo_gsm_tester/osmo_ggsn.py
index 9f23c64..2fdc792 100644
--- a/src/osmo_gsm_tester/osmo_ggsn.py
+++ b/src/osmo_gsm_tester/osmo_ggsn.py
@@ -23,14 +23,12 @@ import pprint
from . import log, util, config, template, process, osmo_ctrl, pcap_recorder
class OsmoGgsn(log.Origin):
- suite_run = None
- ip_address = None
- run_dir = None
- config_file = None
- process = None
def __init__(self, suite_run, ip_address):
super().__init__(log.C_RUN, 'osmo-ggsn_%s' % ip_address.get('addr'))
+ self.run_dir = None
+ self.config_file = None
+ self.process = None
self.suite_run = suite_run
self.ip_address = ip_address
diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py
index 635f711..a4633e3 100644
--- a/src/osmo_gsm_tester/osmo_hlr.py
+++ b/src/osmo_gsm_tester/osmo_hlr.py
@@ -25,8 +25,6 @@ import sqlite3
from . import log, util, config, template, process, osmo_ctrl, pcap_recorder
class OsmoHlr(log.Origin):
- suite_run = None
- ip_address = None
run_dir = None
config_file = None
process = None
@@ -34,9 +32,12 @@ class OsmoHlr(log.Origin):
def __init__(self, suite_run, ip_address):
super().__init__(log.C_RUN, 'osmo-hlr_%s' % ip_address.get('addr'))
+ self.run_dir = None
+ self.config_file = None
+ self.process = None
+ self.next_subscriber_id = 1
self.suite_run = suite_run
self.ip_address = ip_address
- self.bts = []
def start(self):
self.log('Starting osmo-hlr')
diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py
index bebb9d5..82b9149 100644
--- a/src/osmo_gsm_tester/osmo_mgcpgw.py
+++ b/src/osmo_gsm_tester/osmo_mgcpgw.py
@@ -23,14 +23,12 @@ import pprint
from . import log, util, config, template, process, osmo_ctrl, pcap_recorder
class OsmoMgcpgw(log.Origin):
- suite_run = None
- ip_address = None
- run_dir = None
- config_file = None
- process = None
def __init__(self, suite_run, ip_address, bts_ip):
super().__init__(log.C_RUN, 'osmo-mgcpgw_%s' % ip_address.get('addr'))
+ self.run_dir = None
+ self.config_file = None
+ self.process = None
self.suite_run = suite_run
self.ip_address = ip_address
# hack: so far mgcpgw needs one specific BTS IP.
diff --git a/src/osmo_gsm_tester/osmo_mgw.py b/src/osmo_gsm_tester/osmo_mgw.py
index abac4aa..1d5596e 100644
--- a/src/osmo_gsm_tester/osmo_mgw.py
+++ b/src/osmo_gsm_tester/osmo_mgw.py
@@ -23,14 +23,12 @@ import pprint
from . import log, util, config, template, process, osmo_ctrl, pcap_recorder
class OsmoMgw(log.Origin):
- suite_run = None
- ip_address = None
- run_dir = None
- config_file = None
- process = None
def __init__(self, suite_run, ip_address):
super().__init__(log.C_RUN, 'osmo-mgw_%s' % ip_address.get('addr'))
+ self.run_dir = None
+ self.config_file = None
+ self.process = None
self.suite_run = suite_run
self.ip_address = ip_address
diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py
index 0e458fe..192926c 100644
--- a/src/osmo_gsm_tester/osmo_msc.py
+++ b/src/osmo_gsm_tester/osmo_msc.py
@@ -23,20 +23,15 @@ import pprint
from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc
class OsmoMsc(log.Origin):
- suite_run = None
- ip_address = None
- run_dir = None
- config_file = None
- process = None
- hlr = None
- config = None
- smsc = None
- stp = None
- encryption = None
- authentication = None
def __init__(self, suite_run, hlr, mgw, stp, ip_address):
super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr'))
+ self.run_dir = None
+ self.config_file = None
+ self.process = None
+ self.config = None
+ self.encryption = None
+ self.authentication = None
self.suite_run = suite_run
self.ip_address = ip_address
self.hlr = hlr
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 48037a6..66ab2a6 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -24,17 +24,13 @@ import pprint
from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc
class OsmoNitb(log.Origin):
- suite_run = None
- ip_address = None
- run_dir = None
- config_file = None
- process = None
- bts = None
- smsc = None
- encryption = None
def __init__(self, suite_run, ip_address):
super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr'))
+ self.run_dir = None
+ self.config_file = None
+ self.process = None
+ self.encryption = None
self.suite_run = suite_run
self.ip_address = ip_address
self.bts = []
diff --git a/src/osmo_gsm_tester/osmo_sgsn.py b/src/osmo_gsm_tester/osmo_sgsn.py
index 8659186..07cf059 100644
--- a/src/osmo_gsm_tester/osmo_sgsn.py
+++ b/src/osmo_gsm_tester/osmo_sgsn.py
@@ -23,16 +23,12 @@ import pprint
from . import log, util, config, template, process, osmo_ctrl, pcap_recorder
class OsmoSgsn(log.Origin):
- suite_run = None
- ip_address = None
- run_dir = None
- config_file = None
- process = None
- hlr = None
- ggsn = None
def __init__(self, suite_run, hlr, ggsn, ip_address):
super().__init__(log.C_RUN, 'osmo-sgsn_%s' % ip_address.get('addr'))
+ self.run_dir = None
+ self.config_file = None
+ self.process = None
self.suite_run = suite_run
self.hlr = hlr
self.ggsn = ggsn
diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py
index ced138b..5a7f0d3 100644
--- a/src/osmo_gsm_tester/osmo_stp.py
+++ b/src/osmo_gsm_tester/osmo_stp.py
@@ -23,14 +23,12 @@ import pprint
from . import log, util, config, template, process, pcap_recorder
class OsmoStp(log.Origin):
- suite_run = None
- ip_address = None
- run_dir = None
- config_file = None
- process = None
def __init__(self, suite_run, ip_address):
super().__init__(log.C_RUN, 'osmo-stp_%s' % ip_address.get('addr'))
+ self.run_dir = None
+ self.config_file = None
+ self.process = None
self.suite_run = suite_run
self.ip_address = ip_address
diff --git a/src/osmo_gsm_tester/osmocon.py b/src/osmo_gsm_tester/osmocon.py
index 5b1e145..8b6040f 100644
--- a/src/osmo_gsm_tester/osmocon.py
+++ b/src/osmo_gsm_tester/osmocon.py
@@ -24,10 +24,6 @@ from . import log, util, process
from .event_loop import MainLoop
class Osmocon(log.Origin):
- suite_run = None
- run_dir = None
- process = None
- sk_tmp_dir = None
FIRMWARE_FILE="opt/osmocom-bb/target/firmware/board/compal_e88/layer1.compalram.bin"
@@ -37,6 +33,8 @@ class Osmocon(log.Origin):
raise log.Error('osmocon_phone contains no attr "serial_device"')
self.serial_device = os.path.realpath(serial_device)
super().__init__(log.C_RUN, 'osmocon_%s' % os.path.basename(self.serial_device))
+ self.run_dir = None
+ self.process = None
self.suite_run = suite_run
self.conf = conf
self.sk_tmp_dir = tempfile.mkdtemp('', 'ogtosmoconsk')
diff --git a/src/osmo_gsm_tester/pcu.py b/src/osmo_gsm_tester/pcu.py
index 0260296..9ec8f35 100644
--- a/src/osmo_gsm_tester/pcu.py
+++ b/src/osmo_gsm_tester/pcu.py
@@ -22,9 +22,6 @@ from . import log
class Pcu(log.Origin, metaclass=ABCMeta):
"""PCU Abstract Base Class."""
- suite_run = None
- run_dir = None
- bts = None
##############
# PROTECTED
diff --git a/src/osmo_gsm_tester/pcu_osmo.py b/src/osmo_gsm_tester/pcu_osmo.py
index 50ae134..ad8ebce 100644
--- a/src/osmo_gsm_tester/pcu_osmo.py
+++ b/src/osmo_gsm_tester/pcu_osmo.py
@@ -23,14 +23,14 @@ import tempfile
from . import log, config, util, template, process, pcu
class OsmoPcu(pcu.Pcu):
- inst = None
- env = None
BIN_PCU = 'osmo-pcu'
PCU_OSMO_CFG = 'osmo-pcu.cfg'
def __init__(self, suite_run, bts, conf):
super().__init__(suite_run, bts, conf, OsmoPcu.BIN_PCU)
+ self.run_dir = None
+ self.inst = None
self.conf = conf
self.env = {}
diff --git a/src/osmo_gsm_tester/pcu_sysmo.py b/src/osmo_gsm_tester/pcu_sysmo.py
index b97852a..cd3b75e 100644
--- a/src/osmo_gsm_tester/pcu_sysmo.py
+++ b/src/osmo_gsm_tester/pcu_sysmo.py
@@ -22,14 +22,6 @@ import pprint
from . import log, config, util, template, process
class OsmoPcuSysmo(log.Origin):
- suite_run = None
- bsc = None
- run_dir = None
- inst = None
- remote_inst = None
- remote_env = None
- remote_dir = None
- sysmobts = None
REMOTE_DIR = '/osmo-gsm-tester-pcu'
PCU_SYSMO_BIN = 'osmo-pcu'
@@ -37,6 +29,12 @@ class OsmoPcuSysmo(log.Origin):
def __init__(self, suite_run, sysmobts, conf):
super().__init__(log.C_RUN, self.PCU_SYSMO_BIN)
+ self.run_dir = None
+ self.bsc = None
+ self.inst = None
+ self.remote_inst = None
+ self.remote_dir = None
+ self.sysmobts = None
self.suite_run = suite_run
self.sysmobts = sysmobts
self.conf = conf
diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py
index c13ded0..ad2405d 100644
--- a/src/osmo_gsm_tester/process.py
+++ b/src/osmo_gsm_tester/process.py
@@ -29,13 +29,11 @@ from .util import Dir
class Process(log.Origin):
- process_obj = None
- outputs = None
- result = None
- killed = None
-
def __init__(self, name, run_dir, popen_args, **popen_kwargs):
super().__init__(log.C_RUN, name)
+ self.process_obj = None
+ self.result = None
+ self.killed = None
self.name_str = name
self.run_dir = run_dir
self.popen_args = popen_args
diff --git a/src/osmo_gsm_tester/sms.py b/src/osmo_gsm_tester/sms.py
index e264b66..0118517 100644
--- a/src/osmo_gsm_tester/sms.py
+++ b/src/osmo_gsm_tester/sms.py
@@ -19,7 +19,6 @@
class Sms:
_last_sms_idx = 0
- msg = None
def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens):
Sms._last_sms_idx += 1
diff --git a/src/osmo_gsm_tester/smsc.py b/src/osmo_gsm_tester/smsc.py
index 4837f37..1a0859c 100644
--- a/src/osmo_gsm_tester/smsc.py
+++ b/src/osmo_gsm_tester/smsc.py
@@ -20,7 +20,6 @@
from . import log, config, util, template, process
class Smsc:
- esmes = None
SMSC_POLICY_CLOSED = 'closed'
SMSC_POLICY_ACCEPT_ALL = 'accept-all'
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index db4a8dc..c712a75 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -63,21 +63,17 @@ class SuiteRun(log.Origin):
PASS = 'PASS'
FAIL = 'FAIL'
- trial = None
- status = None
- start_timestamp = None
- duration = None
- resources_pool = None
- reserved_resources = None
- objects_to_clean_up = None
- test_import_modules_to_clean_up = []
- _resource_requirements = None
- _config = None
- _processes = None
- _run_dir = None
-
def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]):
super().__init__(log.C_TST, suite_scenario_str)
+ self.start_timestamp = None
+ self.duration = None
+ self.reserved_resources = None
+ self.objects_to_clean_up = None
+ self.test_import_modules_to_clean_up = []
+ self._resource_requirements = None
+ self._config = None
+ self._processes = None
+ self._run_dir = None
self.trial = trial
self.definition = suite_definition
self.scenarios = scenarios
diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py
index b706dac..6f141f1 100644
--- a/src/osmo_gsm_tester/test.py
+++ b/src/osmo_gsm_tester/test.py
@@ -31,11 +31,10 @@ class Test(log.Origin):
PASS = 'pass'
FAIL = 'FAIL'
- _run_dir = None
-
def __init__(self, suite_run, test_basename):
self.basename = test_basename
super().__init__(log.C_TST, self.basename)
+ self._run_dir = None
self.suite_run = suite_run
self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename)
self.status = Test.UNKNOWN
diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py
index d54e96c..149d34c 100644
--- a/src/osmo_gsm_tester/trial.py
+++ b/src/osmo_gsm_tester/trial.py
@@ -36,12 +36,6 @@ class Trial(log.Origin):
PASS = 'PASS'
FAIL = 'FAIL'
- path = None
- dir = None
- _run_dir = None
- bin_tars = None
- log_targets = None
-
@staticmethod
def next(trials_dir):
@@ -63,6 +57,8 @@ class Trial(log.Origin):
self.bin_tars = []
self.suites = []
self.status = Trial.UNKNOWN
+ self._run_dir = None
+ self.log_targets = None
def __repr__(self):
return self.name()