3 source topologies/2_node_topo.sh
5 ODL_CONFIG_FILE1="vpp1.json"
6 ODL_CONFIG_FILE2="vpp2.json"
8 if [ "$1" == "clean" ] ; then
13 if [[ $(id -u) != 0 ]]; then
14 echo "Error: run this as root."
18 function send_nsh_packet_from_namespace
27 ip netns exec $ns python scripts/send_nsh_packet.py $dst $itr_mac $spi $si $src_mac
39 src_mac=`ip netns exec vppns1 ip a show dev veth_vpp1 | grep "link/ether" | awk '{print $2}'`
40 itr_mac=`echo "sh hard host-vpp1" | nc 0 5002 | grep 'Ethernet address' | awk '{print $3}'`
44 cat << EOF > scripts/lisp_nsh
45 create packet-generator interface pg0
47 packet-generator new {
50 node lisp-cp-lookup-nsh
55 pcap ${ONE_ROOT}/tests/data_plane/vpp_lite_topo/scripts/nsh.pcap
60 echo "trace add af-packet-input 100" | nc 0 5002
61 echo "trace add af-packet-input 100" | nc 0 5003
62 echo "exec ${ONE_ROOT}/tests/data_plane/vpp_lite_topo/scripts/lisp_nsh" | nc 0 5002
63 echo "packet-generator enable-stream nsh1" | nc 0 5002
65 # add dummy node to ETR
66 echo "test one nsh add-dummy-decap-node" | nc 0 5003
68 # inject NSH packet to ITR
69 echo "test one nsh pcap ${ONE_ROOT}/tests/data_plane/vpp_lite_topo/scripts/nsh.pcap" | nc 0 5002
72 decap_stats="`echo "show errors" | nc 0 5003 | grep "lisp gpe dummy nsh decap" | awk '{print $1}'`"
74 if [ "$decap_stats" == "1" ] ; then
80 print_status $rc "NSH test failed!"