aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-06 21:52:03 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-07 18:04:13 +0000
commitb902b299121d52cde92d0f235212b1f5cd97b872 (patch)
treeac4eb35e3b6a69aba4b846c37221ef2466c2c634
parenta8a05a2e23770615a5ad96ff1cb33c373f306928 (diff)
test API: allow passing resource requirements
For all those API functions that directly use reserved_resources.get(), add a 'specifics' argument to be able to pick specific resources. For example, this allows to pick a suite.bts(specifics={'type': 'osmo-bts-sysmo'}) I needed this to test error reporting for over-using resources, but will most probably make sense in the future. Change-Id: If6f175f4bb53dec5306fb3c6479202a7bf1c7116
-rw-r--r--src/osmo_gsm_tester/suite.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index b88b8b2..fb6cf36 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -286,8 +286,8 @@ class SuiteRun(log.Origin):
return
self.reserved_resources.free()
- def ip_address(self):
- return self.reserved_resources.get(resource.R_IP_ADDRESS)
+ def ip_address(self, specifics=None):
+ return self.reserved_resources.get(resource.R_IP_ADDRESS, specifics=specifics)
def nitb(self, ip_address=None):
if ip_address is None:
@@ -314,11 +314,11 @@ class SuiteRun(log.Origin):
ip_address = self.ip_address()
return osmo_bsc.OsmoBsc(self, msc, ip_address)
- def bts(self):
- return bts_obj(self, self.reserved_resources.get(resource.R_BTS))
+ def bts(self, specifics=None):
+ return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics))
- def modem(self):
- conf = self.reserved_resources.get(resource.R_MODEM)
+ def modem(self, specifics=None):
+ conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics)
self.dbg('create Modem object', conf=conf)
modem = ofono_client.Modem(conf)
self.register_for_cleanup(modem)