File: version_check_on_autopkgtest.patch

package info (click to toggle)
libnet-ssleay-perl 1.94-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,236 kB
  • sloc: ansic: 6,661; perl: 3,924; makefile: 3
file content (36 lines) | stat: -rw-r--r-- 2,084 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Subject: Loosen the OpenSSL version checks on autopkgtests
Origin: ubuntu
Bug-Debian: https://bugs.debian.org/1010795
Bug-Ubuntu: https://launchpad.net/bugs/1972795
Forwarded: not-needed, only makes sense in a Debian-ish context
Author: Simon Chopin <simon.chopin@canonical.com>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2022-05-10

The test suite checks that the OPENSSL_version_*() calls match the compile-time
constants, which is reasonable in a unit test that is run in the same time
frame as the compilation, as is usually the case. However, this check doesn't
make as much sense in the autopkgtest context, where the src:openssl package
might have been updated for a bugfix release, for instance. Such updates would
trigger an autopkgtest run, and barring regressions in OpenSSL the tests for
this package should reasonably not fail, especially given the explicit
versioning policy from 3.0.0 forward:

https://www.openssl.org/policies/general/versioning-policy.html

--- a/t/local/04_basic.t
+++ b/t/local/04_basic.t
@@ -55,8 +55,11 @@
     cmp_ok($patch, '>=', 0, 'OPENSSL_version_patch');
 
     is(Net::SSLeay::OPENSSL_VERSION_MAJOR(), $major, 'OPENSSL_VERSION_MAJOR and OPENSSL_version_major are equal');
-    is(Net::SSLeay::OPENSSL_VERSION_MINOR(), $minor, 'OPENSSL_VERSION_MINOR and OPENSSL_version_minor are equal');
-    is(Net::SSLeay::OPENSSL_VERSION_PATCH(), $patch, 'OPENSSL_VERSION_PATCH and OPENSSL_version_patch are equal');
+    SKIP: {
+        skip('No check of OpenSSL versions during autopkgtests.', 2) if $ENV{'AUTOPKGTEST_TMP'};
+        is(Net::SSLeay::OPENSSL_VERSION_MINOR(), $minor, 'OPENSSL_VERSION_MINOR and OPENSSL_version_minor are equal');
+        is(Net::SSLeay::OPENSSL_VERSION_PATCH(), $patch, 'OPENSSL_VERSION_PATCH and OPENSSL_version_patch are equal');
+    }
 
     isnt(defined Net::SSLeay::OPENSSL_version_pre_release(), undef, 'OPENSSL_version_pre_release returns a defined value');
     isnt(defined Net::SSLeay::OPENSSL_version_build_metadata(), undef, 'OPENSSL_version_build_metadata returns a defined value');