Repository: randombit/botan
Pull request #2454 (2020-11-05 23:45:15)

Bump version to 3.0.0-alpha0
Update some tests which made assumptions on the major version


Patch:
diff --git a/news.rst b/news.rst
index 4893031a4..43873bb34 100644
--- a/news.rst
+++ b/news.rst
@@ -1,6 +1,9 @@
 Release Notes
 ========================================
 
+Version 3.0.0, Not Yet Released
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 Version 2.17.0, 2020-11-05
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
diff --git a/src/build-data/version.txt b/src/build-data/version.txt
index 6d9d4d8ab..e27eacc17 100644
--- a/src/build-data/version.txt
+++ b/src/build-data/version.txt
@@ -1,9 +1,9 @@
 
-release_major = 2
-release_minor = 17
+release_major = 3
+release_minor = 0
 release_patch = 0
-release_suffix = ''
-release_so_abi_rev = 17
+release_suffix = '-alpha0'
+release_so_abi_rev = 0
 
 # These are set by the distribution script
 release_vc_rev = None
diff --git a/src/python/botan2.py b/src/python/botan2.py
index 6ae1bd6da..358d3bc59 100755
--- a/src/python/botan2.py
+++ b/src/python/botan2.py
@@ -55,11 +55,15 @@ def _load_botan_dll(expected_version):
     possible_dll_names = []
 
     if platform in ['win32', 'cygwin', 'msys']:
+        possible_dll_names.append('botan-3.dll')
         possible_dll_names.append('botan.dll')
     elif platform in ['darwin', 'macos']:
+        possible_dll_names.append('libbotan-3.dylib')
         possible_dll_names.append('libbotan-2.dylib')
     else:
         # assumed to be some Unix/Linux system
+        possible_dll_names.append('libbotan-3.so')
+        possible_dll_names += ['libbotan-3.so.%d' % (v) for v in reversed(range(0, 10))]
         possible_dll_names.append('libbotan-2.so')
         possible_dll_names += ['libbotan-2.so.%d' % (v) for v in reversed(range(13, 20))]
 


Test patch:
diff --git a/src/scripts/test_cli.py b/src/scripts/test_cli.py
index 4e0f8ab83..71abdc2e8 100755
--- a/src/scripts/test_cli.py
+++ b/src/scripts/test_cli.py
@@ -119,11 +119,11 @@ def cli_config_tests(_tmp_dir):
 
     if len(prefix) < 4 or prefix[0] != '/':
         logging.error("Bad prefix %s" % (prefix))
-    if ("-I%s/include/botan-2" % (prefix)) not in cflags:
+    if ("-I%s/include/botan-3" % (prefix)) not in cflags:
         logging.error("Bad cflags %s" % (cflags))
     if not ldflags.endswith(("-L%s/lib" % (prefix))):
         logging.error("Bad ldflags %s" % (ldflags))
-    if "-lbotan-2" not in libs:
+    if "-lbotan-3" not in libs:
         logging.error("Bad libs %s" % (libs))
 
 def cli_help_tests(_tmp_dir):
@@ -136,12 +136,12 @@ def cli_help_tests(_tmp_dir):
 def cli_version_tests(_tmp_dir):
     output = test_cli("version", None, None)
 
-    version_re = re.compile(r'[0-9]\.[0-9]+\.[0-9]')
+    version_re = re.compile(r'[0-9]\.[0-9]+\.[0-9](\-[a-z]+[0-9]+)?')
     if not version_re.match(output):
         logging.error("Unexpected version output %s" % (output))
 
     output = test_cli("version", ["--full"], None, None)
-    version_full_re = re.compile(r'Botan [0-9]\.[0-9]+\.[0-9] \(.* revision .*, distribution .*\)$')
+    version_full_re = re.compile(r'Botan [0-9]\.[0-9]+\.[0-9](\-[a-z]+[0-9]+)? \(.* revision .*, distribution .*\)$')
     if not version_full_re.match(output):
         logging.error("Unexpected version output %s" % (output))
 
@@ -913,7 +913,7 @@ def cli_tls_http_server_tests(tmp_dir):
 
     body = str(resp.read())
 
-    if body.find('TLS negotiation with Botan 2.') < 0:
+    if body.find('TLS negotiation with Botan 3.') < 0:
         logging.error('Unexpected response body')
 
     conn.request("POST", "/logout")
@@ -1157,7 +1157,7 @@ def cli_speed_pbkdf_tests(_tmp_dir):
 def cli_speed_table_tests(_tmp_dir):
     msec = 1
 
-    version_re = re.compile(r'^Botan 2\.[0-9]+\.[0-9] \(.*, revision .*, distribution .*\)')
+    version_re = re.compile(r'^Botan 3\.[0-9]+\.[0-9](\-.*[0-9]+)? \(.*, revision .*, distribution .*\)')
     cpuid_re = re.compile(r'^CPUID: [a-z_0-9 ]*$')
     format_re = re.compile(r'^AES-128 .* buffer size [0-9]+ bytes: [0-9]+\.[0-9]+ MiB\/sec .*\([0-9]+\.[0-9]+ MiB in [0-9]+\.[0-9]+ ms\)')
     tbl_hdr_re = re.compile(r'^algo +operation +1024 bytes$')
diff --git a/src/scripts/test_python.py b/src/scripts/test_python.py
index 2202c0e4b..e4f115d0c 100644
--- a/src/scripts/test_python.py
+++ b/src/scripts/test_python.py
@@ -23,8 +23,8 @@ class BotanPythonTests(unittest.TestCase):
         version_str = botan2.version_string()
         self.assertTrue(version_str.startswith('Botan '))
 
-        self.assertEqual(botan2.version_major(), 2)
-        self.assertGreaterEqual(botan2.version_minor(), 8)
+        self.assertEqual(botan2.version_major(), 3)
+        self.assertGreaterEqual(botan2.version_minor(), 0)
 
         self.assertGreaterEqual(botan2.ffi_api_version(), 20180713)