Skip to content

Commit

Permalink
[virtualization][MU]: Set PATCH_WITH_ZYPPER and UPDATE_PACKAGE in code
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-suse committed Jul 12, 2024
1 parent bbb6f28 commit 77ff7f9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lib/main_common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2434,9 +2434,37 @@ sub load_host_installation_modules {
loadtest "installation/reboot_after_installation";
}

sub set_mu_virt_vars {
# Set UPDATE_PACKAGE based on BUILD(format example, BUILD=:33310:dtb-armv7l)
my $BUILD = get_var('BUILD', '');
$BUILD =~ /^:(\d+):([^:]+)$/im;

die "BUILD value is $BUILD, but does not match required format." if (!$2);

my $_pkg = $2;
my $_update_package = '';
if ($_pkg =~ /qemu|xen|virt-manager|libguestfs|libslirp|open-vm-tools/) {
$_update_package = $_pkg;
} elsif ($_pkg =~ /libvirt/) {
$_update_package = 'libvirt-client';
} else {
$_update_package = 'kernel-default';
}

set_var('UPDATE_PACKAGE', $_update_package);
bmwqemu::save_vars();
diag("BUILD is $BUILD, UPDATE_PACKAGE is set to " . get_var('UPDATE_PACKAGE', ''));

# Set PATCH_WITH_ZYPPER
set_var('PATCH_WITH_ZYPPER', 1) unless (check_var('PATCH_WITH_ZYPPER', 0));
}

sub load_hypervisor_tests {
return unless (get_var('HOST_HYPERVISOR') =~ /xen|kvm|qemu/);

# Some vars will affect loadtest logic, so need to be run on top
set_mu_virt_vars;

if (check_var('ENABLE_HOST_INSTALLATION', 1)) {
if (get_var('AUTOYAST')) {
loadtest "autoyast/prepare_profile";
Expand Down

0 comments on commit 77ff7f9

Please sign in to comment.