19b9b4ff5SFlorin Corassource config.sh
29b9b4ff5SFlorin Corassource odl_utils.sh
39b9b4ff5SFlorin Corassource topologies/rtr_two_iface.sh
49b9b4ff5SFlorin Coras
59b9b4ff5SFlorin Coras
69b9b4ff5SFlorin Coras# set odl config json file names; they are common among all rtr tests
79b9b4ff5SFlorin CorasODL_CONFIG_FILE1="elp1.json"
89b9b4ff5SFlorin CorasODL_CONFIG_FILE2="elp2.json"
99b9b4ff5SFlorin Coras
109b9b4ff5SFlorin Corasif [ "$1" == "clean" ] ; then
119b9b4ff5SFlorin Coras  rtr_two_iface_clean
129b9b4ff5SFlorin Coras  exit 0
139b9b4ff5SFlorin Corasfi
149b9b4ff5SFlorin Coras
159b9b4ff5SFlorin Corasif [[ $(id -u) != 0 ]]; then
169b9b4ff5SFlorin Coras  echo "Error: run this as a root."
179b9b4ff5SFlorin Coras  exit 1
189b9b4ff5SFlorin Corasfi
199b9b4ff5SFlorin Coras
209b9b4ff5SFlorin Corasfunction test_rtr_two_iface {
219b9b4ff5SFlorin Coras  rtr_two_iface_setup
229b9b4ff5SFlorin Coras
23bf231ba7SFilip Tehlar  maybe_pause
249b9b4ff5SFlorin Coras
259b9b4ff5SFlorin Coras  test_result=1
269b9b4ff5SFlorin Coras  rc=0
279b9b4ff5SFlorin Coras
289b9b4ff5SFlorin Coras  if [ "$1" != "${1#*[0-9].[0-9]}" ]; then
2951b44223SFilip Tehlar    ip netns exec vpp1-ns ping -w 20 -c 1 "${1}"
309b9b4ff5SFlorin Coras    rc=$?
319b9b4ff5SFlorin Coras  elif [ "$1" != "${1#*:[0-9a-fA-F]}" ]; then
3251b44223SFilip Tehlar    ip netns exec vpp1-ns ping6 -w 20 -c 1 "${1}"
339b9b4ff5SFlorin Coras    rc=$?
349b9b4ff5SFlorin Coras  else
359b9b4ff5SFlorin Coras    echo "Unrecognized IP format '$1'"
369b9b4ff5SFlorin Coras  fi
379b9b4ff5SFlorin Coras
38bf231ba7SFilip Tehlar  maybe_pause
399b9b4ff5SFlorin Coras
409b9b4ff5SFlorin Coras  rtr_two_iface_clean
41bf231ba7SFilip Tehlar  print_status $rc "No ICMP response!"
429b9b4ff5SFlorin Coras  exit $test_result
439b9b4ff5SFlorin Coras}
44