aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/netinet6/frag6/frag6_17.sh
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2019-10-21 09:33:45 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2019-10-21 09:33:45 +0000
commitf74e6e494f48b76f357d43d3672cca3606ffac04 (patch)
tree105d4f22357a246beeca1d682b11b2a98dca2aa2 /tests/sys/netinet6/frag6/frag6_17.sh
parent67a10c464436f1ddd16d41cac6c02802c9ce2f4d (diff)
downloadsrc-f74e6e494f48b76f357d43d3672cca3606ffac04.tar.gz
src-f74e6e494f48b76f357d43d3672cca3606ffac04.zip
frag6: import a set of test cases
In order to ensure that changing the frag6 code does not change behaviour or break code a set of test cases were implemented. Like some other test cases these use Scapy to generate packets and possibly wait for expected answers. In most cases we do check the global and per interface (netstat) statistics output using the libxo output and grep to validate fields and numbers. This is a bit hackish but we currently have no better way to match a selected number of stats only (we have to ignore some of the ND6 variables; otherwise we could use the entire list). Test cases include atomic fragments, single fragments, multi-fragments, and try to cover most error cases in the code currently. In addition vnet teardown is tested to not panic. A separate set (not in-tree currently) of probes were used in order to make sure that the test cases actually test what they should. The "sniffer" code was copied and adjusted from the netpfil version as we sometimes will not get packets or have longer timeouts to deal with. Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=353794
Diffstat (limited to 'tests/sys/netinet6/frag6/frag6_17.sh')
-rwxr-xr-xtests/sys/netinet6/frag6/frag6_17.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/sys/netinet6/frag6/frag6_17.sh b/tests/sys/netinet6/frag6/frag6_17.sh
new file mode 100755
index 000000000000..0fa10c98f085
--- /dev/null
+++ b/tests/sys/netinet6/frag6/frag6_17.sh
@@ -0,0 +1,47 @@
+# $FreeBSD$
+#-
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2019 Netflix, Inc.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+. $(atf_get_srcdir)/frag6.subr
+
+atf_test_case "frag6_17" "cleanup"
+frag6_17_head() {
+ frag6_head 17
+}
+
+frag6_17_body() {
+ frag6_body 17
+}
+
+frag6_17_cleanup() {
+ frag6_cleanup 17
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case "frag6_17"
+}