aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/config.py17
-rw-r--r--test/suite_clopts.py2
-rw-r--r--test/suite_decryption.py13
-rw-r--r--test/suite_text2pcap.py4
4 files changed, 20 insertions, 16 deletions
diff --git a/test/config.py b/test/config.py
index 51531b8665..b38bf7ceb1 100644
--- a/test/config.py
+++ b/test/config.py
@@ -168,6 +168,8 @@ def setUpTestEnvironment():
global conf_path
global custom_profile_path
global test_env
+
+ # Create our directories
test_confdir = tempfile.mkdtemp(prefix='wireshark-tests.')
home_path = os.path.join(test_confdir, 'home')
if sys.platform.startswith('win32'):
@@ -180,6 +182,21 @@ def setUpTestEnvironment():
# Test spaces while we're here.
custom_profile_path = os.path.join(conf_path, 'profiles', custom_profile_name)
os.makedirs(custom_profile_path)
+
+ # Populate our UAT files
+ uat_files = [
+ '80211_keys',
+ 'dtlsdecrypttablefile',
+ 'esp_sa',
+ 'ssl_keys',
+ 'c1222_decryption_table',
+ 'ikev1_decryption_table',
+ 'ikev2_decryption_table',
+ ]
+ for uat in uat_files:
+ setUpUatFile(uat)
+
+ # Set up our environment
test_env = os.environ.copy()
test_env['WIRESHARK_RUN_FROM_BUILD_DIRECTORY'] = '1'
test_env[home_env] = home_path
diff --git a/test/suite_clopts.py b/test/suite_clopts.py
index a5312c4ad5..894a3ceef7 100644
--- a/test/suite_clopts.py
+++ b/test/suite_clopts.py
@@ -180,7 +180,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'))
+ self.runProcess((config.cmd_tshark, '-G', 'plugins'), env=os.environ.copy())
self.assertGreaterEqual(self.countOutput('dissector'), 10, 'Fewer than 10 dissector plugins found')
diff --git a/test/suite_decryption.py b/test/suite_decryption.py
index 5813456e5f..a007b6f8e7 100644
--- a/test/suite_decryption.py
+++ b/test/suite_decryption.py
@@ -14,19 +14,6 @@ import os.path
import subprocesstest
import unittest
-uat_files = [
- '80211_keys',
- 'dtlsdecrypttablefile',
- 'esp_sa',
- 'ssl_keys',
- 'c1222_decryption_table',
- 'ikev1_decryption_table',
- 'ikev2_decryption_table',
-]
-for uat in uat_files:
- config.setUpUatFile(uat)
-
-
class case_decrypt_80211(subprocesstest.SubprocessTestCase):
def test_80211_wpa_psk(self):
'''IEEE 802.11 WPA PSK'''
diff --git a/test/suite_text2pcap.py b/test/suite_text2pcap.py
index baf2ea0c18..3ee84f2b13 100644
--- a/test/suite_text2pcap.py
+++ b/test/suite_text2pcap.py
@@ -115,7 +115,7 @@ def check_text2pcap(self, cap_file, file_type, expected_packets=None, expected_d
# in the output file are the same as in the input file
pre_cap_info = check_capinfos_info(self, cap_file)
- self.assertTrue(encap_to_link_type.has_key(pre_cap_info['encapsulation']))
+ self.assertTrue(pre_cap_info['encapsulation'] in encap_to_link_type)
self.assertTrue(file_type in file_type_to_testout, 'Invalid file type')
@@ -128,7 +128,7 @@ def check_text2pcap(self, cap_file, file_type, expected_packets=None, expected_d
cf = cf_path,
of = testin_file,
)
- self.assertRun(tshark_cmd, shell=True)
+ self.assertRun(tshark_cmd, shell=True, env=os.environ.copy())
testout_fname = file_type_to_testout[file_type]
testout_file = self.filename_from_id(testout_fname)