Skip to content

Commit 309f7af

Browse files
authored
Fix 5 more ptests (perl-Net-SSLeay perl-Module-Implementation perl-URI rubygem-introspection rubygem-metaclass) (#13849)
1 parent b048ddf commit 309f7af

6 files changed

Lines changed: 86 additions & 10 deletions

File tree

SPECS/perl-Module-Implementation/perl-Module-Implementation.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
Name: perl-Module-Implementation
1212
Version: 0.09
13-
Release: 25%{?dist}
13+
Release: 26%{?dist}
1414
Summary: Loads one of several alternate underlying implementations for a module
1515
License: Artistic 2.0
1616
Vendor: Microsoft Corporation
@@ -45,6 +45,7 @@ BuildRequires: perl(lib)
4545
BuildRequires: perl(Test::Fatal) >= 0.006
4646
BuildRequires: perl(Test::More) >= 0.96
4747
BuildRequires: perl(Test::Requires)
48+
BuildRequires: perl(blib)
4849
%if %{with perl_Module_Implementation_enables_optional_test}
4950
# ===================================================================
5051
# Optional test requirements
@@ -131,6 +132,9 @@ make test
131132
%{_mandir}/man3/Module::Implementation.3*
132133

133134
%changelog
135+
* Wed May 21 2025 Riken Maharjan <rmaharjan@microsoft.com> - 0.09-26
136+
- Fix ptest byadding missing test dep.
137+
134138
* Wed Aug 28 2024 Neha Agarwal <nehaagarwal@microsoft.com> - 0.09-25
135139
- Promote package to Core repository.
136140
- License verified.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
diff -urN Net-SSLeay-1.92/t/local/33_x509_create_cert.t Net-SSLeay-1.92/t/local/33_x509_create_cert.t
2+
--- Net-SSLeay-1.92/t/local/33_x509_create_cert.t 2021-09-28 22:15:32.000000000 +0000
3+
+++ Net-SSLeay-1.92/t/local/33_x509_create_cert.t 2025-05-21 19:23:50.928133272 +0000
4+
@@ -53,7 +53,8 @@
5+
#set organizationName via add_entry_by_txt
6+
ok(Net::SSLeay::X509_NAME_add_entry_by_txt($name, "organizationName", MBSTRING_UTF8, "Company Name"), "X509_NAME_add_entry_by_txt");
7+
8+
- ok(Net::SSLeay::X509_set_version($x509, 3), "X509_set_version");
9+
+ my $x509_version_3 = (defined &Net::SSLeay::X509_VERSION_3) ? Net::SSLeay::X509_VERSION_3() : 2; # Note: X509_VERSION_3 is 2
10+
+ ok(Net::SSLeay::X509_set_version($x509, $x509_version_3), "X509_set_version");
11+
ok(my $sn = Net::SSLeay::X509_get_serialNumber($x509), "X509_get_serialNumber");
12+
13+
my $pubkey = Net::SSLeay::X509_get_X509_PUBKEY($x509);
14+
@@ -96,7 +97,7 @@
15+
ok(my $sha1_digest = Net::SSLeay::EVP_get_digestbyname("sha1"), "EVP_get_digestbyname");
16+
ok(Net::SSLeay::X509_sign($x509, $ca_pk, $sha1_digest), "X509_sign");
17+
18+
- is(Net::SSLeay::X509_get_version($x509), 3, "X509_get_version");
19+
+ is(Net::SSLeay::X509_get_version($x509), $x509_version_3, "X509_get_version");
20+
is(Net::SSLeay::X509_verify($x509, Net::SSLeay::X509_get_pubkey($ca_cert)), 1, "X509_verify");
21+
22+
like(my $crt_pem = Net::SSLeay::PEM_get_string_X509($x509), qr/-----BEGIN CERTIFICATE-----/, "PEM_get_string_X509");
23+
@@ -184,7 +185,8 @@
24+
#49 = NID_pkcs9_unstructuredName - XXX-TODO add new constant
25+
ok(Net::SSLeay::X509_REQ_add1_attr_by_NID($req, 49, MBSTRING_ASC, 'Any Uns.name'), "X509_REQ_add1_attr_by_NID");
26+
27+
- ok(Net::SSLeay::X509_REQ_set_version($req, 2), "X509_REQ_set_version");
28+
+ my $x509_req_version_1 = (defined &Net::SSLeay::X509_REQ_VERSION_1) ? Net::SSLeay::X509_REQ_VERSION_1() : 0; # Note: X509_REQ_VERSION_1 is 0
29+
+ ok(Net::SSLeay::X509_REQ_set_version($req, $x509_req_version_1), "X509_REQ_set_version");
30+
31+
ok(my $sha1_digest = Net::SSLeay::EVP_get_digestbyname("sha1"), "EVP_get_digestbyname");
32+
ok(Net::SSLeay::X509_REQ_sign($req, $pk, $sha1_digest), "X509_REQ_sign");
33+
@@ -192,7 +194,7 @@
34+
ok(my $req_pubkey = Net::SSLeay::X509_REQ_get_pubkey($req), "X509_REQ_get_pubkey");
35+
is(Net::SSLeay::X509_REQ_verify($req, $req_pubkey), 1, "X509_REQ_verify");
36+
37+
- is(Net::SSLeay::X509_REQ_get_version($req), 2, "X509_REQ_get_version");
38+
+ is(Net::SSLeay::X509_REQ_get_version($req), $x509_req_version_1, "X509_REQ_get_version");
39+
ok(my $obj_challengePassword = Net::SSLeay::OBJ_txt2obj('1.2.840.113549.1.9.7'), "OBJ_txt2obj");
40+
ok(my $nid_challengePassword = Net::SSLeay::OBJ_obj2nid($obj_challengePassword), "OBJ_obj2nid");
41+
is(Net::SSLeay::X509_REQ_get_attr_count($req), 3, "X509_REQ_get_attr_count");
42+
@@ -214,7 +216,8 @@
43+
44+
## PHASE2 - turn X509_REQ into X509 cert + sign with CA key
45+
ok(my $x509ss = Net::SSLeay::X509_new(), "X509_new");
46+
- ok(Net::SSLeay::X509_set_version($x509ss, 2), "X509_set_version");
47+
+ my $x509_version_3 = (defined &Net::SSLeay::X509_VERSION_3) ? Net::SSLeay::X509_VERSION_3() : 2; # Note: X509_VERSION_3 is 2
48+
+ ok(Net::SSLeay::X509_set_version($x509ss, $x509_version_3), "X509_set_version");
49+
ok(my $sn = Net::SSLeay::X509_get_serialNumber($x509ss), "X509_get_serialNumber");
50+
Net::SSLeay::P_ASN1_INTEGER_set_hex($sn, 'ABCDEF');
51+
Net::SSLeay::X509_set_issuer_name($x509ss, Net::SSLeay::X509_get_subject_name($ca_cert));

SPECS/perl-Net-SSLeay/perl-Net-SSLeay.spec

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
Summary: Perl extension for using OpenSSL
22
Name: perl-Net-SSLeay
33
Version: 1.92
4-
Release: 5%{?dist}
4+
Release: 6%{?dist}
55
License: Artistic 2.0
66
Group: Development/Libraries
77
URL: https://metacpan.org/pod/distribution/Net-SSLeay/lib/Net/SSLeay.pod
88
Source: https://cpan.metacpan.org/modules/by-module/Net/Net-SSLeay-%{version}.tar.gz
99
Patch0: 0001-local-tests-skip-2-failing-tests.patch
10+
Patch1: compatible-openssl.patch
11+
1012
%if 0%{?with_fips:1}
1113
Source100: openssl-fips-2.0.9-lin64.tar.gz
1214
%endif
@@ -49,7 +51,7 @@ Net::SSLeay module basically comprise of:
4951

5052
%prep
5153
%setup -q -n Net-SSLeay-%{version}
52-
%patch 0 -p1
54+
%autopatch -p1
5355

5456
%build
5557
%if 0%{?with_fips:1}
@@ -81,6 +83,9 @@ make test
8183
%{_mandir}/man?/*
8284

8385
%changelog
86+
* Wed May 21 2025 Riken Maharjan <rmaharjan@microsoft.com> - 1.92-6
87+
- Fix ptest by adding upstream fix to the test.
88+
8489
* Mon Aug 05 2024 Daniel McIlvaney <damcilva@microsoft.com> - 1.92-5
8590
- Fix bad capitalization of perl(AutoLoader)
8691

SPECS/perl-URI/perl-URI.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Name: perl-URI
55
Version: 5.21
6-
Release: 1%{?dist}
6+
Release: 2%{?dist}
77
Summary: A Perl module implementing URI parsing and manipulation
88
License: GPL+ or Artistic
99
Vendor: Microsoft Corporation
@@ -42,6 +42,8 @@ BuildRequires: perl(Storable)
4242
BuildRequires: perl(Test)
4343
BuildRequires: perl(Test::More) >= 0.96
4444
BuildRequires: perl(Test::Needs)
45+
BuildRequires: perl(Test::Fatal)
46+
BuildRequires: perl(Test::Warnings)
4547
# Runtime
4648
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
4749
Requires: perl(Cwd)
@@ -90,6 +92,9 @@ make test
9092
%{_mandir}/man3/URI::*.3*
9193

9294
%changelog
95+
* Wed May 21 2025 Riken Maharjan <rmaharjan@microsoft.com> - 5.21-2
96+
- Fix ptest by adding missing runtime dep
97+
9398
* Mon Dec 18 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.21-1
9499
- Auto-upgrade to 5.21 - Azure Linux 3.0 - package upgrades
95100

SPECS/rubygem-introspection/rubygem-introspection.spec

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Summary: Dynamic inspection of the hierarchy of method definitions on a Ruby object
33
Name: rubygem-%{gem_name}
44
Version: 0.0.4
5-
Release: 13%{?dist}
5+
Release: 14%{?dist}
66
License: MIT
77
Vendor: Microsoft Corporation
88
Distribution: Azure Linux
@@ -50,12 +50,16 @@ cp Rakefile %{buildroot}%{gem_instdir}/
5050
cp Gemfile %{buildroot}%{gem_instdir}/
5151

5252
%check
53-
pushd .%{gem_instdir}
5453
# Disable Bundler.
55-
sed -i '/bundler\/setup/ d' test/test_helper.rb
56-
54+
# Drop BlankSlate test case. There should be no need for BlankSlate, when
55+
# there is BasicObject available for years.
56+
# https://github.com/floehopper/introspection/issues/11
57+
sed -i -e '/require.*blankslate/ s/^/#/' \
58+
-e '/def test_should_cope_with_blankslate_object$/a\\ skip' \
59+
test/snapshot_test.rb
60+
61+
sed -i '/require "bundler\/setup"/ d' test/test_helper.rb
5762
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
58-
popd
5963

6064
%files
6165
%license %{gem_instdir}/COPYING.txt
@@ -73,6 +77,9 @@ popd
7377
%doc %{gem_docdir}
7478

7579
%changelog
80+
* Wed May 21 2025 Riken Maharjan <rmaharjan@microsoft.com> - 0.0.4-14
81+
- Fix ptest by not using bundler and skiping a known failing test case using Fedora 42 (License: MIT)
82+
7683
* Tue Mar 22 2022 Neha Agarwal <nehaagarwal@microsoft.com> - 0.0.4-13
7784
- Build from .tar.gz source.
7885

SPECS/rubygem-metaclass/rubygem-metaclass.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Adds a metaclass method to all Ruby objects
44
Name: rubygem-%{gem_name}
55
Version: 0.0.4
6-
Release: 16%{?dist}
6+
Release: 17%{?dist}
77
License: MIT
88
Vendor: Microsoft Corporation
99
Distribution: Azure Linux
@@ -36,13 +36,17 @@ gem install -V --local --force --install-dir %{buildroot}/%{gemdir} %{gem_name}-
3636
%check
3737
# test_helper.rb currently references bundler, so it is easier to avoid
3838
# its usage at all.
39+
sed -i '/require "bundler\/setup"/ d' test/test_helper.rb
3940
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
4041

4142
%files
4243
%defattr(-,root,root,-)
4344
%{gemdir}
4445

4546
%changelog
47+
* Wed May 21 2025 Riken Maharjan <rmaharjan@microsoft.com> - 0.0.4-17
48+
- Fix ptest by not using bundler
49+
4650
* Tue Jul 19 2022 Neha Agarwal <nehaagarwal@microsoft.com> - 0.0.4-16
4751
- Add provides, add missing files, remove doc package
4852

0 commit comments

Comments
 (0)