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@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 tcp_fastopen 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 26TCID=vlan03 27TST_TOTAL=6 28 29virt_type="vlan" 30 31. test_net.sh 32. virt_lib.sh 33 34cleanup() 35{ 36 cleanup_vifaces 37 tst_rhost_run -c "ip link delete ltp_v0" 38 if [ "$net_load" = "TFO" ]; then 39 tst_rhost_run -c "pkill -9 tcp_fastopen\$" 40 pkill -9 "tcp_fastopen\$" 41 fi 42} 43TST_CLEANUP="cleanup" 44 45if [ "$net_load" = "TFO" ]; then 46 tst_check_cmds "tcp_fastopen" 47fi 48 49if [ -z $ip_local -o -z $ip_remote ]; then 50 tst_brkm TBROK "you must specify IP address" 51fi 52 53p0="protocol 802.1Q" 54p1="protocol 802.1ad" 55lb0="loose_binding off" 56lb1="loose_binding on" 57rh0="reorder_hdr off" 58rh1="reorder_hdr on" 59 60opts=" ,$p0 $lb0 $rh1,$p1 $lb1 $rh1" 61 62for n in $(seq 1 3); do 63 p="$(echo $opts | cut -d',' -f$n)" 64 65 virt_check_cmd virt_add ltp_v0 id 0 $p || continue 66 67 tst_resm TINFO "networks with the same VLAN ID must work" 68 virt_setup "id 4094 $p" "id 4094 $p" 69 virt_compare_netperf 70 71 tst_resm TINFO "different VLAN ID shall not work together" 72 virt_setup "id 4093 $p" "id 4094 $p" 73 virt_compare_netperf "fail" 74done 75 76tst_exit 77