Add test for the no-cache multicast router notification. The test sends one
packets to the multicast router, while it doesn't have any MFC routes and
validates that a no-cache mroute notification is sent.
Signed-off-by: Yotam Gigi <yotamg(a)mellanox.com>
---
recipes/switchdev/mr-001-nocache.py | 55 ++++++++++++++++++++++++++++++++++++
recipes/switchdev/mr-001-nocache.xml | 5 ++++
2 files changed, 60 insertions(+)
create mode 100644 recipes/switchdev/mr-001-nocache.py
create mode 100644 recipes/switchdev/mr-001-nocache.xml
diff --git a/recipes/switchdev/mr-001-nocache.py b/recipes/switchdev/mr-001-nocache.py
new file mode 100644
index 0000000..123d8db
--- /dev/null
+++ b/recipes/switchdev/mr-001-nocache.py
@@ -0,0 +1,55 @@
+"""
+Copyright 2017 Mellanox Technologies. All rights reserved.
+Licensed under the GNU General Public License, version 2 as
+published by the Free Software Foundation; see COPYING for details.
+"""
+
+__author__ = """
+yotamg(a)mellanox.com (Yotam Gigi)
+"""
+
+from lnst.Controller.Task import ctl
+from lnst.Common.Consts import MROUTE
+from TestLib import TestLib
+from time import sleep
+from mr_common import MrouteTest
+
+def mcgrp(num):
+ return "239.255.%d.%d" % (num/0x100, num%0x100)
+
+def do_task(ctl, hosts, ifaces, aliases):
+ m1, m2, sw = hosts
+ m1_if1, m1_if2, m2_if1, m2_if2, m2_if3, m2_if4, sw_if1, \
+ sw_br_m1, sw_br_m2, sw_if3, sw_if4, sw_if5, sw_if2 = ifaces
+
+ sw_ports = [sw_if1, sw_if2, sw_if3, sw_if4, sw_if5]
+
+ tl = TestLib(ctl, aliases)
+ mt = MrouteTest(tl, hosts, ifaces)
+
+ sleep(30)
+ mt.init()
+
+ mt.add_vif(sw_if1, 0)
+ mt.send_mc_traffic(mcgrp(1), m1_if1, 1)
+ tl.expect_mr_notif(sw, MROUTE.NOTIF_NOCACHE, m1_if1.get_ip(0), 0, mcgrp(1))
+
+ mt.fini()
+
+do_task(ctl, [ctl.get_host("machine1"),
+ ctl.get_host("machine2"),
+ ctl.get_host("switch")],
+ [ctl.get_host("machine1").get_interface("if1"),
+ ctl.get_host("machine1").get_interface("if2"),
+ ctl.get_host("machine2").get_interface("if1"),
+ ctl.get_host("machine2").get_interface("if2"),
+ ctl.get_host("machine2").get_interface("if3"),
+ ctl.get_host("machine2").get_interface("if4"),
+ ctl.get_host("switch").get_interface("if1"),
+ ctl.get_host("switch").get_interface("if2"),
+ ctl.get_host("switch").get_interface("if3"),
+ ctl.get_host("switch").get_interface("if4"),
+ ctl.get_host("switch").get_interface("if5"),
+ ctl.get_host("switch").get_interface("if6"),
+ ctl.get_host("switch").get_interface("br0")],
+ ctl.get_aliases())
diff --git a/recipes/switchdev/mr-001-nocache.xml b/recipes/switchdev/mr-001-nocache.xml
new file mode 100644
index 0000000..6128072
--- /dev/null
+++ b/recipes/switchdev/mr-001-nocache.xml
@@ -0,0 +1,5 @@
+<lnstrecipe
xmlns:xi="http://www.w3.org/2003/XInclude">
+ <xi:include href="default_aliases.xml" />
+ <xi:include href="mr_common_topology.xml" />
+ <task python="mr-001-nocache.py" />
+</lnstrecipe>
--
2.8.4