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 ipip_lib.sh for more
0006 # details.
0007 
0008 ALL_TESTS="gre_flat4 gre_mtu_change"
0009 
0010 NUM_NETIFS=6
0011 source lib.sh
0012 source ipip_lib.sh
0013 
0014 setup_prepare()
0015 {
0016         h1=${NETIFS[p1]}
0017         ol1=${NETIFS[p2]}
0018 
0019         ul1=${NETIFS[p3]}
0020         ul2=${NETIFS[p4]}
0021 
0022         ol2=${NETIFS[p5]}
0023         h2=${NETIFS[p6]}
0024 
0025         forwarding_enable
0026         vrf_prepare
0027         h1_create
0028         h2_create
0029         sw1_flat_create gre $ol1 $ul1 key 233
0030         sw2_flat_create gre $ol2 $ul2 key 233
0031 }
0032 
0033 gre_flat4()
0034 {
0035         RET=0
0036 
0037         ping_test $h1 192.0.2.18 " gre flat with key"
0038 }
0039 
0040 gre_mtu_change()
0041 {
0042         test_mtu_change gre
0043 }
0044 
0045 cleanup()
0046 {
0047         pre_cleanup
0048 
0049         sw2_flat_destroy $ol2 $ul2
0050         sw1_flat_destroy $ol1 $ul1
0051         h2_destroy
0052         h1_destroy
0053         vrf_cleanup
0054         forwarding_restore
0055 }
0056 
0057 trap cleanup EXIT
0058 
0059 setup_prepare
0060 setup_wait
0061 tests_run
0062 
0063 exit $EXIT_STATUS