On Tue, May 04, 2021 at 11:21:12AM +0200, Jan Tluka wrote:
Some of the recipes inheriting from the BaseTunnelRecipe may not
require
packet assert test. This could be solved by not including the
PacketAssertTestAndEvaluate in the BaseTunnelRecipe inheritance but I plan
to send additional tests that use the packet assert test and it's
probably better to add a condition to execute the test.
"some tunnel recipes don't require packet assert testing"
is this because of the legacy recipe implementation - it wasn't
implemented in legacy so let's not do it here?
Or is there a more techincal reason? e.g. L2TP tunnel cannot be detected
by packet assert?
I wondering if it would maybe make sense to include packet assert test
for all tunnel recipes regardless of if we did this in legacy?
-Ondrej
The BaseTunnelRecipe is modified to perform the packet assert test only
if the get_packet_assert_config() of the derived class returns anything
other than None value.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/BaseTunnelRecipe.py | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/lnst/Recipes/ENRT/BaseTunnelRecipe.py
b/lnst/Recipes/ENRT/BaseTunnelRecipe.py
index 4a354a9d..d4bb6962 100644
--- a/lnst/Recipes/ENRT/BaseTunnelRecipe.py
+++ b/lnst/Recipes/ENRT/BaseTunnelRecipe.py
@@ -111,11 +111,15 @@ class BaseTunnelRecipe(
def ping_test(self, ping_configs):
pa_config = self.get_packet_assert_config(ping_configs[0])
- self.packet_assert_test_start(pa_config)
- self.ctl.wait(2)
+ if pa_config is not None:
+ self.packet_assert_test_start(pa_config)
+ self.ctl.wait(2)
ping_result = super().ping_test(ping_configs)
- self.ctl.wait(2)
- pa_result = self.packet_assert_test_stop()
+ if pa_config is not None:
+ self.ctl.wait(2)
+ pa_result = self.packet_assert_test_stop()
+ else:
+ pa_result = None
result = ((ping_result, pa_config, pa_result),)
@@ -124,7 +128,8 @@ class BaseTunnelRecipe(
def ping_report_and_evaluate(self, results):
for res in results:
super().ping_report_and_evaluate(res[0])
- self.packet_assert_evaluate_and_report(res[1], res[2])
+ if res[1] is not None:
+ self.packet_assert_evaluate_and_report(res[1], res[2])
def get_packet_assert_config(self, ping_config):
"""
--
2.26.3
_______________________________________________
LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
To unsubscribe send an email to lnst-developers-leave(a)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.fedora...
Do not reply to spam on the list, report it:
https://pagure.io/fedora-infrastructure