It does not make sense to have this setup just for offloaded tests. A follow up patch will add this to proper place.
Signed-off-by: Jan Tluka jtluka@redhat.com --- .../ENRT/ConfigMixins/OffloadSubConfigMixin.py | 12 ------------ 1 file changed, 12 deletions(-)
diff --git a/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py index 989743a8..3250a6af 100644 --- a/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py +++ b/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py @@ -45,12 +45,6 @@ class OffloadSubConfigMixin(BaseSubConfigMixin): ethtool_offload_string += " %s %s" % (name, value)
for nic in self.offload_nics: - if "sctp_stream" in self.params.perf_tests: - nic.netns.run( - "iptables -I OUTPUT ! -o %s -p sctp -j DROP" % nic.name, - job_level=ResultLevel.NORMAL, - ) - nic.netns.run( "ethtool -K {} {}".format(nic.name, ethtool_offload_string), job_level=ResultLevel.NORMAL, @@ -78,12 +72,6 @@ class OffloadSubConfigMixin(BaseSubConfigMixin): ethtool_offload_string += " %s %s" % (name, "on")
for nic in self.offload_nics: - if "sctp_stream" in self.params.perf_tests: - nic.netns.run( - "iptables -D OUTPUT ! -o %s -p sctp -j DROP" % nic.name, - job_level=ResultLevel.NORMAL, - ) - # set all the offloads back to 'on' state nic.netns.run( "ethtool -K {} {}".format(nic.name, ethtool_offload_string),
This will be used for additional pre-configuration of the SCTP performance test.
Signed-off-by: Jan Tluka jtluka@redhat.com --- .../Perf/Measurements/BaseFlowMeasurement.py | 18 ++++++++++++++++-- lnst/Recipes/ENRT/BaseEnrtRecipe.py | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py index 8c74c610..856eeba3 100644 --- a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py @@ -8,15 +8,17 @@ from lnst.RecipeCommon.Perf.Results import SequentialPerfResult class Flow(object): def __init__(self, type, - generator, generator_bind, - receiver, receiver_bind, + generator, generator_bind, generator_nic, + receiver, receiver_bind, receiver_nic, msg_size, duration, parallel_streams, cpupin): self._type = type
self._generator = generator self._generator_bind = generator_bind + self._generator_nic = generator_nic self._receiver = receiver self._receiver_bind = receiver_bind + self._receiver_nic = receiver_nic
self._msg_size = msg_size self._duration = duration @@ -35,6 +37,10 @@ class Flow(object): def generator_bind(self): return self._generator_bind
+ @property + def generator_nic(self): + return self._generator_nic + @property def receiver(self): return self._receiver @@ -43,6 +49,10 @@ class Flow(object): def receiver_bind(self): return self._receiver_bind
+ @property + def receiver_nic(self): + return self._receiver_nic + @property def msg_size(self): return self._msg_size @@ -65,8 +75,10 @@ class Flow(object): type={type}, generator={generator}, generator_bind={generator_bind}, + generator_nic={generator_nic}, receiver={receiver}, receiver_bind={receiver_bind}, + receiver_nic={receiver_nic}, msg_size={msg_size}, duration={duration}, parallel_streams={parallel_streams}, @@ -75,8 +87,10 @@ class Flow(object): type=self.type, generator=str(self.generator), generator_bind=self.generator_bind, + generator_nic=self.generator_nic, receiver=str(self.receiver), receiver_bind=self.receiver_bind, + receiver_nic=self.receiver_nic, msg_size=self.msg_size, duration=self.duration, parallel_streams=self.parallel_streams, diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index 6a287ada..f8fafc80 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -508,7 +508,9 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe): cpupin = self.params.perf_tool_cpu if "perf_tool_cpu" in self.params else None return PerfFlow(type=perf_test, generator=client_nic.netns, generator_bind=client_bind, + generator_nic=client_nic, receiver=server_nic.netns, receiver_bind=server_bind, + receiver_nic=server_nic, msg_size=msg_size, duration=self.params.perf_duration, parallel_streams=self.params.perf_parallel_streams,
This patch adds a PerfTestMixins module that contains mixins to perform additional tasks required by the BaseEnrtRecipe.do_perf_tests() method. This is similar to ConfigMixin classes but at a deeper code level.
The module provides a base class BasePerfTestTweakMixin that defines two methods, apply_perf_test_tweak() and remove_perf_test_tweak(), to do additional configuration steps before and after the performance test.
The module also contains SctpFirewallPerfTestMixin that provides additional tweak of the network stack for SCTP performance test. As an optimization, the mixin applies iptables rules to the OUTPUT chain to drop any packets on other than the tested interface. This is to prevent SCTP going through unintended path.
Signed-off-by: Jan Tluka jtluka@redhat.com --- .../PerfTestMixins/BasePerfTestTweakMixin.py | 11 +++++++ .../SctpFirewallPerfTestMixin.py | 33 +++++++++++++++++++ lnst/Recipes/ENRT/PerfTestMixins/__init__.py | 2 ++ 3 files changed, 46 insertions(+) create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/__init__.py
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py new file mode 100644 index 00000000..a444384d --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py @@ -0,0 +1,11 @@ +class BasePerfTestTweakMixin(object): + """ + This is a base class that defines common API for specific *perf test* + mixin classes. + """ + + def apply_perf_test_tweak(self, perf_config): + pass + + def remove_perf_test_tweak(self, perf_config): + pass diff --git a/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py new file mode 100644 index 00000000..46963dd2 --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py @@ -0,0 +1,33 @@ +from lnst.Controller.RecipeResults import ResultLevel +from lnst.Recipes.ENRT.PerfTestMixins import BasePerfTestTweakMixin +from lnst.RecipeCommon.Perf.Measurements.BaseFlowMeasurement import BaseFlowMeasurement + +class SctpFirewallPerfTestMixin(BasePerfTestTweakMixin): + + def _get_flow_measurement_from_config(self, perf_config): + flow_measurements = [ m for m in perf_config.measurements if isinstance(m, BaseFlowMeasurement) ] + return flow_measurements[0] + + def apply_perf_test_tweak(self, perf_config): + super().apply_perf_test_tweak(perf_config) + + flow_measurement = self._get_flow_measurement_from_config(perf_config) + flow = flow_measurement.conf[0] + if flow.type == "sctp_stream": + for nic in [flow.generator_nic, flow.receiver_nic]: + nic.netns.run( + "iptables -I OUTPUT ! -o %s -p sctp -j DROP" % nic.name, + job_level=ResultLevel.NORMAL, + ) + + def remove_perf_test_tweak(self, perf_config): + flow_measurement = self._get_flow_measurement_from_config(perf_config) + flow = flow_measurement.conf[0] + if flow.type == "sctp_stream": + for nic in [flow.generator_nic, flow.receiver_nic]: + nic.netns.run( + "iptables -D OUTPUT ! -o %s -p sctp -j DROP" % nic.name, + job_level=ResultLevel.NORMAL, + ) + + super().remove_perf_test_tweak(perf_config) diff --git a/lnst/Recipes/ENRT/PerfTestMixins/__init__.py b/lnst/Recipes/ENRT/PerfTestMixins/__init__.py new file mode 100644 index 00000000..9f320118 --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/__init__.py @@ -0,0 +1,2 @@ +from lnst.Recipes.ENRT.PerfTestMixins.BasePerfTestTweakMixin import BasePerfTestTweakMixin +from lnst.Recipes.ENRT.PerfTestMixins.SctpFirewallPerfTestMixin import SctpFirewallPerfTestMixin
Two comments inline.
On Fri, Jul 24, 2020 at 07:00:47PM +0200, Jan Tluka wrote:
This patch adds a PerfTestMixins module that contains mixins to perform additional tasks required by the BaseEnrtRecipe.do_perf_tests() method. This is similar to ConfigMixin classes but at a deeper code level.
The module provides a base class BasePerfTestTweakMixin that defines two methods, apply_perf_test_tweak() and remove_perf_test_tweak(), to do additional configuration steps before and after the performance test.
The module also contains SctpFirewallPerfTestMixin that provides additional tweak of the network stack for SCTP performance test. As an optimization, the mixin applies iptables rules to the OUTPUT chain to drop any packets on other than the tested interface. This is to prevent SCTP going through unintended path.
Signed-off-by: Jan Tluka jtluka@redhat.com
.../PerfTestMixins/BasePerfTestTweakMixin.py | 11 +++++++ .../SctpFirewallPerfTestMixin.py | 33 +++++++++++++++++++ lnst/Recipes/ENRT/PerfTestMixins/__init__.py | 2 ++ 3 files changed, 46 insertions(+) create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/__init__.py
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py new file mode 100644 index 00000000..a444384d --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py @@ -0,0 +1,11 @@ +class BasePerfTestTweakMixin(object):
- """
- This is a base class that defines common API for specific *perf test*
- mixin classes.
- """
- def apply_perf_test_tweak(self, perf_config):
pass
- def remove_perf_test_tweak(self, perf_config):
pass
The other mixin classes also define a "describe" method here - to generate a human readable TestResult describing what configuration was just applied. The reason being that we want to have all the important configuration steps be explicitly visible to users.
The host.run() method will generate lower level result objects for the specific commands that were executed, but a higher level descriptor for users is IMO also important.
What do you think? Could that be added easily or does it not fit this mixin class hierarchy?
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py new file mode 100644 index 00000000..46963dd2 --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py @@ -0,0 +1,33 @@ +from lnst.Controller.RecipeResults import ResultLevel +from lnst.Recipes.ENRT.PerfTestMixins import BasePerfTestTweakMixin +from lnst.RecipeCommon.Perf.Measurements.BaseFlowMeasurement import BaseFlowMeasurement
+class SctpFirewallPerfTestMixin(BasePerfTestTweakMixin):
- def _get_flow_measurement_from_config(self, perf_config):
flow_measurements = [ m for m in perf_config.measurements if isinstance(m, BaseFlowMeasurement) ]
return flow_measurements[0]
- def apply_perf_test_tweak(self, perf_config):
super().apply_perf_test_tweak(perf_config)
flow_measurement = self._get_flow_measurement_from_config(perf_config)
flow = flow_measurement.conf[0]
I see you're using [0] here as well as in the previous method, it's probably ok for the current use case of the SCTP tests but what would happen if this was combined with a "multistream" sctp test? Is that still handled?
-Ondrej
if flow.type == "sctp_stream":
for nic in [flow.generator_nic, flow.receiver_nic]:
nic.netns.run(
"iptables -I OUTPUT ! -o %s -p sctp -j DROP" % nic.name,
job_level=ResultLevel.NORMAL,
)
- def remove_perf_test_tweak(self, perf_config):
flow_measurement = self._get_flow_measurement_from_config(perf_config)
flow = flow_measurement.conf[0]
if flow.type == "sctp_stream":
for nic in [flow.generator_nic, flow.receiver_nic]:
nic.netns.run(
"iptables -D OUTPUT ! -o %s -p sctp -j DROP" % nic.name,
job_level=ResultLevel.NORMAL,
)
super().remove_perf_test_tweak(perf_config)
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/__init__.py b/lnst/Recipes/ENRT/PerfTestMixins/__init__.py new file mode 100644 index 00000000..9f320118 --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/__init__.py @@ -0,0 +1,2 @@ +from lnst.Recipes.ENRT.PerfTestMixins.BasePerfTestTweakMixin import BasePerfTestTweakMixin
+from lnst.Recipes.ENRT.PerfTestMixins.SctpFirewallPerfTestMixin import SctpFirewallPerfTestMixin
2.21.3 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
Mon, Jul 27, 2020 at 09:19:12AM CEST, olichtne@redhat.com wrote:
Two comments inline.
On Fri, Jul 24, 2020 at 07:00:47PM +0200, Jan Tluka wrote:
This patch adds a PerfTestMixins module that contains mixins to perform additional tasks required by the BaseEnrtRecipe.do_perf_tests() method. This is similar to ConfigMixin classes but at a deeper code level.
The module provides a base class BasePerfTestTweakMixin that defines two methods, apply_perf_test_tweak() and remove_perf_test_tweak(), to do additional configuration steps before and after the performance test.
The module also contains SctpFirewallPerfTestMixin that provides additional tweak of the network stack for SCTP performance test. As an optimization, the mixin applies iptables rules to the OUTPUT chain to drop any packets on other than the tested interface. This is to prevent SCTP going through unintended path.
Signed-off-by: Jan Tluka jtluka@redhat.com
.../PerfTestMixins/BasePerfTestTweakMixin.py | 11 +++++++ .../SctpFirewallPerfTestMixin.py | 33 +++++++++++++++++++ lnst/Recipes/ENRT/PerfTestMixins/__init__.py | 2 ++ 3 files changed, 46 insertions(+) create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/__init__.py
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py new file mode 100644 index 00000000..a444384d --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py @@ -0,0 +1,11 @@ +class BasePerfTestTweakMixin(object):
- """
- This is a base class that defines common API for specific *perf test*
- mixin classes.
- """
- def apply_perf_test_tweak(self, perf_config):
pass
- def remove_perf_test_tweak(self, perf_config):
pass
The other mixin classes also define a "describe" method here - to generate a human readable TestResult describing what configuration was just applied. The reason being that we want to have all the important configuration steps be explicitly visible to users.
The host.run() method will generate lower level result objects for the specific commands that were executed, but a higher level descriptor for users is IMO also important.
What do you think? Could that be added easily or does it not fit this mixin class hierarchy?
I'll take a look if this can be done.
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py new file mode 100644 index 00000000..46963dd2 --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py @@ -0,0 +1,33 @@ +from lnst.Controller.RecipeResults import ResultLevel +from lnst.Recipes.ENRT.PerfTestMixins import BasePerfTestTweakMixin +from lnst.RecipeCommon.Perf.Measurements.BaseFlowMeasurement import BaseFlowMeasurement
+class SctpFirewallPerfTestMixin(BasePerfTestTweakMixin):
- def _get_flow_measurement_from_config(self, perf_config):
flow_measurements = [ m for m in perf_config.measurements if isinstance(m, BaseFlowMeasurement) ]
return flow_measurements[0]
- def apply_perf_test_tweak(self, perf_config):
super().apply_perf_test_tweak(perf_config)
flow_measurement = self._get_flow_measurement_from_config(perf_config)
flow = flow_measurement.conf[0]
I see you're using [0] here as well as in the previous method, it's probably ok for the current use case of the SCTP tests but what would happen if this was combined with a "multistream" sctp test? Is that still handled?
It depends if the multistream contains a mix of different protocols to test at once. With the current implementation of ENRT recipes this is not possible IMO.
If this comment is just about test of multiple streams of the same protocol, I'm not sure if this work. I'll check that.
Thanks for review!
-Jan
-Ondrej
if flow.type == "sctp_stream":
for nic in [flow.generator_nic, flow.receiver_nic]:
nic.netns.run(
"iptables -I OUTPUT ! -o %s -p sctp -j DROP" % nic.name,
job_level=ResultLevel.NORMAL,
)
- def remove_perf_test_tweak(self, perf_config):
flow_measurement = self._get_flow_measurement_from_config(perf_config)
flow = flow_measurement.conf[0]
if flow.type == "sctp_stream":
for nic in [flow.generator_nic, flow.receiver_nic]:
nic.netns.run(
"iptables -D OUTPUT ! -o %s -p sctp -j DROP" % nic.name,
job_level=ResultLevel.NORMAL,
)
super().remove_perf_test_tweak(perf_config)
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/__init__.py b/lnst/Recipes/ENRT/PerfTestMixins/__init__.py new file mode 100644 index 00000000..9f320118 --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/__init__.py @@ -0,0 +1,2 @@ +from lnst.Recipes.ENRT.PerfTestMixins.BasePerfTestTweakMixin import BasePerfTestTweakMixin
+from lnst.Recipes.ENRT.PerfTestMixins.SctpFirewallPerfTestMixin import SctpFirewallPerfTestMixin
2.21.3 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
On Mon, Jul 27, 2020 at 09:51:24AM +0200, Jan Tluka wrote:
Mon, Jul 27, 2020 at 09:19:12AM CEST, olichtne@redhat.com wrote:
Two comments inline.
On Fri, Jul 24, 2020 at 07:00:47PM +0200, Jan Tluka wrote:
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py new file mode 100644 index 00000000..46963dd2 --- /dev/null +++ b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py @@ -0,0 +1,33 @@ +from lnst.Controller.RecipeResults import ResultLevel +from lnst.Recipes.ENRT.PerfTestMixins import BasePerfTestTweakMixin +from lnst.RecipeCommon.Perf.Measurements.BaseFlowMeasurement import BaseFlowMeasurement
+class SctpFirewallPerfTestMixin(BasePerfTestTweakMixin):
- def _get_flow_measurement_from_config(self, perf_config):
flow_measurements = [ m for m in perf_config.measurements if isinstance(m, BaseFlowMeasurement) ]
return flow_measurements[0]
- def apply_perf_test_tweak(self, perf_config):
super().apply_perf_test_tweak(perf_config)
flow_measurement = self._get_flow_measurement_from_config(perf_config)
flow = flow_measurement.conf[0]
I see you're using [0] here as well as in the previous method, it's probably ok for the current use case of the SCTP tests but what would happen if this was combined with a "multistream" sctp test? Is that still handled?
It depends if the multistream contains a mix of different protocols to test at once. With the current implementation of ENRT recipes this is not possible IMO.
If this comment is just about test of multiple streams of the same protocol, I'm not sure if this work. I'll check that.
No problem, just checking the logic, if it makes sense then no need to adjust anything...
-Ondrej
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/BaseEnrtRecipe.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index f8fafc80..46cc09ea 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -13,6 +13,7 @@ from lnst.Common.Parameters import ( from lnst.Common.IpAddress import AF_INET, AF_INET6
from lnst.Recipes.ENRT.ConfigMixins.BaseSubConfigMixin import BaseSubConfigMixin +from lnst.Recipes.ENRT.PerfTestMixins import SctpFirewallPerfTestMixin
from lnst.RecipeCommon.Ping.Recipe import PingTestAndEvaluate, PingConf from lnst.RecipeCommon.Perf.Recipe import Recipe as PerfRecipe @@ -32,7 +33,8 @@ class EnrtConfiguration(object): """ pass
-class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe): +class BaseEnrtRecipe(SctpFirewallPerfTestMixin, BaseSubConfigMixin, + PingTestAndEvaluate, PerfRecipe): """Base Recipe class for the ENRT recipe package
This class defines the shared *test* method defining the common test @@ -343,7 +345,9 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe): methods to execute, report and evaluate the results. """ for perf_config in self.generate_perf_configurations(recipe_config): + self.apply_perf_test_tweak(perf_config) result = self.perf_test(perf_config) + self.remove_perf_test_tweak(perf_config) self.perf_report_and_evaluate(result)
def generate_ping_configurations(self, config):
On Fri, Jul 24, 2020 at 07:00:48PM +0200, Jan Tluka wrote:
Signed-off-by: Jan Tluka jtluka@redhat.com
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index f8fafc80..46cc09ea 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -13,6 +13,7 @@ from lnst.Common.Parameters import ( from lnst.Common.IpAddress import AF_INET, AF_INET6
from lnst.Recipes.ENRT.ConfigMixins.BaseSubConfigMixin import BaseSubConfigMixin +from lnst.Recipes.ENRT.PerfTestMixins import SctpFirewallPerfTestMixin
from lnst.RecipeCommon.Ping.Recipe import PingTestAndEvaluate, PingConf from lnst.RecipeCommon.Perf.Recipe import Recipe as PerfRecipe @@ -32,7 +33,8 @@ class EnrtConfiguration(object): """ pass
-class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe): +class BaseEnrtRecipe(SctpFirewallPerfTestMixin, BaseSubConfigMixin,
PingTestAndEvaluate, PerfRecipe):
"""Base Recipe class for the ENRT recipe package
This class defines the shared *test* method defining the common test
@@ -343,7 +345,9 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe): methods to execute, report and evaluate the results. """ for perf_config in self.generate_perf_configurations(recipe_config):
self.apply_perf_test_tweak(perf_config) result = self.perf_test(perf_config)
self.remove_perf_test_tweak(perf_config)
This should be in a try-except-finally block, the remove_perf_test_tweak in the "finally" part.
Just in case something crashes during perf_test and throws and exception, let's make sure that we ensure deconfiguration.
-Ondrej
self.perf_report_and_evaluate(result) def generate_ping_configurations(self, config):
-- 2.21.3 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
Mon, Jul 27, 2020 at 09:21:24AM CEST, olichtne@redhat.com wrote:
On Fri, Jul 24, 2020 at 07:00:48PM +0200, Jan Tluka wrote:
Signed-off-by: Jan Tluka jtluka@redhat.com
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index f8fafc80..46cc09ea 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -13,6 +13,7 @@ from lnst.Common.Parameters import ( from lnst.Common.IpAddress import AF_INET, AF_INET6
from lnst.Recipes.ENRT.ConfigMixins.BaseSubConfigMixin import BaseSubConfigMixin +from lnst.Recipes.ENRT.PerfTestMixins import SctpFirewallPerfTestMixin
from lnst.RecipeCommon.Ping.Recipe import PingTestAndEvaluate, PingConf from lnst.RecipeCommon.Perf.Recipe import Recipe as PerfRecipe @@ -32,7 +33,8 @@ class EnrtConfiguration(object): """ pass
-class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe): +class BaseEnrtRecipe(SctpFirewallPerfTestMixin, BaseSubConfigMixin,
PingTestAndEvaluate, PerfRecipe):
"""Base Recipe class for the ENRT recipe package
This class defines the shared *test* method defining the common test
@@ -343,7 +345,9 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe): methods to execute, report and evaluate the results. """ for perf_config in self.generate_perf_configurations(recipe_config):
self.apply_perf_test_tweak(perf_config) result = self.perf_test(perf_config)
self.remove_perf_test_tweak(perf_config)
This should be in a try-except-finally block, the remove_perf_test_tweak in the "finally" part.
Just in case something crashes during perf_test and throws and exception, let's make sure that we ensure deconfiguration.
-Ondrej
Ok, good idea. Will fix this.
self.perf_report_and_evaluate(result) def generate_ping_configurations(self, config):
-- 2.21.3 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
lnst-developers@lists.fedorahosted.org