This change adds tests for IPv4overIPv4 and IPv4overIPv6 scenarios.
Change-Id: I68e0e94538914cf0b03625ee1be3b92684184c78
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
--- /dev/null
+{
+ "input": {
+ "mapping-record": {
+ "recordTtl": 1440,
+ "action": "NoAction",
+ "authoritative": true,
+ "eid": {
+ "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+ "ipv4-prefix": "6.0.2.0/24"
+ },
+ "LocatorRecord": [
+ {
+ "locator-id": "ELP",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": false,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:explicit-locator-path-lcaf",
+ "explicit-locator-path": {
+ "hop": [
+ {
+ "hop-id": "Hop 1",
+ "address": "6.0.3.3",
+ "lrs-bits": "lookup rloc-probe strict"
+ },
+ {
+ "hop-id": "Hop 2",
+ "address": "6.0.3.1",
+ "lrs-bits": "lookup strict"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+}
--- /dev/null
+{
+ "input": {
+ "mapping-record": {
+ "recordTtl": 1440,
+ "action": "NoAction",
+ "authoritative": true,
+ "eid": {
+ "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+ "ipv4-prefix": "6.0.4.0/24"
+ },
+ "LocatorRecord": [
+ {
+ "locator-id": "ELP",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": false,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:explicit-locator-path-lcaf",
+ "explicit-locator-path": {
+ "hop": [
+ {
+ "hop-id": "Hop 1",
+ "address": "6.0.3.3",
+ "lrs-bits": "lookup rloc-probe strict"
+ },
+ {
+ "hop-id": "Hop 2",
+ "address": "6.0.3.2",
+ "lrs-bits": "lookup strict"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+}
--- /dev/null
+{
+ "input": {
+ "mapping-record": {
+ "recordTtl": 1440,
+ "action": "NoAction",
+ "authoritative": true,
+ "eid": {
+ "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+ "ipv4-prefix": "6.0.2.0/24"
+ },
+ "LocatorRecord": [
+ {
+ "locator-id": "ELP",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": false,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:explicit-locator-path-lcaf",
+ "explicit-locator-path": {
+ "hop": [
+ {
+ "hop-id": "Hop 1",
+ "address": "6:0:3::3",
+ "lrs-bits": "lookup rloc-probe strict"
+ },
+ {
+ "hop-id": "Hop 2",
+ "address": "6:0:3::1",
+ "lrs-bits": "lookup strict"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+}
--- /dev/null
+{
+ "input": {
+ "mapping-record": {
+ "recordTtl": 1440,
+ "action": "NoAction",
+ "authoritative": true,
+ "eid": {
+ "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+ "ipv4-prefix": "6.0.4.0/24"
+ },
+ "LocatorRecord": [
+ {
+ "locator-id": "ELP",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": false,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:explicit-locator-path-lcaf",
+ "explicit-locator-path": {
+ "hop": [
+ {
+ "hop-id": "Hop 1",
+ "address": "6:0:3::3",
+ "lrs-bits": "lookup rloc-probe strict"
+ },
+ {
+ "hop-id": "Hop 2",
+ "address": "6:0:3::2",
+ "lrs-bits": "lookup strict"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+}
--- /dev/null
+create host-interface name xtr_rtr2
+set int state host-xtr_rtr2 up
+set int ip address host-xtr_rtr2 6.0.3.3/24
+
+lisp enable
+lisp locator-set add ls1 iface host-xtr_rtr2 p 1 w 1
+lisp pitr ls ls1
+comment { lisp pitr disable }
+lisp remote-mapping deid 6.0.0.0/16 action send-map-request
+lisp map-resolver add 6.0.3.100
--- /dev/null
+create host-interface name vpp1
+set int state host-vpp1 up
+set int ip address host-vpp1 6.0.2.1/24
+create host-interface name xtr_rtr1
+set int state host-xtr_rtr1 up
+set int ip address host-xtr_rtr1 6.0.3.1/24
+
+lisp enable
+
+lisp map-resolver add 6.0.3.100
+lisp locator-set add ls1 iface host-xtr_rtr1 p 1 w 1
+lisp eid-table add eid 6.0.2.0/24 locator-set ls1
--- /dev/null
+create host-interface name vpp2
+set int state host-vpp2 up
+set int ip address host-vpp2 6.0.4.1/24
+create host-interface name xtr_rtr3
+set int state host-xtr_rtr3 up
+set int ip address host-xtr_rtr3 6.0.3.2/24
+
+lisp enable
+
+lisp map-resolver add 6.0.3.100
+lisp locator-set add ls1 iface host-xtr_rtr3 p 1 w 1
+lisp eid-table add eid 6.0.4.0/24 locator-set ls1
--- /dev/null
+create host-interface name xtr_rtr2
+set int state host-xtr_rtr2 up
+set int ip address host-xtr_rtr2 6:0:3::3/64
+
+lisp enable
+lisp locator-set add ls1 iface host-xtr_rtr2 p 1 w 1
+lisp pitr ls ls1
+lisp remote-mapping deid 6.0.0.0/16 action send-map-request
+lisp map-resolver add 6:0:3::100
--- /dev/null
+create host-interface name vpp1
+set int state host-vpp1 up
+set int ip address host-vpp1 6.0.2.1/24
+
+create host-interface name xtr_rtr1
+set int state host-xtr_rtr1 up
+set int ip address host-xtr_rtr1 6:0:3::1/64
+
+lisp enable
+
+lisp map-resolver add 6:0:3::100
+lisp locator-set add ls1 iface host-xtr_rtr1 p 1 w 1
+lisp eid-table add eid 6.0.2.0/24 locator-set ls1
--- /dev/null
+create host-interface name vpp2
+set int state host-vpp2 up
+set int ip address host-vpp2 6.0.4.1/24
+
+create host-interface name xtr_rtr3
+set int state host-xtr_rtr3 up
+set int ip address host-xtr_rtr3 6:0:3::2/64
+
+lisp enable
+
+lisp map-resolver add 6:0:3::100
+lisp locator-set add ls1 iface host-xtr_rtr3 p 1 w 1
+lisp eid-table add eid 6.0.4.0/24 locator-set ls1
--- /dev/null
+ODL_USER="admin"
+ODL_PASSWD="admin"
+ODL_IP="127.0.0.1"
+ODL_PORT="8181"
+
+# path to vpp executable
+VPP_LITE_BIN=/home/vagrant/vpp/build-root/install-vpp_lite_debug-native/vpp/bin/vpp
+
+if [ ! -f "${VPP_LITE_BIN}" ] ; then
+ echo "Error: VPP binary not found. You can set VPP_LITE_BIN in config.sh"
+ echo "Current value:"
+ echo "VPP_LITE_BIN=${VPP_LITE_BIN}"
+ exit 1
+fi
echo " ip4_ip6 - test ip4 and ip6 topology"
echo " 4o6 - test ip4 over ip6"
echo " 6o4 - test ip6 over ip4"
- echo " remote - test statick mapping, whit out ODL"
- echo " remote6 - test statick mapping for IPv6, whit out ODL"
+ echo " remote - test static mapping, without ODL"
+ echo " remote6 - test static mapping for IPv6, without ODL"
exit 0
fi
set -x
-# path to vpp executable and configurations folder
-# VPP_LITE_BIN=/vpp/build-root/install-vpp_lite_debug-native/vpp/bin/vpp
-VPP_LITE_BIN=/home/csit/lisp_vpp/build-root/install-vpp_lite_debug-native/vpp/bin/vpp
VPP_LITE_CONF=`pwd`"/../configs/vpp_lite_config/"
VPP1_CONF="vpp1.conf"
VPP2_CONF="vpp2.conf"
ODL_REPLACE_CONFIG2_6="replace_ipv6_odl2.txt"
ODL_REPLACE_CONFIG2_6o4="replace_ipv6o4_odl2.txt"
-ODL_USER="admin"
-ODL_PASSWD="admin"
-ODL_IP="127.0.0.1"
-ODL_PORT="8181"
-
-function post_curl {
- curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:${1} \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${2}" \
- -u ${ODL_USER}:${ODL_PASSWD}
-}
+source config.sh
+source odl_utils.sh
# make sure there are no vpp instances running
sudo pkill vpp
sudo ip netns del intervppns &> /dev/null
if [ "$1" != "remote" ] && [ "$1" != "remote6" ] ; then
- curl -X DELETE http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database/ \
- -u ${ODL_USER}:${ODL_PASSWD}
+ odl_clear_all
fi
if [ "$1" == "clean" ] ; then
--- /dev/null
+
+function post_curl {
+ echo "Sending mapping from ${2} to ODL; operation: ${1}"
+ until [ "`curl -X POST "http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:${1}" \
+ -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${2}" \
+ -u ${ODL_USER}:${ODL_PASSWD} -s -o /dev/null -w "%{http_code}"`" == "200" ]
+ do
+ echo "Updating failed; trying again.."
+ done
+}
+
+function odl_clear_all {
+ echo "Deleting all ODL mappings.."
+ curl -X DELETE "http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database" \
+ -u ${ODL_USER}:${ODL_PASSWD}
+}
--- /dev/null
+
+source config.sh
+source odl_utils.sh
+source topologies/rtr_single_iface.sh
+
+# set odl config json file names; they are common among all rtr tests
+ODL_CONFIG_FILE1="elp1.json"
+ODL_CONFIG_FILE2="elp2.json"
+
+if [ "$1" == "clean" ] ; then
+ rtr_single_iface_clean
+ exit 0
+fi
+
+if [[ $(id -u) != 0 ]]; then
+ echo "Error: run this as a root."
+ exit 1
+fi
+
+function test_rtr_single_iface {
+ rtr_single_iface_setup
+
+ test_result=1
+
+ ip netns exec vpp-ns1 ping -w 15 -c 1 "${1}"
+ rc=$?
+
+ rtr_single_iface_clean
+
+ if [ $rc -ne 0 ] ; then
+ echo "Test failed: No ICMP response received within specified timeout limit!"
+ else
+ echo "Test passed."
+ test_result=0
+ fi
+
+ exit $test_result
+}
--- /dev/null
+#!/usr/bin/env bash
+
+#
+# Test for VPP LISP RTR functionality (4over4).
+#
+# IMPORTANT: This test needs to have ODL running with following config
+# line in etc/custom.properties:
+# lisp.elpPolicy = replace
+#
+# This test configures a topology of two XTRs and RTR. An ICMP request is
+# sent from host1 behind first TR to the host2 behind the second TR.
+# Both host and underlaying networks are IPv4.
+#
+
+VPP_LITE_CONF=`pwd`"/../configs/vpp_lite_config/rtr_single_iface/4o4"
+ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_single_iface/4o4/"
+
+source test_driver/rtr_single_iface.sh
+
+test_rtr_single_iface "6.0.4.4"
--- /dev/null
+#!/usr/bin/env bash
+
+#
+# Test for VPP LISP RTR functionality (4over6).
+#
+# IMPORTANT: This test needs to have ODL running with following config
+# line in etc/custom.properties:
+# lisp.elpPolicy = replace
+#
+# This test configures a topology of two XTRs and RTR. An ICMP request is
+# sent from host1 behind first TR to the host2 behind the second TR.
+# Hosts resides in IPv4 network, underlying network is IPv6
+#
+
+VPP_LITE_CONF=`pwd`"/../configs/vpp_lite_config/rtr_single_iface/4o6/"
+ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_single_iface/4o6/"
+
+source test_driver/rtr_single_iface.sh
+
+test_rtr_single_iface "6.0.4.4"
--- /dev/null
+#!/usr/bin/env bash
+
+function rtr_single_iface_clean {
+ echo "Clearing all VPP instances.."
+ pkill vpp
+
+ echo "Cleaning RTR topology.."
+ ip netns exec xtr-rtr-ns ifconfig vppbr1 down
+ ip netns exec xtr-rtr-ns brctl delbr vppbr1
+ ip link del dev vpp1 &> /dev/null
+ ip link del dev vpp2 &> /dev/null
+ ip link del dev xtr_rtr1 &> /dev/null
+ ip link del dev xtr_rtr2 &> /dev/null
+ ip link del dev xtr_rtr3 &> /dev/null
+ ip link del dev odl &> /dev/null
+
+ ip netns del vpp-ns1 &> /dev/null
+ ip netns del vpp-ns2 &> /dev/null
+ ip netns del xtr-rtr-ns &> /dev/null
+
+ odl_clear_all
+}
+
+function rtr_single_iface_setup {
+ ip netns add vpp-ns1
+ ip netns add vpp-ns2
+ ip netns add xtr-rtr-ns
+
+ ip link add veth_xtr_rtr1 type veth peer name xtr_rtr1
+ ip link add veth_xtr_rtr2 type veth peer name xtr_rtr2
+ ip link add veth_xtr_rtr3 type veth peer name xtr_rtr3
+ ip link add veth_odl type veth peer name odl
+ ip link set dev xtr_rtr1 up
+ ip link set dev xtr_rtr2 up
+ ip link set dev xtr_rtr3 up
+ ip link set dev odl up
+
+ ip link set dev veth_xtr_rtr1 up netns xtr-rtr-ns
+ ip link set dev veth_xtr_rtr2 up netns xtr-rtr-ns
+ ip link set dev veth_xtr_rtr3 up netns xtr-rtr-ns
+ ip link set dev veth_odl up netns xtr-rtr-ns
+
+ ip netns exec xtr-rtr-ns brctl addbr vppbr1
+ ip netns exec xtr-rtr-ns brctl addif vppbr1 veth_xtr_rtr1
+ ip netns exec xtr-rtr-ns brctl addif vppbr1 veth_xtr_rtr2
+ ip netns exec xtr-rtr-ns brctl addif vppbr1 veth_xtr_rtr3
+ ip netns exec xtr-rtr-ns brctl addif vppbr1 veth_odl
+ ip netns exec xtr-rtr-ns ifconfig vppbr1 up
+
+ ip link add veth_vpp1 type veth peer name vpp1
+ ip link set dev vpp1 up
+ ip link set dev veth_vpp1 up netns vpp-ns1
+
+ ip netns exec vpp-ns1 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.2.2/24 dev veth_vpp1
+ ip route add 6.0.4.0/24 via 6.0.2.1
+ "
+
+ ip link add veth_vpp2 type veth peer name vpp2
+ ip link set dev vpp2 up
+ ip link set dev veth_vpp2 up netns vpp-ns2
+
+ ip netns exec vpp-ns2 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.4.4/24 dev veth_vpp2
+ ip route add 6.0.2.0/24 via 6.0.4.1
+ "
+
+ ip addr add 6.0.3.100/24 dev odl
+ ip addr add 6:0:3::100/64 dev odl
+ ethtool --offload odl rx off tx off
+
+ ${VPP_LITE_BIN} \
+ unix { log /tmp/vpp1.log cli-listen \
+ localhost:5002 full-coredump \
+ exec ${VPP_LITE_CONF}/vpp1.config } \
+ api-trace { on } chroot {prefix xtr1}
+
+ ${VPP_LITE_BIN} \
+ unix { log /tmp/vpp2.log cli-listen \
+ localhost:5003 full-coredump \
+ exec ${VPP_LITE_CONF}/vpp2.config } \
+ api-trace { on } chroot {prefix xtr2}
+
+ ${VPP_LITE_BIN} \
+ unix { log /tmp/rtr.log cli-listen \
+ localhost:5004 full-coredump \
+ exec ${VPP_LITE_CONF}/rtr.config } \
+ api-trace { on } chroot {prefix rtr}
+
+ post_curl "add-mapping" ${ODL_CONFIG_FILE1}
+ post_curl "add-mapping" ${ODL_CONFIG_FILE2}
+}