1 #!/bin/sh 2 # Copyright (c) 2015-2017 Oracle and/or its affiliates. 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 TST_NEEDS_TMPDIR=1 29 30 virt_type="vlan" 31 32 . test_net.sh 33 . virt_lib.sh 34 35 TST_CLEANUP="virt_cleanup" 36 37 if [ -z $ip_local -o -z $ip_remote ]; then 38 tst_brkm TBROK "you must specify IP address" 39 fi 40 41 p0="protocol 802.1Q" 42 p1="protocol 802.1ad" 43 lb0="loose_binding off" 44 lb1="loose_binding on" 45 rh0="reorder_hdr off" 46 rh1="reorder_hdr on" 47 48 opts=" ,$p0 $lb0 $rh1,$p1 $lb1 $rh1" 49 50 for n in $(seq 1 3); do 51 p="$(echo $opts | cut -d',' -f$n)" 52 53 virt_check_cmd virt_add ltp_v0 id 0 $p || continue 54 55 tst_resm TINFO "networks with the same VLAN ID must work" 56 virt_setup "id 4094 $p" "id 4094 $p" 57 virt_netperf_msg_sizes 58 virt_cleanup_rmt 59 60 tst_resm TINFO "different VLAN ID shall not work together" 61 virt_setup "id 4093 $p" "id 4094 $p" 62 virt_minimize_timeout 63 virt_compare_netperf "fail" 64 virt_cleanup_rmt 65 done 66 67 tst_exit 68