Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / test / suite_release.py
blobb124f98135bd50f57b3d439b3ba0ed30423b0bf7
2 # Wireshark tests
4 # Copyright (c) 2019 Gerald Combs <gerald@wireshark.org>
6 # SPDX-License-Identifier: GPL-2.0-or-later
8 '''Release tests'''
10 import re
11 import subprocess
12 import types
13 import pytest
15 @pytest.fixture
16 def wireshark_features(request, cmd_wireshark, make_env):
17 '''
18 Returns an object describing available features in Wireshark. Tests
19 will be skipped unless --enable-release is passed on the command line.
20 '''
21 enabled = request.config.getoption('--enable-release', default=False)
22 if not enabled:
23 pytest.skip('Release tests are not enabled via --enable-release')
24 disabled = request.config.getoption('--disable-gui', default=False)
25 if disabled:
26 pytest.skip('GUI tests are disabled via --disable-gui')
28 try:
29 wireshark_v = subprocess.check_output(
30 (cmd_wireshark, '--version'),
31 stderr=subprocess.PIPE,
32 universal_newlines=True,
33 env=make_env()
35 wireshark_v = re.sub(r'\s+', ' ', wireshark_v)
36 except subprocess.CalledProcessError as ex:
37 print('Failed to detect Wireshark features: %s' % (ex,))
38 wireshark_v = ''
39 return types.SimpleNamespace(
40 have_automatic_updates='+automatic updates' in wireshark_v,
43 class TestReleaseAutomaticUpdates:
44 def test_automatic_updates_present(self, wireshark_features):
45 '''Checks whether Wireshark was built with automatic updates.'''
47 assert wireshark_features.have_automatic_updates
49 class TestReleaseLua:
50 def test_lua_present(self, request, features):
51 '''Checks whether Wireshark was built with Lua support.'''
52 enabled = request.config.getoption('--enable-release', default=False)
53 if not enabled:
54 pytest.skip('Release tests are not enabled via --enable-release')
55 assert features.have_lua