Skip to content

Commit

Permalink
enable the correct module during the capsule upgrade
Browse files Browse the repository at this point in the history
Fixes: 041af1e
  • Loading branch information
evgeni committed Jun 26, 2024
1 parent fa6db1e commit a421bd5
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
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
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

0 comments on commit a421bd5

Please sign in to comment.