Tue, Aug 21, 2018 at 02:11:10PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe PingFloodRecipe, implementing old regression_tests/phase1/ping_flood.xml. Its PingFloodRecipe class is an immediate subclass of BaseRecipe. It is almost identical to examples/python_recipe.py.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Recipes/ENRT/PingFloodRecipe.py | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lnst/Recipes/ENRT/PingFloodRecipe.py
diff --git a/lnst/Recipes/ENRT/PingFloodRecipe.py b/lnst/Recipes/ENRT/PingFloodRecipe.py new file mode 100644 index 0000000..05be74d --- /dev/null +++ b/lnst/Recipes/ENRT/PingFloodRecipe.py @@ -0,0 +1,33 @@ +#!/bin/python2 +""" +Implements scenario similar to regression_tests/phase1/ +(ping_flood.xml + simple_ping.py) +"""
+from lnst.Common.Parameters import Param +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq, BaseRecipe +from lnst.Tests import Ping
+class PingFloodRecipe(BaseRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- def test(self):
#m1, m2 = self.matched.m1, self.matched.m2
^^^^ this should not be commented out, right?
self.matched.m1.eth0.ip_add(ipaddress("192.168.1.1/24"))self.matched.m2.eth0.ip_add(ipaddress("192.168.1.2/24"))if "mtu" in self.params:self.matched.m1.eth0.mtu = self.params.mtuself.matched.m2.eth0.mtu = self.params.mtuself.matched.m1.eth0.up()self.matched.m2.eth0.up()ping_job = self.matched.m1.run(Ping(dst=self.matched.m2.eth0.ips[0], interval=0,interface=self.matched.m1.eth0))
I think we want interval=0.2 as the original test. Also the original test used count=100 and with the above we would do only count defined by default value of 10.
-Jan