• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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@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
26TCID=vlan03
27TST_TOTAL=6
28TST_NEEDS_TMPDIR=1
29
30virt_type="vlan"
31
32. test_net.sh
33. virt_lib.sh
34
35TST_CLEANUP="virt_cleanup"
36
37if [ -z $ip_local -o -z $ip_remote ]; then
38	tst_brkm TBROK "you must specify IP address"
39fi
40
41p0="protocol 802.1Q"
42p1="protocol 802.1ad"
43lb0="loose_binding off"
44lb1="loose_binding on"
45rh0="reorder_hdr off"
46rh1="reorder_hdr on"
47
48opts=" ,$p0 $lb0 $rh1,$p1 $lb1 $rh1"
49
50for 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
65done
66
67tst_exit
68