Wireshark-dev: [Wireshark-dev] Failing tests in suite_decryption.py and suite_dissectors/group_

From: wireshark <wireshark@xxxxxx>
Date: Thu, 19 Mar 2026 07:36:39 +0000
Hi All,

I found a few small bugs in test/suite_decryption.py and test/suite_dissectors/group_zabbix.py, causing some of them to be inconsistent in their outcome. The problem is that they did not use the test_env like most tests do, causing them to use the current user's configuration profile. In my case this configuration had some protocols disabled causing the tests to fail.

In tests/suite_decryption.py the test_env was used in the tests, but the check_partial function did not pass it on to the check_tree function. The tests using that are:
test/suite_decryption.py::TestDecryptSmb2::test_smb311_aes128gcm_partial
test/suite_decryption.py::TestDecryptSmb2::test_smb311_aes128gcm_partial_keyswap
test/suite_decryption.py::TestDecryptSmb2::test_smb311_aes256gcm_partial
test/suite_decryption.py::TestDecryptSmb2::test_smb311_aes256gcm_partial_keyswap

In tests/suite_dissectors/group_zabbix.py the test_env fixture was not used at all, so i added it to the tests and modified the _tshark_outputs function to accept it as an argument and pass it on to subprocess.run.

The attached file is a patch that fixes this, I don't have a gitlab account so i hope you are ok with me sending the patch here. It should apply cleanly to the current master.

Best regards,
Wesley
________________________________
Dit bericht kan informatie bevatten die niet voor u is bestemd. Indien u niet de geadresseerde bent of dit bericht abusievelijk aan u is toegezonden, wordt u verzocht dat aan de afzender te melden en het bericht te verwijderen. De Staat aanvaardt geen aansprakelijkheid voor schade, van welke aard ook, die verband houdt met risico's verbonden aan het elektronisch verzenden van berichten.

Ministerie van Justitie en Veiligheid

This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. The State accepts no liability for damage of any kind resulting from the risks inherent in the electronic transmission of messages.

Ministry of Justice and Security
 test/suite_decryption.py              | 2 +-
 test/suite_dissectors/group_zabbix.py | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/test/suite_decryption.py b/test/suite_decryption.py
index 7f5cab41e9..0009376921 100644
--- a/test/suite_decryption.py
+++ b/test/suite_decryption.py
@@ -1501,7 +1501,7 @@ class TestDecryptSmb2:
                         '-Y', 'frame.number >= %d'%pkt_skip,
                         '-w', partial_cap,
         ), encoding='utf-8', env=env)
-        TestDecryptSmb2.check_tree(cmd_tshark, partial_cap, tree, sesid, '""', s2ckey, c2skey)
+        TestDecryptSmb2.check_tree(cmd_tshark, partial_cap, tree, sesid, '""', s2ckey, c2skey, env=env)
 
     def test_smb311_aes128gcm_partial(self, features, home_path, cmd_tshark, capture_file, test_env):
         '''Check SMB 3.1.1 AES128GCM decryption in capture missing session setup'''
diff --git a/test/suite_dissectors/group_zabbix.py b/test/suite_dissectors/group_zabbix.py
index 8ad1391ec6..4301cae11d 100644
--- a/test/suite_dissectors/group_zabbix.py
+++ b/test/suite_dissectors/group_zabbix.py
@@ -11,7 +11,7 @@ from typing import List
 import pytest
 
 
-def _tshark_outputs(tshark: str, capture_file: Path) -> List[str]:
+def _tshark_outputs(tshark: str, capture_file: Path, env: dict) -> List[str]:
     res = subprocess.run(
         (
             tshark,
@@ -23,6 +23,7 @@ def _tshark_outputs(tshark: str, capture_file: Path) -> List[str]:
         check=True,
         encoding="utf-8",
         text=True,
+        env=env
     )
     return [line.strip() for line in res.stdout.splitlines()]
 
@@ -59,7 +60,7 @@ class TestZabbix:
         _get_zabbix_capture_files(),
         ids=_get_zabbix_capture_files_names_only(),
     )
-    def test_zabbix_capture(self, cmd_tshark, zabbix_capture_file):
+    def test_zabbix_capture(self, cmd_tshark, zabbix_capture_file, test_env):
         """This test is run separately for each capture file found in captures/zabbix,
         to provide readable output when a test fails.
 
@@ -67,7 +68,7 @@ class TestZabbix:
         it are compared to the tshark output.
         """
         expected_outputs = _get_output_file_contents(zabbix_capture_file)
-        tshark_outputs = _tshark_outputs(cmd_tshark, zabbix_capture_file)
+        tshark_outputs = _tshark_outputs(cmd_tshark, zabbix_capture_file, test_env)
         assert len(expected_outputs) == len(tshark_outputs), "Output length mismatch"
         # Let's do the checks line by line to provide readable output in case of error
         for i in range(len(expected_outputs)):

Attachment: digital-signature.txt
Description: PGP signature