Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(CAT-1928) Update Supported OS on new module to match what is expected #1381

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading