From 460c26516a3288a003aeeb01da35bf5cb6f210ad Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Fri, 12 Oct 2018 18:12:01 +0200 Subject: test: reduce further influence from the environment Some tests used the default home directory which can have side-effects (such as loading plugins, loading deprecated preferences). These could cause tests to fail. Always use a sane environment to fix this. Change getTsharkInfo to use this clean environment as well (WIRESHARK_CONFIG_DIR does not exist with master-2.6 and would also not propagate things like ASAN_OPTIONS=detect_leaks=0). Change-Id: I1674f71972d35de91d191e0c29fdb59b8a0a56ce Reviewed-on: https://code.wireshark.org/review/30165 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- test/suite_clopts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/suite_clopts.py') diff --git a/test/suite_clopts.py b/test/suite_clopts.py index 02cfd97f68..aa6ec95ccc 100644 --- a/test/suite_clopts.py +++ b/test/suite_clopts.py @@ -178,7 +178,7 @@ class case_tshark_dump_glossaries(subprocesstest.SubprocessTestCase): def test_tshark_glossary_valid_utf8(self): for glossary in glossaries: - env = os.environ.copy() + env = config.baseEnv() env['LANG'] = 'en_US.UTF-8' g_contents = subprocess.check_output((config.cmd_tshark, '-G', glossary), env=env, stderr=subprocess.PIPE) decoded = True @@ -189,7 +189,7 @@ class case_tshark_dump_glossaries(subprocesstest.SubprocessTestCase): self.assertTrue(decoded, '{} is not valid UTF-8'.format(glossary)) def test_tshark_glossary_plugin_count(self): - self.runProcess((config.cmd_tshark, '-G', 'plugins'), env=os.environ.copy()) + self.runProcess((config.cmd_tshark, '-G', 'plugins'), env=config.baseEnv()) self.assertGreaterEqual(self.countOutput('dissector'), 10, 'Fewer than 10 dissector plugins found') -- cgit v1.2.3