Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/net/if_vlan Since there was already a test to verify t...
details: https://anonhg.NetBSD.org/src/rev/ec5e9eb2e2d3
branches: trunk
changeset: 357722:ec5e9eb2e2d3
user: kre <kre%NetBSD.org@localhost>
date: Thu Nov 23 04:59:49 2017 +0000
description:
Since there was already a test to verify that vlan tag 4096 is
detected as invalid, become the "someone" referred to in the
previous commit log, and add tests for 0 and 4095 as well, and
while here, throw in a few more that might elicit bugs.
And if the shell running the tests is able, add tests of a few
random vlan tags between 2 and 4093 (1 and 4094 are always tested)
to check that anything in range works (well, partially check...)
diffstat:
tests/net/if_vlan/t_vlan.sh | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r 7bc749c6914c -r ec5e9eb2e2d3 tests/net/if_vlan/t_vlan.sh
--- a/tests/net/if_vlan/t_vlan.sh Thu Nov 23 04:12:36 2017 +0000
+++ b/tests/net/if_vlan/t_vlan.sh Thu Nov 23 04:59:49 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_vlan.sh,v 1.6 2017/11/23 04:12:36 kre Exp $
+# $NetBSD: t_vlan.sh,v 1.7 2017/11/23 04:59:49 kre Exp $
#
# Copyright (c) 2016 Internet Initiative Japan Inc.
# All rights reserved.
@@ -337,9 +337,22 @@
$config_and_ping 4094
# $config_and_ping 4095 #reserved vlan id
+ if [ "${RANDOM:-0}" != "${RANDOM:-0}" ]
+ then
+ for TAG in $(( ${RANDOM:-0} % 4092 + 2 )) \
+ $(( ${RANDOM:-0} % 4092 + 2 )) \
+ $(( ${RANDOM:-0} % 4092 + 2 ))
+ do
+ $config_and_ping "${TAG}"
+ done
+ fi
+
export RUMP_SERVER=$SOCK_LOCAL
- atf_check -s not-exit:0 -e ignore \
- rump.ifconfig vlan0 vlan 4096 vlanif shmif0
+ for TAG in 0 4095 4096 $((4096*4 + 1)) 65536 65537 $((65536 + 4095))
+ do
+ atf_check -s not-exit:0 -e not-empty \
+ rump.ifconfig vlan0 vlan "${TAG}" vlanif shmif0
+ done
atf_check -s exit:0 rump.ifconfig vlan0 vlan 1 vlanif shmif0
atf_check -s not-exit:0 -e ignore \
Home |
Main Index |
Thread Index |
Old Index