Skip to content

Commit

Permalink
Add option to create a solver test case
Browse files Browse the repository at this point in the history
During the migration we may run into a situation where a package shows up
on the migrated system and we need to understand why this happened. Creating
a solver test case allows us to debug such issues.
  • Loading branch information
rjschwei committed Jan 16, 2025
1 parent d1bd170 commit 147f1f2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
19 changes: 16 additions & 3 deletions doc/adoc/user_guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
[#art-suse-migration-services]

= Using the SUSE Distribution Migration System
Marcus Schäfer; Jesús Velázquez; Keith Berger
Marcus Schäfer; Jesús Velázquez; Keith Berger; Robert Schweikert

:toc:
:icons: font
:numbered:

:Authors: Marcus Schäfer, Jesús Bermúdez Velázquez, Keith Berger
:Authors: Marcus Schäfer, Jesús Bermúdez Velázquez, Keith Berger, Robert Schweikert
:Latest_Version: 1.2.0
:Contributors:
:Repo: https://github.com/SUSE/suse-migration-services[suse-migration-services]
Expand Down Expand Up @@ -312,7 +312,8 @@ verbose_migration: true|false

Enable the fix option for pre_checks::
If enabled (default), the run_pre_checks systemd process will use the `--fix`
option to automatically remediate applicable issues before the migration is started.
option to automatically remediate applicable issues before the migration
is started.
+
[listing]
----
Expand All @@ -332,6 +333,18 @@ independent initrd can be created by setting
build_host_independent_initrd: true|false
----

Configure Dependency Solver Test Case Generation::
It is possible that during the migration packages get installed that were not
on the system previously and are pulled in because of dependencies. This
setting will setup the migration such that a solver test case is generated.
The information form the test case can then be used to understand why a
given package was installed.
+
[listing]
----
debug_solver: true|false
----

== Run the Migration
Migration can be triggered either via run_migration or via reboot.

Expand Down
4 changes: 4 additions & 0 deletions suse_migration_services/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,7 @@ def get_proxy_path():
@staticmethod
def get_zypp_config_path():
return '/etc/zypp/zypp.conf'

@staticmethod
def get_zypp_gen_solver_test_case():
return ''
3 changes: 3 additions & 0 deletions suse_migration_services/migration_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def get_migration_config_file_content(self):
def is_verbosity_requested(self):
return self.config_data.get('verbose_migration', False)

def is_zypp_solver_test_case_requested(self):
return self.config_data.get('debug_solver', False)

def _write_config_file(self):
with open(self.migration_config_file, 'w') as config:
yaml.dump(self.config_data, config, default_flow_style=False)
4 changes: 4 additions & 0 deletions suse_migration_services/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,9 @@
'pre_checks_fix': {
'required': False,
'type': 'boolean'
},
'debug_solver': {
'required': False,
'type': 'boolean'
}
}
8 changes: 7 additions & 1 deletion suse_migration_services/units/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ def main():
log.info('Update env variables')
update_env(migration_config.get_preserve_info())
log_env(log)
verbose_migration = '--verbose' if migration_config.is_verbosity_requested() else '--no-verbose'
verbose_migration = '--no-verbose'
if migration_config.is_verbosity_requested():
verbose_migration = '--verbose'
solver_case = Defaults.get_zypp_gen_solver_test_case()
if migration_config.is_zypp_solver_test_case_requested():
solver_case = '--debug-solver'
if migration_config.is_zypper_migration_plugin_requested():
bash_command = ' '.join(
[
'zypper', 'migration',
verbose_migration,
solver_case,
'--non-interactive',
'--gpg-auto-import-keys',
'--no-selfupdate',
Expand Down

0 comments on commit 147f1f2

Please sign in to comment.