1#!/bin/sh 2# SPDX-License-Identifier: GPL-2.0-or-later 3# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz> 4# Copyright (c) 2015-2017 Oracle and/or its affiliates. 5# Author: Alexey Kodanev <alexey.kodanev@oracle.com> 6# 7# Test-case 1: It requires remote host. Test will setup IPv4 and IPv6 virtual 8# sub-nets between two hosts, then will compare TCP performance 9# with and without VLAN using ping or netstress test. 10# 11# Test-case 2: The same as above but must fail, because VLAN allows 12# to communicate only within the same VLAN segment. 13 14p0="protocol 802.1Q" 15p1="protocol 802.1ad" 16lb0="loose_binding off" 17lb1="loose_binding on" 18rh0="reorder_hdr off" 19rh1="reorder_hdr on" 20 21virt_type="vlan" 22 23TST_NEEDS_TMPDIR=1 24TST_TEST_DATA=",$p0 $lb0 $rh1,$p1 $lb1 $rh1" 25TST_TEST_DATA_IFS="," 26TST_TESTFUNC=do_test 27TST_SETUP=do_setup 28TST_CLEANUP=virt_cleanup 29. virt_lib.sh 30 31do_setup() 32{ 33 if [ -z $ip_local -o -z $ip_remote ]; then 34 tst_brk TBROK "you must specify IP address" 35 fi 36 virt_lib_setup 37} 38 39do_test() 40{ 41 virt_check_cmd virt_add ltp_v0 id 0 $2 || return 42 43 tst_res TINFO "networks with the same VLAN ID must work" 44 virt_setup "id 4094 $2" "id 4094 $2" 45 virt_netperf_msg_sizes 46 virt_cleanup_rmt 47 48 tst_res TINFO "different VLAN ID shall not work together" 49 virt_setup "id 4093 $2" "id 4094 $2" 50 virt_minimize_timeout 51 virt_compare_netperf "fail" 52 virt_cleanup_rmt 53} 54 55tst_run 56