Add negative mapping test 02/5002/1
authorFilip Tehlar <ftehlar@cisco.com>
Thu, 2 Feb 2017 12:24:32 +0000 (13:24 +0100)
committerFilip Tehlar <ftehlar@cisco.com>
Thu, 2 Feb 2017 12:24:32 +0000 (13:24 +0100)
Change-Id: Ica2a26210003e8ef07e0a57fa55ea144c942700c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
tests/data_plane/configs/vpp_lite_config/basic/4o4_neg_mapping/vpp1.config [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/basic/4o4_neg_mapping/vpp2.config [new file with mode: 0644]
tests/data_plane/vpp_lite_topo/test_driver/basic_no_odl.sh
tests/data_plane/vpp_lite_topo/tests/test_negative_mapping_4o4.sh [new file with mode: 0755]

diff --git a/tests/data_plane/configs/vpp_lite_config/basic/4o4_neg_mapping/vpp1.config b/tests/data_plane/configs/vpp_lite_config/basic/4o4_neg_mapping/vpp1.config
new file mode 100644 (file)
index 0000000..0842541
--- /dev/null
@@ -0,0 +1,7 @@
+create_host_iface vpp1 6.0.1.1/24
+create_host_iface intervpp1 6.0.3.1/24
+
+lisp_state enable
+lisp_locator_set_with_locator ls1 host-intervpp1 1 1
+lisp_local_eid eid 6.0.1.0/24 locator-set ls1
+lisp_remote_mapping eid 6.0.2.0/24 action drop
diff --git a/tests/data_plane/configs/vpp_lite_config/basic/4o4_neg_mapping/vpp2.config b/tests/data_plane/configs/vpp_lite_config/basic/4o4_neg_mapping/vpp2.config
new file mode 100644 (file)
index 0000000..a5e22ce
--- /dev/null
@@ -0,0 +1,7 @@
+create_host_iface vpp2 6.0.2.1/24
+create_host_iface intervpp2 6.0.3.2/24
+
+lisp_state enable
+lisp_locator_set_with_locator ls1 host-intervpp2 1 1
+lisp_local_eid eid 6.0.2.0/24 locator-set ls1
+lisp_remote_mapping eid 6.0.1.0/24 rloc 6.0.3.1
index aab2adb..8a1ac51 100644 (file)
@@ -63,3 +63,24 @@ function test_basic_no_odl
   exit $test_result
 }
 
+function test_negative_mapping
+{
+  2_node_topo_setup no_odl
+  maybe_pause
+
+  test_result=1
+
+  ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
+  rc=$?
+
+  # test done
+  2_node_topo_clean no_odl
+  if [ $rc -eq 0 ] ; then
+    echo "Test failed!"
+  else
+    echo "Test passed."
+    test_result=0
+  fi
+
+  exit $test_result
+}
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_negative_mapping_4o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_negative_mapping_4o4.sh
new file mode 100755 (executable)
index 0000000..5d5c90a
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+# Test negative mapping
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/basic/4o4_neg_mapping
+
+source test_driver/basic_no_odl.sh
+
+test_negative_mapping ping "6.0.2.2"