diff options
author | Alexey Kodanev <alexey.kodanev@oracle.com> | 2015-07-01 20:55:20 +0300 |
---|---|---|
committer | Alexey Kodanev <alexey.kodanev@oracle.com> | 2015-08-19 21:25:05 +0300 |
commit | d4074f036d0c5dea4b3c9eb53f5d63742111dcb1 (patch) | |
tree | 235a1af0d3c846e3ba48b7ebfae94375bf722996 /testcases/network | |
parent | 728aa3c54e9037cc4f21464fc4f579d47548754c (diff) |
network/virt/vlan02: add new test-case
Based on vxlan02 test-cases. Common code moved to
virt_lib.sh.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Diffstat (limited to 'testcases/network')
-rw-r--r-- | testcases/network/virt/Makefile | 1 | ||||
-rw-r--r-- | testcases/network/virt/virt_lib.sh | 13 | ||||
-rwxr-xr-x | testcases/network/virt/vlan02.sh | 34 | ||||
-rwxr-xr-x | testcases/network/virt/vxlan02.sh | 8 |
4 files changed, 49 insertions, 7 deletions
diff --git a/testcases/network/virt/Makefile b/testcases/network/virt/Makefile index 7ed0621c1..2ef0b3753 100644 --- a/testcases/network/virt/Makefile +++ b/testcases/network/virt/Makefile @@ -20,6 +20,7 @@ include $(top_srcdir)/include/mk/env_pre.mk INSTALL_TARGETS := virt_lib.sh \ vlan01.sh \ + vlan02.sh \ vxlan01.sh \ vxlan02.sh \ vxlan03.sh \ diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh index 7f7e8faca..fc2064199 100644 --- a/testcases/network/virt/virt_lib.sh +++ b/testcases/network/virt/virt_lib.sh @@ -153,6 +153,19 @@ virt_multiple_add_test() tst_resm TPASS "done" } +virt_add_delete_test() +{ + local opt="$@" + tst_resm TINFO "create, delete $virt_type $virt_max times" + + for i in $(seq 0 $virt_max); do + ROD_SILENT "virt_add ltp_v0 $opt" + ROD_SILENT "ip link set ltp_v0 up" + ROD_SILENT "ip link delete ltp_v0" + done + tst_resm TPASS "done" +} + virt_setup() { local opt="$1" diff --git a/testcases/network/virt/vlan02.sh b/testcases/network/virt/vlan02.sh new file mode 100755 index 000000000..a37bd7363 --- /dev/null +++ b/testcases/network/virt/vlan02.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# Author: Alexey Kodanev <alexey.kodanev@oracle.com> +# +# Test-case 1: Local test, check if we can create and then delete VLAN +# interface 4095 times. +# + +TCID=vlan02 +TST_TOTAL=1 + +virt_type="vlan" +virt_max="4094" + +. test_net.sh +. virt_lib.sh + +virt_add_delete_test "id 4094" + +tst_exit diff --git a/testcases/network/virt/vxlan02.sh b/testcases/network/virt/vxlan02.sh index a0b9267e8..284a46927 100755 --- a/testcases/network/virt/vxlan02.sh +++ b/testcases/network/virt/vxlan02.sh @@ -31,13 +31,7 @@ virt_max=5000 . virt_lib.sh opt="group 239.1.1.1" -tst_resm TINFO "create, delete ltp_v0 $virt_max times" -for i in $(seq 0 $virt_max); do - ROD_SILENT "ip link add ltp_v0 type vxlan id $start_id $opt" - ROD_SILENT "ip link set ltp_v0 up" - ROD_SILENT "ip link delete ltp_v0" -done -tst_resm TPASS "done" +virt_add_delete_test "id $start_id $opt" tst_exit |