create_host_iface intervpp1 6.0.3.1/24
lisp_state enable
+lisp_stats 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 rloc 6.0.3.2
create_host_iface intervpp1 6:0:3::1/64
lisp_state enable
+lisp_stats enable
lisp_locator_set_with_locator ls1 host-intervpp1 1 1
lisp_local_eid eid 6:0:1::0/64 locator-set ls1
lisp_remote_mapping eid 6:0:2::0/64 rloc 6:0:3::2
--- /dev/null
+create_host_iface vpp1 6.0.1.1/24
+set_if_l2_bridge host-vpp1 10
+create_host_iface intervpp1 6.0.3.1/24
+
+lisp_state enable
+lisp_stats enable
+lisp_locator_set_with_locator ls1 host-intervpp1 1 1
+lisp_eid_map_bd 10 10
+lisp_local_eid vni 10 eid 08:11:11:11:11:11 locator-set ls1
+lisp_remote_mapping vni 10 eid 08:22:22:22:22:22 rloc 6.0.3.2
+lisp_adjacency vni 10 leid 08:11:11:11:11:11 reid 08:22:22:22:22:22
--- /dev/null
+create_host_iface vpp2 6.0.1.2/24
+set_if_l2_bridge host-vpp2 10
+create_host_iface intervpp2 6.0.3.2/24
+
+lisp_state enable
+lisp_locator_set_with_locator ls1 host-intervpp2 1 1
+lisp_eid_map_bd 10 10
+lisp_local_eid vni 10 eid 08:22:22:22:22:22 locator-set ls1
+lisp_remote_mapping vni 10 eid 08:11:11:11:11:11 rloc 6.0.3.1
+lisp_adjacency vni 10 leid 08:22:22:22:22:22 reid 08:11:11:11:11:11
--- /dev/null
+one_stats_dump
python scripts/dummy_mr.py "$1" 4342 &
mr_id=$!
}
+
+function check_counters
+{
+ python scripts/vat/check_counters.py ${VPP_API_TEST} ${VAT_TEMPLATES} "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8"
+}
+
SimpleMapping('set_if_ip', 'set int ip address', 'sw_interface_add_del_address')
SimpleMapping('lisp_rloc_probe_state', 'lisp rloc-probe', 'lisp_rloc_probe_enable_disable')
SimpleMapping('lisp_map_register_state', 'lisp map-register', 'lisp_map_register_enable_disable')
+SimpleMapping('lisp_stats', 'one statistics', 'one_stats_enable_disable')
CustomMapping('lisp_eid_map_bd',
'lisp eid-table map vni {0} bd {1}',
--- /dev/null
+# Script for checking LISP counters
+
+help_string = """
+ Params:
+ vat_exec - VAT executable
+ vpp_prefix - shared vpp memory prefix
+ vat_path - VAT template file
+ vni
+ seid
+ deid
+ loc_rloc
+ rmt_rloc
+ pkt_count
+ bytes
+"""
+
+import sys
+import subprocess
+import json
+
+def get_stat_entry(json, vni, seid, deid, loc_rloc, rmt_rloc):
+ if len (json) == 0:
+ return None
+
+ for obj in json:
+ if obj['vni'] == int(vni) and\
+ obj['seid'] == seid and\
+ obj['deid'] == deid and\
+ obj['lloc'] == loc_rloc and\
+ obj['rloc'] == rmt_rloc:
+ return obj
+
+ return None
+
+
+def check_counters(vat_exec, vat_path, vpp_prefix, vni, seid, deid, loc_rloc,
+ rmt_rloc, pkt_count, total_bytes):
+ vat_file = vat_path + '/' + 'dump_stats.tpl'
+ out = subprocess.Popen([vat_exec, "chroot", "prefix", vpp_prefix, "json", "script",
+ "in", vat_file], stdout=subprocess.PIPE).communicate()[0]
+
+ o = json.loads(out)
+ stat_entry = get_stat_entry(o, vni, seid, deid, loc_rloc, rmt_rloc)
+
+ if stat_entry is None:
+ return False
+
+ if stat_entry['pkt_count'] != int(pkt_count):
+ return False
+ if stat_entry['bytes'] != int(total_bytes):
+ return False
+ return True
+
+
+if __name__ == "__main__":
+ if len(sys.argv) < 10:
+ raise Exception('expected 10 parameters: ' + help_string)
+
+ if check_counters(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4],
+ sys.argv[5],
+ sys.argv[6],
+ sys.argv[7],
+ sys.argv[8],
+ sys.argv[9],
+ sys.argv[10]):
+ sys.exit(0)
+ else:
+ sys.exit(1)
if __name__ == "__main__":
if len(sys.argv) < 4:
- raise Exception('expecteds 4 parameters: VAT executable, shared prefix '
+ raise Exception('expected 4 parameters: VAT executable, shared prefix '
+ ' name, mapping expected, path to vat templates!')
if verify_mapping(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]):
print_status $rc "No ICM response!"
exit $test_result
}
+
+function test_single_icmp
+{
+ if [ "$3" != "no_setup" ] ; then
+ basic_topo_setup no_odl
+ fi
+
+ maybe_pause
+ test_result=1
+
+ ip netns exec vppns1 "${1}" -c 1 "${2}"
+ rc=$?
+
+ check_counters "vpp1" "10" $3 $4 $5 $6 $7 $8
+ assert_rc_ok $? "basic_topo_clean no_odl" "Counters do not match!"
+
+ # test done
+ maybe_pause
+ basic_topo_clean no_odl
+ print_status $rc "No ICM response!"
+ exit $test_result
+}
ip netns exec vppns1 "${1}" -c 1 "${2}"
rc=$?
+ # SEID DEID LLOC RLOC PKTS BYTES
+ check_counters "vpp1" "0" $3 $4 $5 $6 $7 $8
+ assert_rc_ok $? "2_node_topo_clean no_odl" "Counters do not match!"
+
# test done
maybe_pause
2_node_topo_clean no_odl
# (ip4 over ip4)
VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/basic/4o4_no_odl_adj
+VAT_TEMPLATES=`pwd`/../vat_templates
source test_driver/basic_single_icmp.sh
-test_single_icmp ping "6.0.2.2"
+test_single_icmp ping "6.0.2.2" "6.0.1.0/24" "6.0.2.0/24" "6.0.3.1" "6.0.3.2" "1" "84"
# (ip6 over ip6)
VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/basic/6o6_no_odl_adj
+VAT_TEMPLATES=`pwd`/../vat_templates
source test_driver/basic_single_icmp.sh
-test_single_icmp ping6 "6:0:2::2"
+test_single_icmp ping6 "6:0:2::2" "6:0:1::/64" "6:0:2::/64" "6:0:3::1" "6:0:3::2" "1" "104"
--- /dev/null
+#!/usr/bin/env bash
+
+# Test basic LISP functionality (l2 over ip4)
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/basic/l2o4_with_adj
+VAT_TEMPLATES=`pwd`/../vat_templates
+
+source test_driver/basic_l2.sh
+
+test_single_icmp ping "6.0.1.12" "08:11:11:11:11:11" "08:22:22:22:22:22" "6.0.3.1" "6.0.3.2" "1" "98"