Skip to content

Commit c222602

Browse files
authored
Merge pull request #2795 from puppetlabs/backport_4.15.0
Backport 4.15.0
2 parents e9f7bd5 + fc561c9 commit c222602

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+558
-495
lines changed

.github/actions/presuite.rb

Lines changed: 0 additions & 157 deletions
This file was deleted.

.github/workflows/acceptance_tests.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
rubocop_checks:
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-latest
1515
name: RuboCop
1616
steps:
1717
- name: Checkout current PR

.github/workflows/integration_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
- {os: ubuntu-22.04, ruby: '3.2'} # with openssl 3
2323
- {os: ubuntu-22.04, ruby: 'jruby-9.3.14.0'}
2424
- {os: ubuntu-latest, ruby: 'jruby-9.4.8.0'}
25-
- {os: windows-2019, ruby: '2.7'}
26-
- {os: windows-2019, ruby: '3.2'} # with openssl 3
25+
- {os: windows-2022, ruby: '2.7'}
26+
- {os: windows-2022, ruby: '3.2'} # with openssl 3
2727
runs-on: ${{ matrix.cfg.os }}
2828
env:
2929
BUNDLE_SET: 'with integration'

.github/workflows/unit_tests.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
- '3.2'
2525
- 'jruby-9.3.14.0'
2626
- 'jruby-9.4.8.0'
27-
runs-on: ubuntu-20.04
27+
# 24.04 doesn't support older jruby versions, so use 22.04 as middle ground
28+
# When we drop testing against puppet7, then we can use newer ubuntu.
29+
runs-on: ubuntu-22.04
2830
steps:
2931
- name: Checkout current PR
3032
uses: actions/checkout@v4
@@ -43,7 +45,7 @@ jobs:
4345
ruby:
4446
- '2.7'
4547
- '3.2'
46-
runs-on: windows-2019
48+
runs-on: windows-2022
4749
steps:
4850
- name: Checkout current PR
4951
uses: actions/checkout@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ build-iPhoneSimulator/
5353
.rvmrc
5454

5555
.rspec_status
56+
.rspec_integration_status
5657
Gemfile.lock
5758
Gemfile.local
5859
acceptance/vendor

.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ require:
1111
- rubocop-performance
1212
- rubocop-rspec
1313

14+
plugins:
15+
- rubocop-factory_bot
16+
- rubocop-capybara
17+
1418
Layout/LineLength:
1519
Enabled: false
1620

@@ -43,6 +47,7 @@ Naming/MethodName:
4347
Exclude:
4448
- 'spec/mocks/win32ole.rb'
4549
- 'spec/mocks/ffi.rb'
50+
- 'spec/facter/util/windows/network_utils_spec.rb'
4651

4752
Naming/PredicateName:
4853
Exclude:

Rakefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ require 'open3'
55
require 'rspec/core/rake_task'
66
require 'facter/version'
77

8-
Dir.glob(File.join('tasks/**/*.rake')).each { |file| load file }
9-
108
task default: :spec
119

1210
desc 'Generate changelog'

acceptance/lib/facter/acceptance/base_fact_utils.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def debian_expected_facts(agent)
118118

119119
# el (RedHat, Centos)
120120
def el_expected_facts(agent)
121-
version = agent['platform'].match(/(el|centos)-(\d)/)
121+
version = agent['platform'].match(/(el|centos)-(\d+)/)
122122
os_version = if version.nil?
123123
/\d+/
124124
else
@@ -143,6 +143,11 @@ def el_expected_facts(agent)
143143
os_distro_description = /Rocky Linux release #{os_version}\.\d+ \(.+\)/
144144
os_distro_id = 'Rocky'
145145
os_distro_release_full = /#{os_version}\.\d+/
146+
when /rhel/
147+
os_name = 'RedHat'
148+
os_distro_description = /Red Hat Enterprise Linux( Server)? release #{os_version}\.\d+( Beta)? \(\w+\)/
149+
os_distro_id = /^RedHatEnterprise(Server)?$/
150+
os_distro_release_full = /#{os_version}\.\d+/
146151
when /centos/
147152
os_name = 'CentOS'
148153
os_distro_description = /CentOS( Linux)? release #{os_version}\.\d+(\.\d+)? \(\w+\)/
@@ -154,6 +159,7 @@ def el_expected_facts(agent)
154159
os_distro_id = /^RedHatEnterprise(Server)?$/
155160
os_distro_release_full = /#{os_version}\.\d+/
156161
end
162+
157163
if agent['platform'] =~ /x86_64/
158164
os_arch = 'x86_64'
159165
os_hardware = 'x86_64'
@@ -190,7 +196,7 @@ def el_expected_facts(agent)
190196
expected_facts['os.release.minor'] = /(\d+)?/
191197
expected_facts['processors.count'] = /[1-9]/
192198
expected_facts['processors.physicalcount'] = /[1-9]/
193-
expected_facts['processors.isa'] = os_hardware
199+
expected_facts['processors.isa'] = /unknown|#{os_hardware}/
194200
expected_facts['processors.models'] = processor_model_pattern
195201
expected_facts['kernel'] = 'Linux'
196202
expected_facts['kernelrelease'] = /\d+\.\d+\.\d+/
@@ -437,6 +443,8 @@ def windows_expected_facts(agent)
437443
os_version = '2019'
438444
elsif agent['platform'] =~ /2022/
439445
os_version = '2022'
446+
elsif agent['platform'] =~ /2025/
447+
os_version = '2025'
440448
else
441449
fail_test "Unknown Windows version #{agent['platform']}"
442450
end

acceptance/tests/custom_facts/using_win32ole_should_not_hang.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
setcode do
1010
require 'win32ole'
1111
locator = WIN32OLE.new('WbemScripting.SWbemLocator')
12-
locator.ConnectServer('', "root/CIMV2", '', '', nil, nil, nil, nil).to_s
12+
locator.ConnectServer('', "root/CIMV2", '', '', nil, nil, nil, nil).class.to_s
1313
end
1414
end
1515
EOM
@@ -26,7 +26,7 @@
2626
# Test is assumed to have hung if it takes longer than 5 seconds.
2727
Timeout::timeout(5) do
2828
on agent, facter('--custom-dir', custom_dir, 'custom_fact_ole') do |facter_result|
29-
assert_match(/#<WIN32OLE:0x[0-9a-f]+>/, facter_result.stdout.chomp, 'Custom fact output does not match expected output')
29+
assert_match(/WIN32OLE/, facter_result.stdout.chomp, 'Custom fact output does not match expected output')
3030
end
3131
end
3232
end

0 commit comments

Comments
 (0)