Add tests for disjoint locators use cases 77/1577/1
authorFlorin Coras <fcoras@cisco.com>
Wed, 15 Jun 2016 17:57:48 +0000 (19:57 +0200)
committerFlorin Coras <fcoras@cisco.com>
Wed, 15 Jun 2016 17:57:48 +0000 (19:57 +0200)
Change-Id: I2046bf0785bb0024d1b2e099d55da7fbefd70fc0
Signed-off-by: Florin Coras <fcoras@cisco.com>
20 files changed:
tests/data_plane/configs/odl/rtr_two_iface/4o4/elp1.json [new file with mode: 0644]
tests/data_plane/configs/odl/rtr_two_iface/4o4/elp2.json [new file with mode: 0644]
tests/data_plane/configs/odl/rtr_two_iface/4o6/elp1.json [new file with mode: 0644]
tests/data_plane/configs/odl/rtr_two_iface/4o6/elp2.json [new file with mode: 0644]
tests/data_plane/configs/odl/rtr_two_iface/mixed/elp1.json [new file with mode: 0644]
tests/data_plane/configs/odl/rtr_two_iface/mixed/elp2.json [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o4/rtr.config [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o4/vpp1.config [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o4/vpp2.config [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o6/rtr.config [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o6/vpp1.config [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o6/vpp2.config [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/rtr_two_iface/mixed/rtr.config [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/rtr_two_iface/mixed/vpp1.config [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/rtr_two_iface/mixed/vpp2.config [new file with mode: 0644]
tests/data_plane/vpp_lite_topo/test_driver/rtr_two_iface.sh [new file with mode: 0644]
tests/data_plane/vpp_lite_topo/test_rtr_two_iface_4o4.sh [new file with mode: 0755]
tests/data_plane/vpp_lite_topo/test_rtr_two_iface_4o6.sh [new file with mode: 0755]
tests/data_plane/vpp_lite_topo/test_rtr_two_iface_mixed.sh [new file with mode: 0755]
tests/data_plane/vpp_lite_topo/topologies/rtr_two_iface.sh [new file with mode: 0644]

diff --git a/tests/data_plane/configs/odl/rtr_two_iface/4o4/elp1.json b/tests/data_plane/configs/odl/rtr_two_iface/4o4/elp1.json
new file mode 100644 (file)
index 0000000..6dff66f
--- /dev/null
@@ -0,0 +1,42 @@
+{
+    "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": true,
+                    "rloc": {
+                        "address-type": "ietf-lisp-address-types:explicit-locator-path-lcaf",
+                        "explicit-locator-path": {
+                            "hop": [
+                                {
+                                    "hop-id": "Hop 1",
+                                    "address": "6.0.5.2",
+                                    "lrs-bits": "lookup rloc-probe strict"
+                                },
+                                {
+                                    "hop-id": "Hop 2",
+                                    "address": "6.0.3.1",
+                                    "lrs-bits": "lookup strict"
+                                }
+                            ]
+                        }
+                    }
+                }
+            ]
+        }
+    }
+}
diff --git a/tests/data_plane/configs/odl/rtr_two_iface/4o4/elp2.json b/tests/data_plane/configs/odl/rtr_two_iface/4o4/elp2.json
new file mode 100644 (file)
index 0000000..64c0b78
--- /dev/null
@@ -0,0 +1,42 @@
+{
+    "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.2",
+                                    "lrs-bits": "lookup rloc-probe strict"
+                                },
+                                {
+                                    "hop-id": "Hop 2",
+                                    "address": "6.0.5.1",
+                                    "lrs-bits": "lookup strict"
+                                }
+                            ]
+                        }
+                    }
+                }
+            ]
+        }
+    }
+}
diff --git a/tests/data_plane/configs/odl/rtr_two_iface/4o6/elp1.json b/tests/data_plane/configs/odl/rtr_two_iface/4o6/elp1.json
new file mode 100644 (file)
index 0000000..5d8d581
--- /dev/null
@@ -0,0 +1,42 @@
+{
+    "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": true,
+                    "rloc": {
+                        "address-type": "ietf-lisp-address-types:explicit-locator-path-lcaf",
+                        "explicit-locator-path": {
+                            "hop": [
+                                {
+                                    "hop-id": "Hop 1",
+                                    "address": "6:0:5::2",
+                                    "lrs-bits": "lookup rloc-probe strict"
+                                },
+                                {
+                                    "hop-id": "Hop 2",
+                                    "address": "6:0:3::1",
+                                    "lrs-bits": "lookup strict"
+                                }
+                            ]
+                        }
+                    }
+                }
+            ]
+        }
+    }
+}
diff --git a/tests/data_plane/configs/odl/rtr_two_iface/4o6/elp2.json b/tests/data_plane/configs/odl/rtr_two_iface/4o6/elp2.json
new file mode 100644 (file)
index 0000000..e4336e4
--- /dev/null
@@ -0,0 +1,42 @@
+{
+    "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::2",
+                                    "lrs-bits": "lookup rloc-probe strict"
+                                },
+                                {
+                                    "hop-id": "Hop 2",
+                                    "address": "6:0:5::1",
+                                    "lrs-bits": "lookup strict"
+                                }
+                            ]
+                        }
+                    }
+                }
+            ]
+        }
+    }
+}
diff --git a/tests/data_plane/configs/odl/rtr_two_iface/mixed/elp1.json b/tests/data_plane/configs/odl/rtr_two_iface/mixed/elp1.json
new file mode 100644 (file)
index 0000000..7696f59
--- /dev/null
@@ -0,0 +1,42 @@
+{
+    "input": {
+        "mapping-record": {
+            "recordTtl": 1440,
+            "action": "NoAction",
+            "authoritative": true,
+            "eid": {
+                "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+                "ipv6-prefix": "6:0:2::0/64"
+            },
+            "LocatorRecord": [
+                {
+                    "locator-id": "ELP",
+                    "priority": 1,
+                    "weight": 1,
+                    "multicastPriority": 255,
+                    "multicastWeight": 0,
+                    "localLocator": true,
+                    "rlocProbed": false,
+                    "routed": true,
+                    "rloc": {
+                        "address-type": "ietf-lisp-address-types:explicit-locator-path-lcaf",
+                        "explicit-locator-path": {
+                            "hop": [
+                                {
+                                    "hop-id": "Hop 1",
+                                    "address": "6:0:5::2",
+                                    "lrs-bits": "lookup rloc-probe strict"
+                                },
+                                {
+                                    "hop-id": "Hop 2",
+                                    "address": "6.0.3.1",
+                                    "lrs-bits": "lookup strict"
+                                }
+                            ]
+                        }
+                    }
+                }
+            ]
+        }
+    }
+}
diff --git a/tests/data_plane/configs/odl/rtr_two_iface/mixed/elp2.json b/tests/data_plane/configs/odl/rtr_two_iface/mixed/elp2.json
new file mode 100644 (file)
index 0000000..a043715
--- /dev/null
@@ -0,0 +1,42 @@
+{
+    "input": {
+        "mapping-record": {
+            "recordTtl": 1440,
+            "action": "NoAction",
+            "authoritative": true,
+            "eid": {
+                "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+                "ipv6-prefix": "6:0:4::0/64"
+            },
+            "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.2",
+                                    "lrs-bits": "lookup rloc-probe strict"
+                                },
+                                {
+                                    "hop-id": "Hop 2",
+                                    "address": "6:0:5::1",
+                                    "lrs-bits": "lookup strict"
+                                }
+                            ]
+                        }
+                    }
+                }
+            ]
+        }
+    }
+}
diff --git a/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o4/rtr.config b/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o4/rtr.config
new file mode 100644 (file)
index 0000000..480f3d5
--- /dev/null
@@ -0,0 +1,15 @@
+create host-interface name rtr_vpp1
+set int state host-rtr_vpp1 up
+set int ip address host-rtr_vpp1 6.0.3.2/24
+
+create host-interface name rtr_vpp2
+set int state host-rtr_vpp2 up
+set int ip address host-rtr_vpp2 6.0.5.2/24
+
+lisp enable
+
+lisp locator-set add ls1 iface host-rtr_vpp1 p 1 w 1 iface host-rtr_vpp2 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
diff --git a/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o4/vpp1.config b/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o4/vpp1.config
new file mode 100644 (file)
index 0000000..6608b9b
--- /dev/null
@@ -0,0 +1,14 @@
+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 vpp1_rtr
+set int state host-vpp1_rtr up
+set int ip address host-vpp1_rtr 6.0.3.1/24
+
+lisp enable
+
+lisp map-resolver add 6.0.3.100
+lisp locator-set add ls1 iface host-vpp1_rtr p 1 w 1
+lisp eid-table add eid 6.0.2.0/24 locator-set ls1
+
+comment {ip route add 6.0.5.0/24 via 6.0.3.1}
diff --git a/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o4/vpp2.config b/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o4/vpp2.config
new file mode 100644 (file)
index 0000000..304f011
--- /dev/null
@@ -0,0 +1,14 @@
+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 vpp2_rtr
+set int state host-vpp2_rtr up
+set int ip address host-vpp2_rtr 6.0.5.1/24
+
+lisp enable
+
+lisp map-resolver add 6.0.5.100
+lisp locator-set add ls1 iface host-vpp2_rtr p 1 w 1
+lisp eid-table add eid 6.0.4.0/24 locator-set ls1
+
+comment {ip route add 6.0.3.0/24 via 6.0.5.1}
diff --git a/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o6/rtr.config b/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o6/rtr.config
new file mode 100644 (file)
index 0000000..46a9037
--- /dev/null
@@ -0,0 +1,15 @@
+create host-interface name rtr_vpp1
+set int state host-rtr_vpp1 up
+set int ip address host-rtr_vpp1 6:0:3::2/64
+
+create host-interface name rtr_vpp2
+set int state host-rtr_vpp2 up
+set int ip address host-rtr_vpp2 6:0:5::2/64
+
+lisp enable
+
+lisp locator-set add ls1 iface host-rtr_vpp1 p 1 w 1 iface host-rtr_vpp2 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
diff --git a/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o6/vpp1.config b/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o6/vpp1.config
new file mode 100644 (file)
index 0000000..b2c523b
--- /dev/null
@@ -0,0 +1,12 @@
+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 vpp1_rtr
+set int state host-vpp1_rtr up
+set int ip address host-vpp1_rtr 6:0:3::1/64
+
+lisp enable
+
+lisp map-resolver add 6:0:3::100
+lisp locator-set add ls1 iface host-vpp1_rtr p 1 w 1
+lisp eid-table add eid 6.0.2.0/24 locator-set ls1
diff --git a/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o6/vpp2.config b/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/4o6/vpp2.config
new file mode 100644 (file)
index 0000000..27d58b5
--- /dev/null
@@ -0,0 +1,12 @@
+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 vpp2_rtr
+set int state host-vpp2_rtr up
+set int ip address host-vpp2_rtr 6:0:5::1/64
+
+lisp enable
+
+lisp map-resolver add 6:0:5::100
+lisp locator-set add ls1 iface host-vpp2_rtr p 1 w 1
+lisp eid-table add eid 6.0.4.0/24 locator-set ls1
diff --git a/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/mixed/rtr.config b/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/mixed/rtr.config
new file mode 100644 (file)
index 0000000..02953d0
--- /dev/null
@@ -0,0 +1,15 @@
+create host-interface name rtr_vpp1
+set int state host-rtr_vpp1 up
+set int ip address host-rtr_vpp1 6.0.3.2/24
+
+create host-interface name rtr_vpp2
+set int state host-rtr_vpp2 up
+set int ip address host-rtr_vpp2 6:0:5::2/64
+
+lisp enable
+
+lisp locator-set add ls1 iface host-rtr_vpp1 p 1 w 1 iface host-rtr_vpp2 p 1 w 1
+lisp pitr ls ls1
+comment { lisp pitr disable }
+lisp remote-mapping deid 6:0:0::0/32 action send-map-request
+lisp map-resolver add 6.0.3.100
diff --git a/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/mixed/vpp1.config b/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/mixed/vpp1.config
new file mode 100644 (file)
index 0000000..72e460b
--- /dev/null
@@ -0,0 +1,12 @@
+create host-interface name vpp1
+set int state host-vpp1 up
+set int ip address host-vpp1 6:0:2::1/64
+create host-interface name vpp1_rtr
+set int state host-vpp1_rtr up
+set int ip address host-vpp1_rtr 6.0.3.1/24
+
+lisp enable
+
+lisp map-resolver add 6.0.3.100
+lisp locator-set add ls1 iface host-vpp1_rtr p 1 w 1
+lisp eid-table add eid 6:0:2::0/64 locator-set ls1
diff --git a/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/mixed/vpp2.config b/tests/data_plane/configs/vpp_lite_config/rtr_two_iface/mixed/vpp2.config
new file mode 100644 (file)
index 0000000..eddefba
--- /dev/null
@@ -0,0 +1,12 @@
+create host-interface name vpp2
+set int state host-vpp2 up
+set int ip address host-vpp2 6:0:4::1/64
+create host-interface name vpp2_rtr
+set int state host-vpp2_rtr up
+set int ip address host-vpp2_rtr 6:0:5::1/64
+
+lisp enable
+
+lisp map-resolver add 6:0:5::100
+lisp locator-set add ls1 iface host-vpp2_rtr p 1 w 1
+lisp eid-table add eid 6:0:4::0/64 locator-set ls1
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/rtr_two_iface.sh b/tests/data_plane/vpp_lite_topo/test_driver/rtr_two_iface.sh
new file mode 100644 (file)
index 0000000..ea5aa2c
--- /dev/null
@@ -0,0 +1,57 @@
+source config.sh
+source odl_utils.sh
+source topologies/rtr_two_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_two_iface_clean
+  exit 0
+fi
+
+if [[ $(id -u) != 0 ]]; then
+  echo "Error: run this as a root."
+  exit 1
+fi
+
+function test_rtr_two_iface {
+  rtr_two_iface_setup
+
+  if [ "$2" == "wait" ] ; then
+    read -p  "press any key to continue .." -n1
+  fi
+
+  test_result=1
+  rc=0
+
+  if [ "$1" != "${1#*[0-9].[0-9]}" ]; then
+    ip netns exec vpp1-ns ping -w 15 -c 1 "${1}"
+    rc=$?
+  elif [ "$1" != "${1#*:[0-9a-fA-F]}" ]; then
+    ip netns exec vpp1-ns ping6 -w 15 -c 1 "${1}"
+    rc=$?
+  else
+    echo "Unrecognized IP format '$1'"
+  fi
+
+  #ip netns exec vpp1-ns ping -w 15 -c 1 "${1}"
+  #rc=$?
+
+  if [ "$2" == "wait" ] ; then
+    read -p  "press any key to continue .." -n1
+  fi
+
+  rtr_two_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
+}
diff --git a/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_4o4.sh b/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_4o4.sh
new file mode 100755 (executable)
index 0000000..c45bb3f
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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_two_iface/4o4"
+ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_two_iface/4o4/"
+
+source test_driver/rtr_two_iface.sh
+
+test_rtr_two_iface "6.0.4.4"
diff --git a/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_4o6.sh b/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_4o6.sh
new file mode 100755 (executable)
index 0000000..0d7015b
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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_two_iface/4o6"
+ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_two_iface/4o6/"
+
+source test_driver/rtr_two_iface.sh
+
+test_rtr_two_iface "6.0.4.4"
diff --git a/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_mixed.sh b/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_mixed.sh
new file mode 100755 (executable)
index 0000000..8c16d68
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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_two_iface/mixed"
+ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_two_iface/mixed/"
+
+source test_driver/rtr_two_iface.sh
+
+test_rtr_two_iface "6:0:4::4" wait
diff --git a/tests/data_plane/vpp_lite_topo/topologies/rtr_two_iface.sh b/tests/data_plane/vpp_lite_topo/topologies/rtr_two_iface.sh
new file mode 100644 (file)
index 0000000..9f5d856
--- /dev/null
@@ -0,0 +1,134 @@
+#!/usr/bin/env bash
+
+function rtr_two_iface_clean {
+  echo "Clearing all VPP instances.."
+  pkill vpp --signal 9
+
+  rm /dev/shm/*
+
+  echo "Cleaning RTR topology.."
+  ip netns exec vpp1-rtr-ns ifconfig vppbr1 down
+  ip netns exec vpp1-rtr-ns brctl delbr vppbr1
+  ip netns exec vpp2-rtr-ns ifconfig vppbr2 down
+  ip netns exec vpp2-rtr-ns brctl delbr vppbr2
+  ip link del dev vpp1 &> /dev/null
+  ip link del dev vpp2 &> /dev/null
+  ip link del dev vpp1_rtr &> /dev/null
+  ip link del dev rtr1_vpp1 &> /dev/null
+  ip link del dev vpp2_rtr &> /dev/null
+  ip link del dev rtr_vpp2 &> /dev/null
+  ip link del dev odl_vpp1 &> /dev/null
+  ip link del dev odl_vpp2 &> /dev/null
+
+  ip netns del vpp1-ns &> /dev/null
+  ip netns del vpp2-ns &> /dev/null
+  ip netns del vpp1-rtr-ns &> /dev/null
+  ip netns del vpp2-rtr-ns &> /dev/null
+
+  odl_clear_all
+}
+
+function rtr_two_iface_setup {
+  # create namespaces
+  ip netns add vpp1-ns
+  ip netns add vpp2-ns
+  ip netns add vpp1-rtr-ns
+  ip netns add vpp2-rtr-ns
+
+  # create pair interfaces between vpp[1|2], rtr and odl
+  ip link add veth_vpp1_rtr type veth peer name vpp1_rtr
+  ip link add veth_rtr_vpp1 type veth peer name rtr_vpp1
+  ip link add veth_vpp2_rtr type veth peer name vpp2_rtr
+  ip link add veth_rtr_vpp2 type veth peer name rtr_vpp2
+  ip link add veth_odl_vpp1 type veth peer name odl_vpp1
+  ip link add veth_odl_vpp2 type veth peer name odl_vpp2
+
+  # enable peer interfaces
+  ip link set dev vpp1_rtr up
+  ip link set dev rtr_vpp1 up
+  ip link set dev vpp2_rtr up
+  ip link set dev rtr_vpp2 up
+  ip link set dev odl_vpp1 up
+  ip link set dev odl_vpp2 up
+
+  # enable veth interfaces and set them in the appropriate ip ns
+  ip link set dev veth_vpp1_rtr up netns vpp1-rtr-ns
+  ip link set dev veth_rtr_vpp1 up netns vpp1-rtr-ns
+  ip link set dev veth_vpp2_rtr up netns vpp2-rtr-ns
+  ip link set dev veth_rtr_vpp2 up netns vpp2-rtr-ns
+  ip link set dev veth_odl_vpp1 up netns vpp1-rtr-ns
+  ip link set dev veth_odl_vpp2 up netns vpp2-rtr-ns
+
+  # vpp1, rtr and odl
+  ip netns exec vpp1-rtr-ns brctl addbr vppbr1
+  ip netns exec vpp1-rtr-ns brctl addif vppbr1 veth_vpp1_rtr
+  ip netns exec vpp1-rtr-ns brctl addif vppbr1 veth_rtr_vpp1
+  ip netns exec vpp1-rtr-ns brctl addif vppbr1 veth_odl_vpp1
+  ip netns exec vpp1-rtr-ns ifconfig vppbr1 up
+
+  # vpp2, rtr and odl
+  ip netns exec vpp2-rtr-ns brctl addbr vppbr2
+  ip netns exec vpp2-rtr-ns brctl addif vppbr2 veth_vpp2_rtr
+  ip netns exec vpp2-rtr-ns brctl addif vppbr2 veth_rtr_vpp2
+  ip netns exec vpp2-rtr-ns brctl addif vppbr2 veth_odl_vpp2
+  ip netns exec vpp2-rtr-ns ifconfig vppbr2 up
+
+  # vpp1 to client
+  ip link add veth_vpp1 type veth peer name vpp1
+  ip link set dev vpp1 up
+  ip link set dev veth_vpp1 up netns vpp1-ns
+
+  ip netns exec vpp1-ns \
+    bash -c "
+      ip link set dev lo up
+      ip addr add 6.0.2.2/24 dev veth_vpp1
+      ip addr add 6:0:2::2/64 dev veth_vpp1
+      ip route add 6.0.4.0/24 via 6.0.2.1
+      ip route add 6:0:4::0/64 via 6:0:2::1
+  "
+
+  # vpp2 to client
+  ip link add veth_vpp2 type veth peer name vpp2
+  ip link set dev vpp2 up
+  ip link set dev veth_vpp2 up netns vpp2-ns
+
+  ip netns exec vpp2-ns \
+    bash -c "
+      ip link set dev lo up
+      ip addr add 6.0.4.4/24 dev veth_vpp2
+      ip addr add 6:0:4::4/64 dev veth_vpp2
+      ip route add 6.0.2.0/24 via 6.0.4.1
+      ip route add 6:0:2::0/64 via 6:0:4::1
+  "
+
+  # vpp1 to odl
+  ip addr add 6.0.3.100/24 dev odl_vpp1
+  ip addr add 6:0:3::100/64 dev odl_vpp1
+  ethtool --offload  odl_vpp1 rx off tx off
+
+  # vpp2 to odl
+  ip addr add 6.0.5.100/24 dev odl_vpp2
+  ip addr add 6:0:5::100/64 dev odl_vpp2
+  ethtool --offload  odl_vpp2 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 } api-segment {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 } api-segment {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 } api-segment {prefix rtr}
+
+  post_curl "add-mapping" ${ODL_CONFIG_FILE1}
+  post_curl "add-mapping" ${ODL_CONFIG_FILE2}
+}