diff options
author | Vina Ermagan <ermagan@gmail.com> | 2016-06-21 21:07:56 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2016-06-21 21:07:56 +0000 |
commit | fb472ab0029c8a810ae274c1a0d4f44a2aeb4fa4 (patch) | |
tree | 1f1ebd2d030820e3ddd19d654e148c677c92b3a8 /tests/data_plane/vpp_lite_topo/test_driver/smr_rtr_disjoint.sh | |
parent | 6ecb3add2c107f34cfa686f840f49c039cb5c6a7 (diff) | |
parent | 5528a69fbda8612c54f13f88e502b6824e1d900e (diff) |
Merge "Tests for SMR + RTR with disjoint locators"
Diffstat (limited to 'tests/data_plane/vpp_lite_topo/test_driver/smr_rtr_disjoint.sh')
-rw-r--r-- | tests/data_plane/vpp_lite_topo/test_driver/smr_rtr_disjoint.sh | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/smr_rtr_disjoint.sh b/tests/data_plane/vpp_lite_topo/test_driver/smr_rtr_disjoint.sh new file mode 100644 index 0000000..4b8abd9 --- /dev/null +++ b/tests/data_plane/vpp_lite_topo/test_driver/smr_rtr_disjoint.sh @@ -0,0 +1,88 @@ +source config.sh +source odl_utils.sh +source topologies/smr_rtr_disjoint.sh + +# set odl config json file names; they are common among all rtr tests +ODL_CONFIG_FILE1="vpp1.json" +ODL_CONFIG_FILE2="vpp2.json" +ODL_CONFIG_FILE3="elp1.json" +ODL_CONFIG_FILE4="elp2.json" + +if [ "$1" == "clean" ] ; then + smr_rtr_disjoint_clean + exit 0 +fi + +if [[ $(id -u) != 0 ]]; then + echo "Error: run this as a root." + exit 1 +fi + +function test_ns_ping { + if [ "$1" != "${1#*[0-9].[0-9]}" ]; then + ip netns exec $2 ping -w 15 -c 1 "${1}" + rc=$? + elif [ "$1" != "${1#*:[0-9a-fA-F]}" ]; then + ip netns exec $2 ping6 -w 15 -c 1 "${1}" + rc=$? + else + echo "Unrecognized IP format '$1'" + fi + return $rc +} + +function test_smr_rtr_disjoint { + # CONFIGURE + smr_rtr_disjoint_setup + + if [ "$2" == "wait" ] ; then + read -p "press any key to continue .." -n1 + fi + + test_result=1 + rc=0 + + # TEST IP6 over IP4 + test_ns_ping $1 vpp1-ns + + rc=$? + + if [ $rc -ne 0 ] ; then + echo "Simple test failed: No ICMP response received within specified timeout limit!" + else + echo "Simple test passed." + test_result=0 + fi + + if [ "$2" == "wait" ] ; then + read -p "press any key to continue .." -n1 + fi + + # RECONFIGURE + smr_rtr_disjoint_reconfigure + + if [ "$2" == "wait" ] ; then + read -p "Topology reconfigured press any key to continue .." -n1 + fi + + # TEST IP6 over disjoing IP4 and IP6 underlay + test_ns_ping $1 vpp1-ns + + rc=$? + + if [ $rc -ne 0 ] ; then + echo "SMR+RTR test failed: No ICMP response received within specified timeout limit!" + else + echo "SMR+RTR test passed." + test_result=0 + fi + + if [ "$2" == "wait" ] ; then + read -p "press any key to continue .." -n1 + fi + + # CLEANUP + smr_rtr_disjoint_clean + + exit $test_result +} |