Change in osmo-gsm-tester[master]: suite: Fix generation of config() dictionary

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Wed Aug 29 10:18:05 UTC 2018


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10624 )

Change subject: suite: Fix generation of config() dictionary
......................................................................

suite: Fix generation of config() dictionary

suite.config() hasn't been activetly used anywere. New upcoming patches
will start using it to set and overlay config parameters for objects
which are not necessarily allocated as resources.

Since these options don't apply to specific resources, there's no sense
in running replicate_times() on them.

Change-Id: I5fcdc9151d1663e738f5c8abe588a42ab51c8f6e
---
M src/osmo_gsm_tester/suite.py
1 file changed, 8 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, but someone else must approve
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index fa86f96..3a49574 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -126,14 +126,18 @@
         self.duration = 0
         self.status = SuiteRun.UNKNOWN
 
-    def combined(self, conf_name):
+    def combined(self, conf_name, replicate_times=True):
         log.dbg(combining=conf_name)
         log.ctx(combining_scenarios=conf_name)
-        combination = config.replicate_times(self.definition.conf.get(conf_name, {}))
+        combination = self.definition.conf.get(conf_name, {})
+        if replicate_times:
+            combination = config.replicate_times(combination)
         log.dbg(definition_conf=combination)
         for scenario in self.scenarios:
             log.ctx(combining_scenarios=conf_name, scenario=scenario.name())
-            c = config.replicate_times(scenario.get(conf_name, {}))
+            c = scenario.get(conf_name, {})
+            if replicate_times:
+                c = config.replicate_times(c)
             log.dbg(scenario=scenario.name(), conf=c)
             if c is None:
                 continue
@@ -162,7 +166,7 @@
 
     def config(self):
         if self._config is None:
-            self._config = self.combined('config')
+            self._config = self.combined('config', False)
         return self._config
 
     def reserve_resources(self):

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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5fcdc9151d1663e738f5c8abe588a42ab51c8f6e
Gerrit-Change-Number: 10624
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180829/1dae8a47/attachment.htm>


More information about the gerrit-log mailing list