summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrej Kozemcak <akozemca@cisco.com>2016-05-16 15:46:18 +0200
committerAndrej Kozemcak <akozemca@cisco.com>2016-05-16 16:02:33 +0200
commit46e4b31a8a57e9af1be2cdbc0c67c153ec9cd9b3 (patch)
treeae02fa95391cce269f16a97730fe5989a90cbab2
parent676362e1714afe4e7bb1557828580e710670b602 (diff)
Add new test for IP4 over IP6 and IP6 over IP4
Change-Id: Icc411c22f041c447d595cb158102675f4055a7de Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
-rw-r--r--tests/data_plane/configs/odl/add_ipv4o6_odl1.txt29
-rw-r--r--tests/data_plane/configs/odl/add_ipv4o6_odl2.txt29
-rw-r--r--tests/data_plane/configs/odl/add_ipv6_odl1.txt2
-rw-r--r--tests/data_plane/configs/odl/add_ipv6_odl2.txt2
-rw-r--r--tests/data_plane/configs/odl/add_ipv6o4_odl1.txt29
-rw-r--r--tests/data_plane/configs/odl/add_ipv6o4_odl2.txt29
-rw-r--r--tests/data_plane/configs/odl/replace_ipv4o6_odl2.txt29
-rw-r--r--tests/data_plane/configs/odl/replace_ipv6_odl2.txt2
-rw-r--r--tests/data_plane/configs/odl/replace_ipv6o4_odl2.txt29
-rw-r--r--tests/data_plane/configs/vpp_csit_config/vpp1_4o6.conf9
-rw-r--r--tests/data_plane/configs/vpp_csit_config/vpp1_6.conf2
-rw-r--r--tests/data_plane/configs/vpp_csit_config/vpp1_6o4.conf9
-rw-r--r--tests/data_plane/configs/vpp_csit_config/vpp2_4o6.conf9
-rw-r--r--tests/data_plane/configs/vpp_csit_config/vpp2_6o4.conf9
-rw-r--r--tests/data_plane/configs/vpp_csit_config/vpp2_reconf_4o6.conf3
-rw-r--r--tests/data_plane/configs/vpp_csit_config/vpp2_reconf_6o4.conf3
-rw-r--r--tests/data_plane/configs/vpp_lite_config/vpp1_4o6.conf13
-rw-r--r--tests/data_plane/configs/vpp_lite_config/vpp1_6o4.conf13
-rw-r--r--tests/data_plane/configs/vpp_lite_config/vpp2_4o6.conf13
-rw-r--r--tests/data_plane/configs/vpp_lite_config/vpp2_6o4.conf13
-rw-r--r--tests/data_plane/csit_topo/README8
-rw-r--r--tests/data_plane/csit_topo/lisp_ip4.sh16
-rw-r--r--tests/data_plane/csit_topo/lisp_ip4o6.sh39
-rw-r--r--tests/data_plane/csit_topo/lisp_ip6.sh12
-rw-r--r--tests/data_plane/csit_topo/lisp_ip6o4.sh39
-rwxr-xr-xtests/data_plane/csit_topo/lisp_test.sh41
-rw-r--r--tests/data_plane/vpp_lite_topo/README8
-rw-r--r--tests/data_plane/vpp_lite_topo/lisp_ip4.sh12
-rw-r--r--tests/data_plane/vpp_lite_topo/lisp_ip4o6.sh41
-rw-r--r--tests/data_plane/vpp_lite_topo/lisp_ip6.sh12
-rw-r--r--tests/data_plane/vpp_lite_topo/lisp_ip6o4.sh41
-rwxr-xr-xtests/data_plane/vpp_lite_topo/lisp_test.sh48
32 files changed, 544 insertions, 49 deletions
diff --git a/tests/data_plane/configs/odl/add_ipv4o6_odl1.txt b/tests/data_plane/configs/odl/add_ipv4o6_odl1.txt
new file mode 100644
index 0000000..69729df
--- /dev/null
+++ b/tests/data_plane/configs/odl/add_ipv4o6_odl1.txt
@@ -0,0 +1,29 @@
+{
+ "input": {
+ "mapping-record": {
+ "recordTtl": 1440,
+ "action": "NoAction",
+ "authoritative": true,
+ "eid": {
+ "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+ "ipv4-prefix": "6.0.1.0/24"
+ },
+ "LocatorRecord": [
+ {
+ "locator-id": "ISP1",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": true,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:ipv6-afi",
+ "ipv6": "6:0:3::1"
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/data_plane/configs/odl/add_ipv4o6_odl2.txt b/tests/data_plane/configs/odl/add_ipv4o6_odl2.txt
new file mode 100644
index 0000000..3d17a33
--- /dev/null
+++ b/tests/data_plane/configs/odl/add_ipv4o6_odl2.txt
@@ -0,0 +1,29 @@
+{
+ "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": "ISP1",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": true,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:ipv6-afi",
+ "ipv6": "6:0:3::2"
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/data_plane/configs/odl/add_ipv6_odl1.txt b/tests/data_plane/configs/odl/add_ipv6_odl1.txt
index a367262..3af329b 100644
--- a/tests/data_plane/configs/odl/add_ipv6_odl1.txt
+++ b/tests/data_plane/configs/odl/add_ipv6_odl1.txt
@@ -6,7 +6,7 @@
"authoritative": true,
"eid": {
"address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
- "ipv6-prefix": "6:0:1::0/48"
+ "ipv6-prefix": "6:0:1::0/64"
},
"LocatorRecord": [
{
diff --git a/tests/data_plane/configs/odl/add_ipv6_odl2.txt b/tests/data_plane/configs/odl/add_ipv6_odl2.txt
index 3f5afd7..fcc6ecd 100644
--- a/tests/data_plane/configs/odl/add_ipv6_odl2.txt
+++ b/tests/data_plane/configs/odl/add_ipv6_odl2.txt
@@ -6,7 +6,7 @@
"authoritative": true,
"eid": {
"address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
- "ipv6-prefix": "6:0:2::0/48"
+ "ipv6-prefix": "6:0:2::0/64"
},
"LocatorRecord": [
{
diff --git a/tests/data_plane/configs/odl/add_ipv6o4_odl1.txt b/tests/data_plane/configs/odl/add_ipv6o4_odl1.txt
new file mode 100644
index 0000000..f4cb476
--- /dev/null
+++ b/tests/data_plane/configs/odl/add_ipv6o4_odl1.txt
@@ -0,0 +1,29 @@
+{
+ "input": {
+ "mapping-record": {
+ "recordTtl": 1440,
+ "action": "NoAction",
+ "authoritative": true,
+ "eid": {
+ "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+ "ipv6-prefix": "6:0:1::0/64"
+ },
+ "LocatorRecord": [
+ {
+ "locator-id": "ISP1",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": true,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:ipv4-afi",
+ "ipv4": "6.0.3.1"
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/data_plane/configs/odl/add_ipv6o4_odl2.txt b/tests/data_plane/configs/odl/add_ipv6o4_odl2.txt
new file mode 100644
index 0000000..52f2125
--- /dev/null
+++ b/tests/data_plane/configs/odl/add_ipv6o4_odl2.txt
@@ -0,0 +1,29 @@
+{
+ "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": "ISP1",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": true,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:ipv4-afi",
+ "ipv4": "6.0.3.2"
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/data_plane/configs/odl/replace_ipv4o6_odl2.txt b/tests/data_plane/configs/odl/replace_ipv4o6_odl2.txt
new file mode 100644
index 0000000..9b6ba62
--- /dev/null
+++ b/tests/data_plane/configs/odl/replace_ipv4o6_odl2.txt
@@ -0,0 +1,29 @@
+{
+ "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": "ISP1",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": true,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:ipv6-afi",
+ "ipv6": "6:0:3::20"
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/data_plane/configs/odl/replace_ipv6_odl2.txt b/tests/data_plane/configs/odl/replace_ipv6_odl2.txt
index e61d6fc..6cd17a8 100644
--- a/tests/data_plane/configs/odl/replace_ipv6_odl2.txt
+++ b/tests/data_plane/configs/odl/replace_ipv6_odl2.txt
@@ -6,7 +6,7 @@
"authoritative": true,
"eid": {
"address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
- "ipv6-prefix": "6:0:2::0/48"
+ "ipv6-prefix": "6:0:2::0/64"
},
"LocatorRecord": [
{
diff --git a/tests/data_plane/configs/odl/replace_ipv6o4_odl2.txt b/tests/data_plane/configs/odl/replace_ipv6o4_odl2.txt
new file mode 100644
index 0000000..e8a8cfd
--- /dev/null
+++ b/tests/data_plane/configs/odl/replace_ipv6o4_odl2.txt
@@ -0,0 +1,29 @@
+{
+ "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": "ISP1",
+ "priority": 1,
+ "weight": 1,
+ "multicastPriority": 255,
+ "multicastWeight": 0,
+ "localLocator": true,
+ "rlocProbed": false,
+ "routed": true,
+ "rloc": {
+ "address-type": "ietf-lisp-address-types:ipv4-afi",
+ "ipv4": "6.0.3.20"
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp1_4o6.conf b/tests/data_plane/configs/vpp_csit_config/vpp1_4o6.conf
new file mode 100644
index 0000000..1592c68
--- /dev/null
+++ b/tests/data_plane/configs/vpp_csit_config/vpp1_4o6.conf
@@ -0,0 +1,9 @@
+exec set int ip address GigabitEthernet0/9/0 6.0.1.1/24
+exec set int state GigabitEthernet0/9/0 up
+exec set int ip address GigabitEthernet0/a/0 6:0:3::1/64
+exec set int state GigabitEthernet0/a/0 up
+lisp_gpe_enable_disable enable
+lisp_add_del_map_resolver 6:0:3::100
+lisp_add_del_locator_set locator-set ls1
+lisp_add_del_locator locator-set ls1 iface GigabitEthernet0/a/0 p 1 w 2
+lisp_add_del_local_eid eid 6.0.1.0/24 locator-set ls1
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp1_6.conf b/tests/data_plane/configs/vpp_csit_config/vpp1_6.conf
index d14acc4..0d7dcf3 100644
--- a/tests/data_plane/configs/vpp_csit_config/vpp1_6.conf
+++ b/tests/data_plane/configs/vpp_csit_config/vpp1_6.conf
@@ -7,4 +7,4 @@ lisp_enable_disable enable
lisp_add_del_map_resolver 6:0:3::100
lisp_add_del_locator_set locator-set ls1
lisp_add_del_locator locator-set ls1 iface GigabitEthernet0/a/0 p 1 w 2
-lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1 \ No newline at end of file
+lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp1_6o4.conf b/tests/data_plane/configs/vpp_csit_config/vpp1_6o4.conf
new file mode 100644
index 0000000..2f411c8
--- /dev/null
+++ b/tests/data_plane/configs/vpp_csit_config/vpp1_6o4.conf
@@ -0,0 +1,9 @@
+exec set int ip address GigabitEthernet0/9/0 6:0:1::1/64
+exec set int state GigabitEthernet0/9/0 up
+exec set int ip address GigabitEthernet0/a/0 6.0.3.1/24
+exec set int state GigabitEthernet0/a/0 up
+lisp_gpe_enable_disable enable
+lisp_add_del_map_resolver 6.0.3.100
+lisp_add_del_locator_set locator-set ls1
+lisp_add_del_locator locator-set ls1 iface GigabitEthernet0/a/0 p 1 w 2
+lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp2_4o6.conf b/tests/data_plane/configs/vpp_csit_config/vpp2_4o6.conf
new file mode 100644
index 0000000..de94f4b
--- /dev/null
+++ b/tests/data_plane/configs/vpp_csit_config/vpp2_4o6.conf
@@ -0,0 +1,9 @@
+exec set int ip address GigabitEthernet0/9/0 6.0.2.1/24
+exec set int state GigabitEthernet0/9/0 up
+exec set int ip address GigabitEthernet0/a/0 6:0:3::2/64
+exec set int state GigabitEthernet0/a/0 up
+lisp_gpe_enable_disable enable
+lisp_add_del_map_resolver 6:0:3::100
+lisp_add_del_locator_set locator-set ls1
+lisp_add_del_locator locator-set ls1 iface GigabitEthernet0/a/0 p 1 w 2
+lisp_add_del_local_eid eid 6.0.2.0/24 locator-set ls1
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp2_6o4.conf b/tests/data_plane/configs/vpp_csit_config/vpp2_6o4.conf
new file mode 100644
index 0000000..db581f8
--- /dev/null
+++ b/tests/data_plane/configs/vpp_csit_config/vpp2_6o4.conf
@@ -0,0 +1,9 @@
+exec set int ip address GigabitEthernet0/9/0 6:0:2::1/64
+exec set int state GigabitEthernet0/9/0 up
+exec set int ip address GigabitEthernet0/a/0 6.0.3.2/24
+exec set int state GigabitEthernet0/a/0 up
+lisp_gpe_enable_disable enable
+lisp_add_del_map_resolver 6.0.3.100
+lisp_add_del_locator_set locator-set ls1
+lisp_add_del_locator locator-set ls1 iface GigabitEthernet0/a/0 p 1 w 2
+lisp_add_del_local_eid eid 6:0:2::0/64 locator-set ls1
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp2_reconf_4o6.conf b/tests/data_plane/configs/vpp_csit_config/vpp2_reconf_4o6.conf
new file mode 100644
index 0000000..3f37a61
--- /dev/null
+++ b/tests/data_plane/configs/vpp_csit_config/vpp2_reconf_4o6.conf
@@ -0,0 +1,3 @@
+exec set int ip address del GigabitEthernet0/a/0 6:0:3::2/64
+exec set int ip address GigabitEthernet0/a/0 6:0:3::20/64
+exec set int state GigabitEthernet0/a/0 up \ No newline at end of file
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp2_reconf_6o4.conf b/tests/data_plane/configs/vpp_csit_config/vpp2_reconf_6o4.conf
new file mode 100644
index 0000000..fec4070
--- /dev/null
+++ b/tests/data_plane/configs/vpp_csit_config/vpp2_reconf_6o4.conf
@@ -0,0 +1,3 @@
+exec set int ip address del GigabitEthernet0/a/0 6.0.3.2/24
+exec set int ip address GigabitEthernet0/a/0 6.0.3.20/24
+exec set int state GigabitEthernet0/a/0 up \ No newline at end of file
diff --git a/tests/data_plane/configs/vpp_lite_config/vpp1_4o6.conf b/tests/data_plane/configs/vpp_lite_config/vpp1_4o6.conf
new file mode 100644
index 0000000..248eca4
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/vpp1_4o6.conf
@@ -0,0 +1,13 @@
+create host-interface name vpp1
+set int state host-vpp1 up
+set int ip address host-vpp1 6.0.1.1/24
+
+create host-interface name intervpp1
+set int state host-intervpp1 up
+set int ip address host-intervpp1 6:0:3::1/64
+
+lisp enable
+
+lisp locator-set add ls1 iface host-intervpp1 p 1 w 1
+lisp eid-table add eid 6.0.1.0/24 locator-set ls1
+lisp map-resolver add 6:0:3::100
diff --git a/tests/data_plane/configs/vpp_lite_config/vpp1_6o4.conf b/tests/data_plane/configs/vpp_lite_config/vpp1_6o4.conf
new file mode 100644
index 0000000..d4788c2
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/vpp1_6o4.conf
@@ -0,0 +1,13 @@
+create host-interface name vpp1
+set int state host-vpp1 up
+set int ip address host-vpp1 6:0:1::1/64
+
+create host-interface name intervpp1
+set int state host-intervpp1 up
+set int ip address host-intervpp1 6.0.3.1/24
+
+lisp enable
+
+lisp locator-set add ls1 iface host-intervpp1 p 1 w 1
+lisp eid-table add eid 6:0:1::0/64 locator-set ls1
+lisp map-resolver add 6.0.3.100
diff --git a/tests/data_plane/configs/vpp_lite_config/vpp2_4o6.conf b/tests/data_plane/configs/vpp_lite_config/vpp2_4o6.conf
new file mode 100644
index 0000000..5f248ad
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/vpp2_4o6.conf
@@ -0,0 +1,13 @@
+create host-interface name vpp2
+set int state host-vpp2 up
+set int ip address host-vpp2 6.0.2.1/24
+
+create host-interface name intervpp2
+set int state host-intervpp2 up
+set int ip address host-intervpp2 6:0:3::2/64
+
+lisp enable
+
+lisp locator-set add ls1 iface host-intervpp2 p 1 w 1
+lisp eid-table add eid 6.0.2.0/24 locator-set ls1
+lisp map-resolver add 6:0:3::100
diff --git a/tests/data_plane/configs/vpp_lite_config/vpp2_6o4.conf b/tests/data_plane/configs/vpp_lite_config/vpp2_6o4.conf
new file mode 100644
index 0000000..cbfa148
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/vpp2_6o4.conf
@@ -0,0 +1,13 @@
+create host-interface name vpp2
+set int state host-vpp2 up
+set int ip address host-vpp2 6:0:2::1/64
+
+create host-interface name intervpp2
+set int state host-intervpp2 up
+set int ip address host-intervpp2 6.0.3.2/24
+
+lisp enable
+
+lisp locator-set add ls1 iface host-intervpp2 p 1 w 1
+lisp eid-table add eid 6:0:2::0/64 locator-set ls1
+lisp map-resolver add 6.0.3.100
diff --git a/tests/data_plane/csit_topo/README b/tests/data_plane/csit_topo/README
index 6d2f10d..a6fde3f 100644
--- a/tests/data_plane/csit_topo/README
+++ b/tests/data_plane/csit_topo/README
@@ -6,4 +6,10 @@
./lisp_test ip6
# Test ip4 and ip6 topology
-./lisp_test all
+./lisp_test ip4_ip6
+
+# Test ip4 over ip6
+./lisp_test 4o6
+
+# Test ip6 over ip4
+./lisp_test 6o4
diff --git a/tests/data_plane/csit_topo/lisp_ip4.sh b/tests/data_plane/csit_topo/lisp_ip4.sh
index 55c8a91..8d96165 100644
--- a/tests/data_plane/csit_topo/lisp_ip4.sh
+++ b/tests/data_plane/csit_topo/lisp_ip4.sh
@@ -11,15 +11,11 @@ function ping_lisp {
fi
}
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG1}" \
- -u ${ODL_USER}:${ODL_PASSWD}
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG2}" \
- -u ${ODL_USER}:${ODL_PASSWD}
+post_curl "add-mapping" ${ODL_ADD_CONFIG1}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2}
-rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1.conf
-rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2.conf
ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1.conf"
ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2.conf"
@@ -38,8 +34,6 @@ rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_r
ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf.conf"
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:update-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_REPLACE_CONFIG2}" \
- -u ${ODL_USER}:${ODL_PASSWD}
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2}
ping_lisp
diff --git a/tests/data_plane/csit_topo/lisp_ip4o6.sh b/tests/data_plane/csit_topo/lisp_ip4o6.sh
new file mode 100644
index 0000000..3cafb6e
--- /dev/null
+++ b/tests/data_plane/csit_topo/lisp_ip4o6.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+function ping_lisp {
+ local RESULTS
+ RESULTS=$(ssh_tg "ping -c 10 6.0.2.2")
+ if [ $? -ne 0 ] ; then
+ echo "Can not ping other machine"
+ ssh_vpp1 "sudo rm -r ${TMP_DIR}"
+ ssh_vpp2 "sudo rm -r ${TMP_DIR}"
+ exit -1
+ fi
+}
+
+post_curl "add-mapping" ${ODL_ADD_CONFIG1_4o6}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2_4o6}
+
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1_4o6} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2_4o6} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2.conf
+
+ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1.conf"
+ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2.conf"
+
+ssh_tg "sudo ip addr add 6.0.1.2/24 dev ${TG_INT1}"
+ssh_tg "sudo ip link set ${TG_INT1} up"
+ssh_tg "sudo ip route add 6.0.2.0/24 via 6.0.1.1"
+ssh_tg "sudo ip netns exec net2 ip addr add 6.0.2.2/24 dev ${TG_INT2}"
+ssh_tg "sudo ip netns exec net2 ip link set lo up"
+ssh_tg "sudo ip netns exec net2 ip link set ${TG_INT2} up"
+ssh_tg "sudo ip netns exec net2 ip route add 6.0.1.0/24 via 6.0.2.1"
+
+ping_lisp
+
+rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2_4o6} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf.conf
+
+ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf.conf"
+
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2_4o6}
+
+ping_lisp
diff --git a/tests/data_plane/csit_topo/lisp_ip6.sh b/tests/data_plane/csit_topo/lisp_ip6.sh
index eb0c172..20f0381 100644
--- a/tests/data_plane/csit_topo/lisp_ip6.sh
+++ b/tests/data_plane/csit_topo/lisp_ip6.sh
@@ -11,12 +11,8 @@ function ping_lisp6 {
fi
}
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG1_6}" \
- -u ${ODL_USER}:${ODL_PASSWD}
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG2_6}" \
- -u ${ODL_USER}:${ODL_PASSWD}
+post_curl "add-mapping" ${ODL_ADD_CONFIG1_6}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2_6}
rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1_6} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_6.conf
rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2_6} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_6.conf
@@ -38,8 +34,6 @@ rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2_6} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2
ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf_6.conf"
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:update-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_REPLACE_CONFIG2_6}" \
- -u ${ODL_USER}:${ODL_PASSWD}
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2_6}
ping_lisp6
diff --git a/tests/data_plane/csit_topo/lisp_ip6o4.sh b/tests/data_plane/csit_topo/lisp_ip6o4.sh
new file mode 100644
index 0000000..4e620f7
--- /dev/null
+++ b/tests/data_plane/csit_topo/lisp_ip6o4.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+function ping_lisp6 {
+ local RESULTS
+ RESULTS=$(ssh_tg "ping6 -c 10 6:0:2::2")
+ if [ $? -ne 0 ] ; then
+ echo "Can not ping other machine"
+ ssh_vpp1 "sudo rm -r ${TMP_DIR}"
+ ssh_vpp2 "sudo rm -r ${TMP_DIR}"
+ exit -1
+ fi
+}
+
+post_curl "add-mapping" ${ODL_ADD_CONFIG1_6o4}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2_6o4}
+
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1_6o4} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_6.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2_6o4} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_6.conf
+
+ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1_6.conf"
+ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_6.conf"
+
+ssh_tg "sudo ip addr add 6:0:1::2/64 dev ${TG_INT1}"
+ssh_tg "sudo ip link set ${TG_INT1} up"
+ssh_tg "sudo ip route add 6:0:2::0/64 via 6:0:1::1 || exit 0"
+ssh_tg "sudo ip netns exec net2 ip addr add 6:0:2::2/64 dev ${TG_INT2}"
+ssh_tg "sudo ip netns exec net2 ip link set lo up"
+ssh_tg "sudo ip netns exec net2 ip link set ${TG_INT2} up"
+ssh_tg "sudo ip netns exec net2 ip route add 6:0:1::/64 via 6:0:2::1"
+
+ping_lisp6
+
+rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2_6o4} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf_6.conf
+
+ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf_6.conf"
+
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2_6o4}
+
+ping_lisp6
diff --git a/tests/data_plane/csit_topo/lisp_test.sh b/tests/data_plane/csit_topo/lisp_test.sh
index 303b6fc..06ea7fb 100755
--- a/tests/data_plane/csit_topo/lisp_test.sh
+++ b/tests/data_plane/csit_topo/lisp_test.sh
@@ -18,6 +18,16 @@
# | |
# +------+
+if [ "$1" == "-h" ] || [ "$1" == "-help" ] ; then
+ echo "lisp_test.sh [ip4] [ip6] [ip4_ip6] [4o6] [6o4]"
+ echo " ip4 - test ip4 topology"
+ echo " ip6 - test ip6 topology"
+ echo " ip4_ip6 - test ip4 and ip6 topology"
+ echo " 4o6 - test ip4 over ip6"
+ echo " 6o4 - test ip6 over ip4"
+ exit 0
+fi
+
set -x
USER="csit"
@@ -35,18 +45,30 @@ ODL_M_USER="user"
ODL_INT="eth2"
VPP_CONFIG_DIR="../configs/vpp_csit_config/"
VPP_CONFIG1="vpp1.conf"
+VPP_CONFIG1_4o6="vpp1_4o6.conf"
VPP_CONFIG1_6="vpp1_6.conf"
+VPP_CONFIG1_6o4="vpp1_6o4.conf"
VPP_CONFIG2="vpp2.conf"
+VPP_CONFIG2_4o6="vpp2_4o6.conf"
VPP_CONFIG2_6="vpp2_6.conf"
+VPP_CONFIG2_6o4="vpp2_6o4.conf"
VPP_RECONF2="vpp2_reconf.conf"
VPP_RECONF2_6="vpp2_reconf_6.conf"
+VPP_RECONF2_4o6="vpp2_reconf_4o6.conf"
+VPP_RECONF2_6o4="vpp2_reconf_6o4.conf"
ODL_CONFIG_DIR="../configs/odl/"
ODL_ADD_CONFIG1="add_ipv4_odl1.txt"
+ODL_ADD_CONFIG1_4o6="add_ipv4o6_odl1.txt"
ODL_ADD_CONFIG1_6="add_ipv6_odl1.txt"
+ODL_ADD_CONFIG1_6o4="add_ipv6o4_odl1.txt"
ODL_ADD_CONFIG2="add_ipv4_odl2.txt"
+ODL_ADD_CONFIG2_4o6="add_ipv4o6_odl2.txt"
ODL_ADD_CONFIG2_6="add_ipv6_odl2.txt"
+ODL_ADD_CONFIG2_6o4="add_ipv6o4_odl2.txt"
ODL_REPLACE_CONFIG2="replace_ipv4_odl2.txt"
ODL_REPLACE_CONFIG2_6="replace_ipv6_odl2.txt"
+ODL_REPLACE_CONFIG2_4o6="replace_ipv4o6_odl2.txt"
+ODL_REPLACE_CONFIG2_6o4="replace_ipv6o4_odl2.txt"
function ssh_vpp1 {
ssh ${USER}@${VPP1_IP} ${@} || exit
@@ -64,7 +86,14 @@ function ssh_odl {
ssh ${ODL_M_USER}@${ODL_IP} ${@} || exit
}
-curl -X DELETE http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database/ -u ${ODL_USER}:${ODL_PASSWD}
+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}
+}
+
+curl -X DELETE http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database/ \
+ -u ${ODL_USER}:${ODL_PASSWD}
ssh_tg "sudo ip netns del net2 &> /dev/null || exit 0"
ssh_tg "sudo ip addr flush dev ${TG_INT1} &> /dev/null || exit 0"
@@ -97,7 +126,15 @@ if [ "$1" == "ip6" ] ; then
source lisp_ip6.sh
fi
-if [ "$1" == "all" ] ; then
+if [ "$1" == "4o6" ] ; then
+ source lisp_ip4o6.sh
+fi
+
+if [ "$1" == "6o4" ] ; then
+ source lisp_ip6o4.sh
+fi
+
+if [ "$1" == "ip4_ip6" ] ; then
source lisp_ip4.sh
source lisp_ip6.sh
diff --git a/tests/data_plane/vpp_lite_topo/README b/tests/data_plane/vpp_lite_topo/README
index a7ab39e..1b526c9 100644
--- a/tests/data_plane/vpp_lite_topo/README
+++ b/tests/data_plane/vpp_lite_topo/README
@@ -12,4 +12,10 @@ Please before use, set variable VPP_LITE_BIN to your vpp_lite in file lisp_test.
./lisp_test ip6
# Test ip4 and ip6 topology
-./lisp_test all
+./lisp_test ip4_ip6
+
+# Test ip4 over ip6
+./lisp_test 4o6
+
+# Test ip6 over ip4
+./lisp_test 6o4
diff --git a/tests/data_plane/vpp_lite_topo/lisp_ip4.sh b/tests/data_plane/vpp_lite_topo/lisp_ip4.sh
index f817a96..a03b0cb 100644
--- a/tests/data_plane/vpp_lite_topo/lisp_ip4.sh
+++ b/tests/data_plane/vpp_lite_topo/lisp_ip4.sh
@@ -22,12 +22,8 @@ sudo ip netns exec vppns2 \
ip route add 6.0.1.0/24 via 6.0.2.1
"
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG1}" \
- -u ${ODL_USER}:${ODL_PASSWD}
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG2}" \
- -u ${ODL_USER}:${ODL_PASSWD}
+post_curl "add-mapping" ${ODL_ADD_CONFIG1}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2}
ping_lisp
@@ -40,8 +36,6 @@ send "set int ip address host-intervpp2 6.0.3.20/24\r"
expect -re ".*>"
EOF
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:update-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_REPLACE_CONFIG2}" \
- -u ${ODL_USER}:${ODL_PASSWD}
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2}
ping_lisp
diff --git a/tests/data_plane/vpp_lite_topo/lisp_ip4o6.sh b/tests/data_plane/vpp_lite_topo/lisp_ip4o6.sh
new file mode 100644
index 0000000..edc3ffa
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/lisp_ip4o6.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+function ping_lisp {
+ sudo ip netns exec vppns1 ping -c 15 6.0.2.2
+ if [ $? -ne 0 ] ; then
+ echo "Can not ping other machine"
+ exit -1
+ fi
+}
+
+sudo ip netns exec vppns1 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.1.2/24 dev veth_vpp1
+ ip route add 6.0.2.0/24 via 6.0.1.1
+"
+
+sudo ip netns exec vppns2 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.2.2/24 dev veth_vpp2
+ ip route add 6.0.1.0/24 via 6.0.2.1
+"
+
+post_curl "add-mapping" ${ODL_ADD_CONFIG1_4o6}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2_4o6}
+
+ping_lisp
+
+expect << EOF
+spawn telnet localhost 5003
+expect -re ".*>"
+send "set int ip address del host-intervpp2 6:0:3::2/64\r"
+expect -re ".*>"
+send "set int ip address host-intervpp2 6:0:3::20/64\r"
+expect -re ".*>"
+EOF
+
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2_4o6}
+
+ping_lisp
diff --git a/tests/data_plane/vpp_lite_topo/lisp_ip6.sh b/tests/data_plane/vpp_lite_topo/lisp_ip6.sh
index c49ecbf..103f113 100644
--- a/tests/data_plane/vpp_lite_topo/lisp_ip6.sh
+++ b/tests/data_plane/vpp_lite_topo/lisp_ip6.sh
@@ -22,12 +22,8 @@ sudo ip netns exec vppns2 \
ip route add 6:0:1::0/64 via 6:0:2::1
"
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG1_6}" \
- -u ${ODL_USER}:${ODL_PASSWD}
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG2_6}" \
- -u ${ODL_USER}:${ODL_PASSWD}
+post_curl "add-mapping" ${ODL_ADD_CONFIG1_6}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2_6}
ping_lisp6
@@ -40,8 +36,6 @@ send "set int ip address host-intervpp2 6:0:3::20/64\r"
expect -re ".*>"
EOF
-curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:update-mapping \
- -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_REPLACE_CONFIG2_6}" \
- -u ${ODL_USER}:${ODL_PASSWD}
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2_6}
ping_lisp6
diff --git a/tests/data_plane/vpp_lite_topo/lisp_ip6o4.sh b/tests/data_plane/vpp_lite_topo/lisp_ip6o4.sh
new file mode 100644
index 0000000..3da810e
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/lisp_ip6o4.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+function ping_lisp6 {
+ sudo ip netns exec vppns1 ping6 -c 15 6:0:2::2
+ if [ $? -ne 0 ] ; then
+ echo "Can not ping other machine"
+ exit -1
+ fi
+}
+
+sudo ip netns exec vppns1 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6:0:1::2/64 dev veth_vpp1
+ ip route add 6:0:2::0/64 via 6:0:1::1
+"
+
+sudo ip netns exec vppns2 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6:0:2::2/64 dev veth_vpp2
+ ip route add 6:0:1::0/64 via 6:0:2::1
+"
+
+post_curl "add-mapping" ${ODL_ADD_CONFIG1_6o4}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2_6o4}
+
+ping_lisp6
+
+expect << EOF
+spawn telnet localhost 5003
+expect -re ".*>"
+send "set int ip address del host-intervpp2 6.0.3.2/24\r"
+expect -re ".*>"
+send "set int ip address host-intervpp2 6.0.3.20/24\r"
+expect -re ".*>"
+EOF
+
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2_6o4}
+
+ping_lisp6
diff --git a/tests/data_plane/vpp_lite_topo/lisp_test.sh b/tests/data_plane/vpp_lite_topo/lisp_test.sh
index 9d33283..9e3070e 100755
--- a/tests/data_plane/vpp_lite_topo/lisp_test.sh
+++ b/tests/data_plane/vpp_lite_topo/lisp_test.sh
@@ -1,5 +1,15 @@
#!/usr/bin/env bash
+if [ "$1" == "-h" ] || [ "$1" == "-help" ] ; then
+ echo "lisp_test.sh [ip4] [ip6] [ip4_ip6] [4o6] [6o4]"
+ echo " ip4 - test ip4 topology"
+ echo " ip6 - test ip6 topology"
+ echo " ip4_ip6 - test ip4 and ip6 topology"
+ echo " 4o6 - test ip4 over ip6"
+ echo " 6o4 - test ip6 over ip4"
+ exit 0
+fi
+
set -x
# path to vpp executable and configurations folder
@@ -10,17 +20,29 @@ VPP1_CONF="vpp1.conf"
VPP2_CONF="vpp2.conf"
ODL_CONFIG_DIR="../configs/odl/"
ODL_ADD_CONFIG1="add_ipv4_odl1.txt"
+ODL_ADD_CONFIG1_4o6="add_ipv4o6_odl1.txt"
ODL_ADD_CONFIG1_6="add_ipv6_odl1.txt"
+ODL_ADD_CONFIG1_6o4="add_ipv6o4_odl1.txt"
ODL_ADD_CONFIG2="add_ipv4_odl2.txt"
+ODL_ADD_CONFIG2_4o6="add_ipv4o6_odl2.txt"
ODL_ADD_CONFIG2_6="add_ipv6_odl2.txt"
+ODL_ADD_CONFIG2_6o4="add_ipv6o4_odl2.txt"
ODL_REPLACE_CONFIG2="replace_ipv4_odl2.txt"
+ODL_REPLACE_CONFIG2_4o6="replace_ipv4o6_odl2.txt"
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}
+}
+
# make sure there are no vpp instances running
sudo pkill vpp
@@ -36,6 +58,9 @@ sudo ip netns del vppns1 &> /dev/null
sudo ip netns del vppns2 &> /dev/null
sudo ip netns del intervppns &> /dev/null
+curl -X DELETE http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database/ \
+ -u ${ODL_USER}:${ODL_PASSWD}
+
if [ "$1" == "clean" ] ; then
exit 0;
fi
@@ -83,11 +108,21 @@ if [ "$1" == "ip6" ] ; then
VPP2_CONF="vpp2_6.conf"
fi
-if [ "$1" == "all" ] ; then
+if [ "$1" == "ip4_ip6" ] ; then
VPP1_CONF="vpp1_ip4_6.conf"
VPP2_CONF="vpp2_ip4_6.conf"
fi
+if [ "$1" == "4o6" ] ; then
+ VPP1_CONF="vpp1_4o6.conf"
+ VPP2_CONF="vpp2_4o6.conf"
+fi
+
+if [ "$1" == "6o4" ] ; then
+ VPP1_CONF="vpp1_6o4.conf"
+ VPP2_CONF="vpp2_6o4.conf"
+fi
+
# start vpp1 and vpp2 in separate chroot
sudo $VPP_LITE_BIN \
unix { log /tmp/vpp1.log cli-listen \
@@ -110,7 +145,7 @@ if [ "$1" == "ip6" ] ; then
source lisp_ip6.sh
fi
-if [ "$1" == "all" ] ; then
+if [ "$1" == "ip4_ip6" ] ; then
source lisp_ip4.sh
source lisp_ip6.sh
@@ -118,5 +153,12 @@ if [ "$1" == "all" ] ; then
ping_lisp6
fi
-echo "Success"
+if [ "$1" == "4o6" ] ; then
+ source lisp_ip4o6.sh
+fi
+if [ "$1" == "6o4" ] ; then
+ source lisp_ip6o4.sh
+fi
+
+echo "Success"