-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
820 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,3 +125,6 @@ Style/StderrPuts: | |
|
||
Metrics/ParameterLists: | ||
Max: 6 | ||
|
||
Style/TrailingCommaInArguments: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
module AssumeFeatureDependenciesHelper | ||
def assume_satellite_present(&block) | ||
PackageManagerTestHelper.assume_package_exist('satellite') | ||
assume_feature_present(:satellite) unless block_given? | ||
unless block_given? | ||
assume_feature_present(:satellite) | ||
assume_feature_present(:foreman_server) | ||
assume_feature_present(:katello) | ||
assume_feature_present(:candlepin) | ||
assume_feature_present(:foreman_tasks) | ||
assume_feature_present(:foreman_database) | ||
end | ||
assume_feature_present(:satellite, &block) | ||
end | ||
|
||
def assume_foreman_present | ||
PackageManagerTestHelper.assume_package_exist('foreman') | ||
assume_feature_present(:foreman_install) | ||
assume_feature_present(:foreman_server) | ||
assume_feature_present(:foreman_database) | ||
end | ||
|
||
def assume_katello_present | ||
PackageManagerTestHelper.assume_package_exist('katello') | ||
assume_feature_present(:foreman_server) | ||
assume_feature_present(:katello) | ||
assume_feature_present(:candlepin) | ||
assume_feature_present(:foreman_tasks) | ||
assume_feature_present(:foreman_database) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
require 'test_helper' | ||
|
||
describe "capsule upgrade scenarios" do | ||
include DefinitionsTestHelper | ||
|
||
before(:each) do | ||
assume_feature_present(:capsule) | ||
ForemanMaintain.config.stubs(:manage_crond).returns(true) | ||
end | ||
|
||
describe Scenarios::Satellite::PreUpgradeCheck do | ||
let(:scenario) do | ||
Scenarios::Satellite::PreUpgradeCheck.new | ||
end | ||
|
||
it 'composes all steps for Satellite on EL8' do | ||
Scenarios::Satellite::PreUpgradeCheck.any_instance.stubs(:el_major_version).returns(8) | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Checks::ServerPing, | ||
Checks::ServicesUp, | ||
Checks::SystemRegistration, | ||
Checks::CheckHotfixInstalled, | ||
Checks::CheckTmout, | ||
Checks::CheckUpstreamRepository, | ||
Checks::Disk::AvailableSpace, | ||
Checks::NonRhPackages, | ||
Checks::PackageManager::Dnf::ValidateDnfConfig, | ||
Checks::Repositories::CheckNonRhRepository, | ||
Checks::CheckIpv6Disable, | ||
Checks::Disk::AvailableSpacePostgresql13, | ||
Checks::CheckOrganizationContentAccessMode, | ||
Checks::Repositories::Validate, | ||
) | ||
end | ||
|
||
it 'composes all steps for Satellite on EL9' do | ||
Scenarios::Satellite::PreUpgradeCheck.any_instance.stubs(:el_major_version).returns(9) | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Checks::ServerPing, | ||
Checks::ServicesUp, | ||
Checks::SystemRegistration, | ||
Checks::CheckHotfixInstalled, | ||
Checks::CheckTmout, | ||
Checks::CheckUpstreamRepository, | ||
Checks::Disk::AvailableSpace, | ||
Checks::NonRhPackages, | ||
Checks::PackageManager::Dnf::ValidateDnfConfig, | ||
Checks::Repositories::CheckNonRhRepository, | ||
Checks::CheckIpv6Disable, | ||
Checks::Disk::AvailableSpacePostgresql13, | ||
Checks::CheckOrganizationContentAccessMode, | ||
Checks::Repositories::Validate, | ||
) | ||
end | ||
end | ||
|
||
describe Scenarios::Satellite::PreMigrations do | ||
let(:scenario) do | ||
Scenarios::Satellite::PreMigrations.new | ||
end | ||
|
||
it 'composes all steps for Satellite on EL8' do | ||
Scenarios::Satellite::PreMigrations.any_instance.stubs(:el_major_version).returns(8) | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Procedures::MaintenanceMode::EnableMaintenanceMode, | ||
Procedures::Crond::Stop, | ||
) | ||
end | ||
|
||
it 'composes all steps for Satellite on EL9' do | ||
Scenarios::Satellite::PreMigrations.any_instance.stubs(:el_major_version).returns(9) | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Procedures::MaintenanceMode::EnableMaintenanceMode, | ||
Procedures::Crond::Stop, | ||
) | ||
end | ||
end | ||
|
||
describe Scenarios::Satellite::Migrations do | ||
let(:scenario) do | ||
Scenarios::Satellite::Migrations.new | ||
end | ||
|
||
it 'composes all steps for Capsule on EL8' do | ||
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 | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Procedures::Repositories::Setup, | ||
Procedures::Packages::SwitchModules, | ||
Procedures::Packages::EnableModules, | ||
Procedures::Packages::Update, | ||
Procedures::Service::Stop, | ||
Procedures::Packages::Update, | ||
Procedures::Installer::Run, | ||
) | ||
end | ||
|
||
it 'composes all steps for Capsule on EL9' do | ||
Scenarios::Satellite::Migrations.any_instance.stubs(:el_major_version).returns(9) | ||
refute_scenario_has_step(scenario, Procedures::Packages::EnableModules) | ||
refute_scenario_has_step(scenario, Procedures::Packages::SwitchModules) | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Procedures::Repositories::Setup, | ||
Procedures::Packages::Update, | ||
Procedures::Service::Stop, | ||
Procedures::Packages::Update, | ||
Procedures::Installer::Run, | ||
) | ||
end | ||
end | ||
|
||
describe Scenarios::Satellite::PostMigrations do | ||
let(:scenario) do | ||
Scenarios::Satellite::PostMigrations.new | ||
end | ||
|
||
it 'composes all steps for Satellite on EL8' do | ||
Scenarios::Satellite::PostMigrations.any_instance.stubs(:el_major_version).returns(8) | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Procedures::RefreshFeatures, | ||
Procedures::Service::Start, | ||
Procedures::Crond::Start, | ||
Procedures::MaintenanceMode::DisableMaintenanceMode, | ||
) | ||
end | ||
|
||
it 'composes all steps for Satellite on EL9' do | ||
Scenarios::Satellite::PostMigrations.any_instance.stubs(:el_major_version).returns(9) | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Procedures::RefreshFeatures, | ||
Procedures::Service::Start, | ||
Procedures::Crond::Start, | ||
Procedures::MaintenanceMode::DisableMaintenanceMode, | ||
) | ||
end | ||
end | ||
|
||
describe Scenarios::Satellite::PostUpgradeChecks do | ||
let(:scenario) do | ||
Scenarios::Satellite::PostUpgradeChecks.new | ||
end | ||
|
||
it 'composes all steps for Satellite on EL8' do | ||
Scenarios::Satellite::PostUpgradeChecks.any_instance.stubs(:el_major_version).returns(8) | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Checks::ServerPing, | ||
Checks::ServicesUp, | ||
Checks::SystemRegistration, | ||
Procedures::Packages::CheckForReboot, | ||
Procedures::Pulpcore::ContainerHandleImageMetadata, | ||
Procedures::Repositories::IndexKatelloRepositoriesContainerMetatdata, | ||
) | ||
end | ||
|
||
it 'composes all steps for Satellite on EL9' do | ||
Scenarios::Satellite::PostUpgradeChecks.any_instance.stubs(:el_major_version).returns(9) | ||
|
||
assert_scenario_has_steps( | ||
scenario, | ||
Checks::ServerPing, | ||
Checks::ServicesUp, | ||
Checks::SystemRegistration, | ||
Procedures::Packages::CheckForReboot, | ||
Procedures::Pulpcore::ContainerHandleImageMetadata, | ||
Procedures::Repositories::IndexKatelloRepositoriesContainerMetatdata, | ||
) | ||
end | ||
end | ||
end |
Oops, something went wrong.