From: Ondrej Lichtner <olichtne(a)redhat.com>
The configuration object should now store arbitrary data that each
derived recipe decides to put in it instead of providing a strict api
interface.
The object will get automatically created by the default
test_wide_configuration method, however testers are free not to use this
functionality. It's current implementation is there to enable
collaborative inheritance but if you override it the recipe should still
work fine.
Later on it might make sense to introduce a factory method that creates
an EnrtConfiguration derived object that is defined by a more specific
class and enforces an api, but I don't think we need that for now.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 36 ++++-------------------------
1 file changed, 5 insertions(+), 31 deletions(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index 0e6c333..cacbd94 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -20,34 +20,7 @@
from lnst.RecipeCommon.Perf.Evaluators import NonzeroFlowEvaluator
class EnrtConfiguration(object):
- def __init__(self):
- self._endpoint1 = None
- self._endpoint2 = None
- self._params = None
-
- @property
- def endpoint1(self):
- return self._endpoint1
-
- @endpoint1.setter
- def endpoint1(self, value):
- self._endpoint1 = value
-
- @property
- def endpoint2(self):
- return self._endpoint2
-
- @endpoint2.setter
- def endpoint2(self, value):
- self._endpoint2 = value
-
- @property
- def params(self):
- return self._params
-
- @params.setter
- def params(self, value):
- self._params = value
+ pass
class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe):
@@ -97,10 +70,11 @@ def _test_wide_context(self):
self.test_wide_deconfiguration(config)
def test_wide_configuration(self):
- raise NotImplementedError("Method must be defined by a child class.")
+ return EnrtConfiguration()
- def test_wide_deconfiguration(self, main_config):
- raise NotImplementedError("Method must be defined by a child class.")
+ def test_wide_deconfiguration(self, config):
+ #TODO check if anything is still applied and throw exception?
+ return
def describe_test_wide_configuration(self, config):
description = self.generate_test_wide_description(config)
--
2.22.0