diff --git a/definitions/features/satellite.rb b/definitions/features/satellite.rb index 724535497..cb17444de 100644 --- a/definitions/features/satellite.rb +++ b/definitions/features/satellite.rb @@ -11,7 +11,7 @@ class Features::Satellite < ForemanMaintain::Feature end def target_version - '6.16' + satellite_maintain_target_version end def current_version diff --git a/definitions/scenarios/satellite_upgrade.rb b/definitions/scenarios/satellite_upgrade.rb index 6036aac82..ae8de8f00 100644 --- a/definitions/scenarios/satellite_upgrade.rb +++ b/definitions/scenarios/satellite_upgrade.rb @@ -4,15 +4,14 @@ def self.upgrade_metadata(&block) metadata do tags :upgrade_scenario confine do - (feature(:instance).downstream&.current_minor_version == '6.15' || \ - ForemanMaintain.upgrade_in_progress == '6.16') + feature(:instance).downstream&.satellite_upgrade_allowed? end instance_eval(&block) end end def target_version - '6.16' + feature(:instance).downstream&.satellite_maintain_target_version end end diff --git a/lib/foreman_maintain/concerns/downstream.rb b/lib/foreman_maintain/concerns/downstream.rb index f96f1e04f..5562c8784 100644 --- a/lib/foreman_maintain/concerns/downstream.rb +++ b/lib/foreman_maintain/concerns/downstream.rb @@ -46,8 +46,24 @@ def fm_pkg_and_cmd_name %w[satellite-maintain satellite-maintain] end + def satellite_maintain_target_version + satellite_maintain_config[:current_sat_version] + end + + def satellite_upgrade_allowed? + current_minor_version == satellite_maintain_config[:previous_sat_version] || \ + ForemanMaintain.upgrade_in_progress == satellite_maintain_config[:current_sat_version] + end + private + def satellite_maintain_config + { + 'current_sat_version': '6.16', + 'previous_sat_version': '6.15', + } + end + def rh_repos(server_version) server_version = version(server_version) rh_repos = main_rh_repos