Skip to content

Commit

Permalink
Migration from mu released to mu unreleased
Browse files Browse the repository at this point in the history
Add upragde autoyast profile and yaml schedule files for migration from
mu released to mu unreleased testsuites.
  • Loading branch information
openQA web UI committed Apr 24, 2024
1 parent 94bb59f commit fd230b9
Show file tree
Hide file tree
Showing 3 changed files with 280 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<suse_register>
<do_registration config:type="boolean">true</do_registration>
<email><%= $get_var->('SCC_EMAIL') %></email>
<reg_code><%= $get_var->('SCC_REGCODE') %></reg_code>
<install_updates config:type="boolean">true</install_updates>
% if (keys %$addons) {
<addons config:type="list">
% while (my ($key, $addon) = each (%$addons)) {
<addon>
<name><%= $addon->{name} %></name>
<version><%= $addon->{version} %></version>
<arch><%= $addon->{arch} %></arch>
% if ($key eq 'we' and $check_var->('SLE_PRODUCT', 'sles')) {
<reg_code><%= $get_var->('SCC_REGCODE_WE') %></reg_code>
% }
% if ($key eq 'we' and $check_var->('SLE_PRODUCT', 'sled')) {
<reg_code><%= $get_var->('SCC_REGCODE') %></reg_code>
% }
% if ($key eq 'rt') {
<reg_code><%= $get_var->('SCC_REGCODE_RT') %></reg_code>
% }
% if ($key eq 'ltss') {
<reg_code><%= $get_var->('SCC_REGCODE_LTSS') %></reg_code>
% }
</addon>
% }
</addons>
%}
</suse_register>
<bootloader>
<global>
<timeout config:type="integer">45</timeout>
</global>
</bootloader>
<general>
<mode>
<confirm config:type="boolean">false</confirm>
</mode>
<signature-handling>
<accept_unsigned_file config:type="boolean">true</accept_unsigned_file>
<accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key>
<accept_non_trusted_gpg_key config:type="boolean">true</accept_non_trusted_gpg_key>
<import_gpg_key config:type="boolean">true</import_gpg_key>
</signature-handling>
</general>
<partitioning config:type="list">
<drive>
<initialize config:type="boolean">true</initialize>
<use>all</use>
</drive>
</partitioning>
<networking>
<interfaces config:type="list">
<interface>
<bootproto>dhcp</bootproto>
<device>eth0</device>
<dhclient_set_default_route>yes</dhclient_set_default_route>
<startmode>auto</startmode>
</interface>
</interfaces>
</networking>
<firewall>
<enable_firewall config:type="boolean">true</enable_firewall>
<start_firewall config:type="boolean">true</start_firewall>
<zones config:type="list">
<zone>
<name>public</name>
<interfaces config:type="list">
<interface>eth0</interface>
</interfaces>
<services config:type="list">
<service>ssh</service>
</services>
<ports config:type="list">
<port>22/tcp</port>
<port>30000-50000/tcp</port>
</ports>
</zone>
</zones>
</firewall>
<report>
<errors>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</errors>
<messages>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</messages>
<warnings>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</warnings>
<yesno_messages>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</yesno_messages>
</report>
<keyboard>
<keyboard_values>
<delay/>
<discaps config:type="boolean">false</discaps>
<numlock>bios</numlock>
<rate/>
</keyboard_values>
<keymap>english-us</keymap>
</keyboard>
<language>
<language>en_US</language>
<languages/>
</language>
<ntp-client>
<ntp_policy>auto</ntp_policy>
</ntp-client>
<software>
<products config:type="list">
<product><%= uc $get_var->('SLE_PRODUCT') %></product>
</products>
<patterns config:type="list">
% for my $pattern (@$patterns) {
<pattern><%= $pattern %></pattern>
% }
</patterns>
</software>
<services-manager>
% if ($check_var->('DESKTOP', 'gnome')) {
<default_target>graphical</default_target>
% }
% if ($check_var->('DESKTOP', 'textmode')) {
<default_target>multi-user</default_target>
% }
<services>
<disable config:type="list"/>
<enable config:type="list">
<service>sshd</service>
</enable>
</services>
</services-manager>
<timezone>
<hwclock>UTC</hwclock>
<timezone>Europe/Berlin</timezone>
</timezone>
<users config:type="list">
<user>
<encrypted config:type="boolean">false</encrypted>
<fullname>Bernhard M. Wiedemann</fullname>
<gid>100</gid>
<home>/home/bernhard</home>
<password_settings>
<expire/>
<flag/>
<inact>-1</inact>
<max>99999</max>
<min>0</min>
<warn>7</warn>
</password_settings>
<shell>/bin/bash</shell>
<uid>1000</uid>
<user_password>nots3cr3t</user_password>
<username>bernhard</username>
</user>
<user>
<encrypted config:type="boolean">false</encrypted>
<fullname>root</fullname>
<gid>0</gid>
<home>/root</home>
<password_settings>
<expire/>
<flag/>
<inact/>
<max/>
<min/>
<warn/>
</password_settings>
<shell>/bin/bash</shell>
<uid>0</uid>
<user_password>nots3cr3t</user_password>
<username>root</username>
</user>
</users>
<scripts>
<post-scripts config:type="list">
<script>
<filename>post.sh</filename>
<interpreter>shell</interpreter>
<source><![CDATA[
#!/bin/sh
# zypper process is locked by some ruby process, modify the repo file
cd /etc/zypp/repos.d
sed -i 's/enabled=1/enabled=0/' $(ls|grep -i nvidia)
zypper lr
% if ( $get_var->('VERSION') =~ /15-SP[3-5]/ ) {
# Regarding rpm lock see Q9@ https://documentation.suse.com/de-de/sles/15-SP1/html/SLES-all/app-ay-faq.html
# quote : "during the post-script phase, YaST still has an exclusive lock on the RPM database."
# the package cannot be installed the autoyast way, because of the changing package name (eg libyui-rest-api15)
# only zypper allows to install "by capability".
mv /var/run/zypp.pid /var/run/zypp.sav
zypper -n in libyui-rest-api
mv /var/run/zypp.sav /var/run/zypp.pid
% }
exit 0
]]></source>
</script>
</post-scripts>
</scripts>
</profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: migration_to_mu_unreleased
description: >
Performs a migration from system with released maintenance updates to a product with maintenance updates unreleased
schedule:
- migration/version_switch_origin_system
- boot/boot_to_desktop
- console/register_original_system
- migration/record_disk_info
- migration/reboot_to_upgrade
- migration/version_switch_upgrade_target
- installation/bootloader
- installation/welcome
- installation/upgrade_select
- installation/scc_registration
- installation/add_update_test_repo
- installation/addon_products_sle
- installation/resolve_dependency_issues
- installation/installation_overview
- installation/disable_grub_timeout
- installation/start_install
- installation/await_install
- installation/logs_from_installation_system
- installation/reboot_after_installation
- installation/grub_test
- installation/first_boot
- migration/post_upgrade
- console/consoletest_setup
- console/zypper_lr
- console/zypper_ref
34 changes: 34 additions & 0 deletions tests/console/register_original_system.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2018 SUSE LLC
# SPDX-License-Identifier: FSFAP

# Package: SUSEConnect
# Summary: Rrgister system and modules of the original system by SUSEConnect
# - Register product using SCC_REGCODE code
# - Register modules and extension
# - Check registering status
# Maintainer: QE YaST and Migration (QE Yam) <qe-yam at suse de>

use base "consoletest";
use strict;
use warnings;
use testapi;
use utils;
use migration;
use registration;

sub run {
select_console 'root-console';

my $scc_addons = get_var 'SCC_ADDONS_ORIGIN', '';
my $retries = 3; # number of retries to run SUSEConnect commands
register_product();
register_addons_cmd($scc_addons, $retries) if $scc_addons;
# Check registration status and repos
assert_script_run("zypper --gpg-auto-import-keys ref", timeout => 180, exitcode => [0, 106]);
assert_script_run("zypper lr | tee /dev/$serialdev");
assert_script_run("SUSEConnect --status-text | tee /dev/$serialdev", timeout => 60);
fully_patch_system;
disable_installation_repos;
}

1;

0 comments on commit fd230b9

Please sign in to comment.