Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 # SPDX-License-Identifier: GPL-2.0
0003 
0004 # Test IP-in-IP GRE tunnel with key.
0005 # This test uses flat topology for IP tunneling tests. See ip6gre_lib.sh for
0006 # more details.
0007 
0008 ALL_TESTS="
0009         gre_flat
0010         gre_mtu_change
0011 "
0012 
0013 NUM_NETIFS=6
0014 source lib.sh
0015 source ip6gre_lib.sh
0016 
0017 setup_prepare()
0018 {
0019         h1=${NETIFS[p1]}
0020         ol1=${NETIFS[p2]}
0021 
0022         ul1=${NETIFS[p3]}
0023         ul2=${NETIFS[p4]}
0024 
0025         ol2=${NETIFS[p5]}
0026         h2=${NETIFS[p6]}
0027 
0028         forwarding_enable
0029         vrf_prepare
0030         h1_create
0031         h2_create
0032         sw1_flat_create $ol1 $ul1 key 233
0033         sw2_flat_create $ol2 $ul2 key 233
0034 }
0035 
0036 gre_flat()
0037 {
0038         test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 with key"
0039         test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 with key"
0040 }
0041 
0042 gre_mtu_change()
0043 {
0044         test_mtu_change
0045 }
0046 
0047 cleanup()
0048 {
0049         pre_cleanup
0050 
0051         sw2_flat_destroy $ol2 $ul2
0052         sw1_flat_destroy $ol1 $ul1
0053         h2_destroy
0054         h1_destroy
0055         vrf_cleanup
0056         forwarding_restore
0057 }
0058 
0059 trap cleanup EXIT
0060 
0061 setup_prepare
0062 setup_wait
0063 tests_run
0064 
0065 exit $EXIT_STATUS