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

enable the correct module during the capsule upgrade #892

Merged
merged 1 commit into from
Jun 26, 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
4 changes: 4 additions & 0 deletions definitions/features/capsule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ def current_version
def package_name
'satellite-capsule'
end

def module_name
'satellite-capsule'
end
end
4 changes: 4 additions & 0 deletions definitions/features/satellite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def package_name
'satellite'
end

def module_name
'satellite'
end

private

def version_from_source
Expand Down
2 changes: 1 addition & 1 deletion definitions/scenarios/satellite_upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def compose
if el8?
modules_to_switch = ['postgresql:13']
add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
modules_to_enable = ["satellite:#{el_short_name}"]
modules_to_enable = ["#{feature(:instance).downstream.module_name}:#{el_short_name}"]
add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
end
add_step(Procedures::Packages::Update.new(
Expand Down
39 changes: 39 additions & 0 deletions test/definitions/scenarios/satellite_upgrade_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
require 'test_helper'

module Scenarios
describe Scenarios::Satellite::Migrations do
include DefinitionsTestHelper

let(:scenario) do
Scenarios::Satellite::Migrations.new
end

it 'composes all steps for Satellite on EL8' do
assume_feature_present(:satellite)
Scenarios::Satellite::Migrations.any_instance.stubs(:el_major_version).returns(8)
assert_scenario_has_step(scenario, Procedures::Packages::EnableModules) do |step|
assert_equal(['satellite:el8'], step.options['module_names'])
end
end

it 'composes all steps for Satellite on EL9' do
assume_feature_present(:satellite)
Scenarios::Satellite::Migrations.any_instance.stubs(:el_major_version).returns(9)
refute_scenario_has_step(scenario, Procedures::Packages::EnableModules)
end

it 'composes all steps for Capsule on EL8' do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look mom, I wrote tests! ;-)

assume_feature_present(:capsule)
Scenarios::Satellite::Migrations.any_instance.stubs(:el_major_version).returns(8)
assert_scenario_has_step(scenario, Procedures::Packages::EnableModules) do |step|
assert_equal(['satellite-capsule:el8'], step.options['module_names'])
end
end

it 'composes all steps for Capsule on EL9' do
assume_feature_present(:capsule)
Scenarios::Satellite::Migrations.any_instance.stubs(:el_major_version).returns(9)
refute_scenario_has_step(scenario, Procedures::Packages::EnableModules)
end
end
end
Loading