summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/captures/http2-data-reassembly.pcapbin0 -> 82151 bytes
-rw-r--r--test/keys/http2-data-reassembly.keys1
-rwxr-xr-xtest/suite-dissection.sh60
-rwxr-xr-xtest/test.sh6
4 files changed, 67 insertions, 0 deletions
diff --git a/test/captures/http2-data-reassembly.pcap b/test/captures/http2-data-reassembly.pcap
new file mode 100644
index 0000000000..b0f15ee9e9
--- /dev/null
+++ b/test/captures/http2-data-reassembly.pcap
Binary files differ
diff --git a/test/keys/http2-data-reassembly.keys b/test/keys/http2-data-reassembly.keys
new file mode 100644
index 0000000000..8a3e2fbd8e
--- /dev/null
+++ b/test/keys/http2-data-reassembly.keys
@@ -0,0 +1 @@
+CLIENT_RANDOM 59b4b71f50e71bff50f88388679c0156714d158bf10edd29f1d45fb4fffb3010 750fc27332a9cc17802defc48bd5693c9278d68680ae64d9dffa1e638ebd17a7902ad69501c413571b7c63dc23a0918b \ No newline at end of file
diff --git a/test/suite-dissection.sh b/test/suite-dissection.sh
new file mode 100755
index 0000000000..dc003fde08
--- /dev/null
+++ b/test/suite-dissection.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# Test suite for various ad-hoc dissection tests
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+#
+# 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 will 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+dissection_http2_data_reassembly_test() {
+ if [ $HAVE_NGHTTP2 -ne 0 ]; then
+ test_step_skipped
+ return
+ fi
+
+ local filename="${CAPTURE_DIR}/http2-data-reassembly.pcap"
+ local keys="${TESTS_DIR}/keys/http2-data-reassembly.keys"
+
+ # Check for a reassembled PNG image.
+ $TSHARK -o ssl.keylog_file:$keys -d 'tcp.port==8443,ssl' \
+ -Y 'http2.data.data matches "PNG" && http2.data.data matches "END"' \
+ -r $filename |grep -q DATA
+
+ if [ $? -ne 0 ]; then
+ test_step_failed "could not find DATA frame with reassembled PNG content"
+ else
+ test_step_ok
+ fi
+ return
+}
+
+dissection_suite() {
+ test_step_add "testing http2 data reassembly" dissection_http2_data_reassembly_test
+}
+
+#
+# Editor modelines - https://www.wireshark.org/tools/modelines.html
+#
+# Local variables:
+# sh-basic-offset: 8
+# tab-width: 8
+# indent-tabs-mode: t
+# End:
+#
+# vi: set shiftwidth=8 tabstop=8 noexpandtab:
+# :indentSize=8:tabSize=8:noTabs=false:
+#
diff --git a/test/test.sh b/test/test.sh
index d469eccc22..375a647458 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -62,6 +62,7 @@ Usage: $THIS [-c] [-h] [-s <suite>]
prerequisites
unittests
wslua
+ dissection
FIN
exit 0
fi
@@ -110,6 +111,7 @@ source $TESTS_DIR/suite-nameres.sh
source $TESTS_DIR/suite-wslua.sh
source $TESTS_DIR/suite-mergecap.sh
source $TESTS_DIR/suite-text2pcap.sh
+source $TESTS_DIR/suite-dissection.sh
test_cleanup() {
if [ $TEST_OUTDIR_CLEAN = 1 ]; then
@@ -172,6 +174,7 @@ test_suite() {
test_suite_add "Mergecap" mergecap_suite
test_suite_add "File formats" fileformats_suite
test_suite_add "Text2pcap" text2pcap_suite
+ test_suite_add "Dissection" dissection_suite
}
@@ -223,6 +226,9 @@ if [ -n "$RUN_SUITE" ] ; then
"text2pcap")
test_suite_run "Text2pcap" text2pcap_suite
exit $? ;;
+ "dissection")
+ test_suite_run "Dissection" dissection_suite
+ exit $? ;;
esac
fi