From a37b38ab5a1b00e1253bfb9db7996049d43ca6b3 Mon Sep 17 00:00:00 2001
From: gpotter2 <gabriel@potter.fr>
Date: Wed, 27 Sep 2017 15:32:35 +0200
Subject: [PATCH] Add sndrcvloop tests

---
 test/regression.uts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/test/regression.uts b/test/regression.uts
index 825e45f0..4ac869ee 100644
--- a/test/regression.uts
+++ b/test/regression.uts
@@ -730,6 +730,24 @@ assert x[IP].ottl() in [32, 64, 128, 255]
 assert 0 <= x[IP].hops() <= 126
 x is not None and ICMP in x and x[ICMP].type == 0
 
+= Sending and receiving an ICMP with flooding methods
+~ netaccess IP ICMP
+# flooding methods do not support timeout. Packing the test for security
+def _test_flood():
+    old_debug_dissector = conf.debug_dissector
+    conf.debug_dissector = False
+    x = sr1flood(IP(dst="www.google.com")/ICMP())
+    conf.debug_dissector = old_debug_dissector
+    x
+    assert x[IP].ottl() in [32, 64, 128, 255]
+    assert 0 <= x[IP].hops() <= 126
+    x is not None and ICMP in x and x[ICMP].type == 0
+
+t = Thread(target=_test_flood)
+t.start()
+t.join(3)
+assert not t.is_alive()
+
 = Sending and receiving an ICMPv6EchoRequest
 ~ netaccess ipv6
 old_debug_dissector = conf.debug_dissector
-- 
GitLab