Home | History | Annotate | Download | only in virt
      1 #!/bin/sh
      2 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
      3 #
      4 # This program is free software; you can redistribute it and/or
      5 # modify it under the terms of the GNU General Public License as
      6 # published by the Free Software Foundation; either version 2 of
      7 # the License, or (at your option) any later version.
      8 #
      9 # This program is distributed in the hope that it would be useful,
     10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12 # GNU General Public License for more details.
     13 #
     14 # You should have received a copy of the GNU General Public License
     15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
     16 #
     17 # Author: Alexey Kodanev <alexey.kodanev (at] oracle.com>
     18 #
     19 # Test-case 1: It requires remote host. Test will setup IPv4 and IPv6 virtual
     20 #              sub-nets between two hosts, then will compare TCP performance
     21 #              with and without VLAN using ping or netstress test.
     22 #
     23 # Test-case 2: The same as above but must fail, because VLAN allows
     24 #              to communicate only within the same VLAN segment.
     25 
     26 TCID=vlan03
     27 TST_TOTAL=6
     28 
     29 virt_type="vlan"
     30 
     31 . test_net.sh
     32 . virt_lib.sh
     33 
     34 cleanup()
     35 {
     36 	cleanup_vifaces
     37 	tst_rhost_run -c "ip link delete ltp_v0 2>/dev/null"
     38 }
     39 TST_CLEANUP="cleanup"
     40 
     41 if [ -z $ip_local -o -z $ip_remote ]; then
     42 	tst_brkm TBROK "you must specify IP address"
     43 fi
     44 
     45 p0="protocol 802.1Q"
     46 p1="protocol 802.1ad"
     47 lb0="loose_binding off"
     48 lb1="loose_binding on"
     49 rh0="reorder_hdr off"
     50 rh1="reorder_hdr on"
     51 
     52 opts=" ,$p0 $lb0 $rh1,$p1 $lb1 $rh1"
     53 
     54 for n in $(seq 1 3); do
     55 	p="$(echo $opts | cut -d',' -f$n)"
     56 
     57 	virt_check_cmd virt_add ltp_v0 id 0 $p || continue
     58 
     59 	tst_resm TINFO "networks with the same VLAN ID must work"
     60 	virt_setup "id 4094 $p" "id 4094 $p"
     61 	virt_compare_netperf
     62 
     63 	tst_resm TINFO "different VLAN ID shall not work together"
     64 	virt_setup "id 4093 $p" "id 4094 $p"
     65 	virt_compare_netperf "fail"
     66 done
     67 
     68 tst_exit
     69