ip6gre_flat.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-2.0
  3. # Test IP-in-IP GRE tunnel without key.
  4. # This test uses flat topology for IP tunneling tests. See ip6gre_lib.sh for
  5. # more details.
  6. ALL_TESTS="
  7. gre_flat
  8. gre_mtu_change
  9. gre_flat_remote_change
  10. "
  11. NUM_NETIFS=6
  12. source lib.sh
  13. source ip6gre_lib.sh
  14. setup_prepare()
  15. {
  16. h1=${NETIFS[p1]}
  17. ol1=${NETIFS[p2]}
  18. ul1=${NETIFS[p3]}
  19. ul2=${NETIFS[p4]}
  20. ol2=${NETIFS[p5]}
  21. h2=${NETIFS[p6]}
  22. forwarding_enable
  23. vrf_prepare
  24. h1_create
  25. h2_create
  26. sw1_flat_create $ol1 $ul1
  27. sw2_flat_create $ol2 $ul2
  28. }
  29. gre_flat()
  30. {
  31. test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6"
  32. test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6"
  33. }
  34. gre_mtu_change()
  35. {
  36. test_mtu_change
  37. }
  38. gre_flat_remote_change()
  39. {
  40. flat_remote_change
  41. test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 (new remote)"
  42. test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 (new remote)"
  43. flat_remote_restore
  44. test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 (old remote)"
  45. test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 (old remote)"
  46. }
  47. cleanup()
  48. {
  49. pre_cleanup
  50. sw2_flat_destroy $ol2 $ul2
  51. sw1_flat_destroy $ol1 $ul1
  52. h2_destroy
  53. h1_destroy
  54. vrf_cleanup
  55. forwarding_restore
  56. }
  57. trap cleanup EXIT
  58. setup_prepare
  59. setup_wait
  60. tests_run
  61. exit $EXIT_STATUS