Skip to content

Commit

Permalink
Merge pull request #1381 from puppetlabs/CAT-1928
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 authored Jul 30, 2024
2 parents 3b2a385 + 4bbcdcc commit 68e5ea2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
24 changes: 16 additions & 8 deletions lib/pdk/module/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,46 @@ class Metadata
'RedHat based Linux' => [
{
'operatingsystem' => 'CentOS',
'operatingsystemrelease' => ['7']
'operatingsystemrelease' => ['7', '8', '9']
},
{
'operatingsystem' => 'OracleLinux',
'operatingsystemrelease' => ['7']
},
{
'operatingsystem' => 'RedHat',
'operatingsystemrelease' => ['8']
'operatingsystemrelease' => ['7', '8', '9']
},
{
'operatingsystem' => 'Scientific',
'operatingsystemrelease' => ['7']
},
{
'operatingsystem' => 'Rocky',
'operatingsystemrelease' => ['8']
},
{
'operatingsystem' => 'AlmaLinux',
'operatingsystemrelease' => ['8']
}
],
'Debian based Linux' => [
{
'operatingsystem' => 'Debian',
'operatingsystemrelease' => ['10']
'operatingsystemrelease' => ['10', '11', '12']
},
{
'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => ['18.04']
'operatingsystemrelease' => ['18.04', '20.04', '22.04']
}
],
'Fedora' => {
'operatingsystem' => 'Fedora',
'operatingsystemrelease' => ['29']
'operatingsystemrelease' => ['40']
},
'OSX' => {
'operatingsystem' => 'Darwin',
'operatingsystemrelease' => ['16']
'operatingsystemrelease' => ['21', '22', '23']
},
'SLES' => {
'operatingsystem' => 'SLES',
Expand All @@ -52,11 +60,11 @@ class Metadata
},
'Windows' => {
'operatingsystem' => 'windows',
'operatingsystemrelease' => ['2019', '10']
'operatingsystemrelease' => ['2019', '2022', '10', '11']
},
'AIX' => {
'operatingsystem' => 'AIX',
'operatingsystemrelease' => ['6.1', '7.1', '7.2']
'operatingsystemrelease' => ['7.2', '7.3']
}
}.freeze

Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/new_module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'template-ref' => match(%r{(main-)|(^(tags/)?(\d+)\.(\d+)\.(\d+))}),
'operatingsystem_support' => include(
'operatingsystem' => 'Debian',
'operatingsystemrelease' => ['10']
'operatingsystemrelease' => ['10', '11', '12']
)
)
end
Expand Down
26 changes: 18 additions & 8 deletions spec/unit/pdk/generate/module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@
]
end

# rubocop:disable RSpec/ExampleLength
it 'populates the Metadata object based on user input' do
expect(interview_metadata).to include(
'name' => 'foo-bar',
Expand All @@ -392,35 +393,44 @@
'operatingsystem_support' => [
{
'operatingsystem' => 'CentOS',
'operatingsystemrelease' => ['7']
'operatingsystemrelease' => ['7', '8', '9']
},
{
'operatingsystem' => 'OracleLinux',
'operatingsystemrelease' => ['7']
},
{
'operatingsystem' => 'RedHat',
'operatingsystemrelease' => ['8']
'operatingsystemrelease' => ['7', '8', '9']
},
{
'operatingsystem' => 'Scientific',
'operatingsystemrelease' => ['7']
},
{
'operatingsystem' => 'Rocky',
'operatingsystemrelease' => ['8']
},
{
'operatingsystem' => 'AlmaLinux',
'operatingsystemrelease' => ['8']
},
{
'operatingsystem' => 'Debian',
'operatingsystemrelease' => ['10']
'operatingsystemrelease' => ['10', '11', '12']
},
{
'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => ['18.04']
'operatingsystemrelease' => ['18.04', '20.04', '22.04']
},
{
'operatingsystem' => 'windows',
'operatingsystemrelease' => ['2019', '10']
'operatingsystemrelease' => ['2019', '2022', '10', '11']
}
]
)
end
# rubocop:enable RSpec/ExampleLength

it 'saves the forge username to the answer file' do
expect(answers['forge_username']).to eq('foo')
Expand Down Expand Up @@ -649,9 +659,9 @@
expect(interview_metadata['operatingsystem_support']).not_to be_nil

[
{ 'operatingsystem' => 'Debian', 'operatingsystemrelease' => ['10'] },
{ 'operatingsystem' => 'Ubuntu', 'operatingsystemrelease' => ['18.04'] },
{ 'operatingsystem' => 'windows', 'operatingsystemrelease' => ['2019', '10'] },
{ 'operatingsystem' => 'Debian', 'operatingsystemrelease' => ['10', '11', '12'] },
{ 'operatingsystem' => 'Ubuntu', 'operatingsystemrelease' => ['18.04', '20.04', '22.04'] },
{ 'operatingsystem' => 'windows', 'operatingsystemrelease' => ['2019', '2022', '10', '11'] },
{ 'operatingsystem' => 'Solaris', 'operatingsystemrelease' => ['11'] }
].each do |expected_os|
expect(interview_metadata['operatingsystem_support']).to include(expected_os)
Expand Down

0 comments on commit 68e5ea2

Please sign in to comment.