From eabf92859ea3d221e05551845b9610ef63cc035f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Thu, 17 Mar 2022 08:17:30 +0100 Subject: [PATCH] test: Use integer tuple to check Gcrypt version Converting Gcrypt version to float before checking against 1.6 does not work when Gcrypt version is 1.10 and above. --- test/fixtures_ws.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/fixtures_ws.py b/test/fixtures_ws.py index 612b269739..76935d1961 100644 --- a/test/fixtures_ws.py +++ b/test/fixtures_ws.py @@ -172,15 +172,16 @@ def features(cmd_tshark, make_env): except subprocess.CalledProcessError as ex: print('Failed to detect tshark features: %s' % (ex,)) tshark_v = '' - gcry_m = re.search(r'with +Gcrypt +([0-9]+\.[0-9]+)', tshark_v) + gcry_m = re.search(r'with +Gcrypt +([0-9]+)\.([0-9]+)', tshark_v) + gcry_ver = (int(gcry_m.group(1)),int(gcry_m.group(2))) return types.SimpleNamespace( have_x64='Compiled (64-bit)' in tshark_v, have_lua='with Lua' in tshark_v, have_nghttp2='with nghttp2' in tshark_v, have_kerberos='with MIT Kerberos' in tshark_v or 'with Heimdal Kerberos' in tshark_v, - have_libgcrypt16=gcry_m and float(gcry_m.group(1)) >= 1.6, - have_libgcrypt17=gcry_m and float(gcry_m.group(1)) >= 1.7, - have_libgcrypt18=gcry_m and float(gcry_m.group(1)) >= 1.8, + have_libgcrypt16=gcry_m and gcry_ver >= (1,6), + have_libgcrypt17=gcry_m and gcry_ver >= (1,7), + have_libgcrypt18=gcry_m and gcry_ver >= (1,8), have_gnutls='with GnuTLS' in tshark_v, have_pkcs11='and PKCS #11 support' in tshark_v, have_brotli='with brotli' in tshark_v,