Skip to content

Commit

Permalink
Moved profile generation to boot Agama step
Browse files Browse the repository at this point in the history
  • Loading branch information
okynos committed Jan 30, 2025
1 parent 860343f commit 0213b41
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/Distribution/Opensuse/AgamaDevel.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use Yam::Agama::Pom::RebootTextmodePage;
use Yam::Agama::Pom::EnterPassphraseBasePage;
use Yam::Agama::Pom::EnterPassphraseForRootPage;
use Yam::Agama::Pom::EnterPassphraseForSwapPage;
use Yam::Agama::Pom::ProfileGenerator;

use Utils::Architectures;

Expand Down Expand Up @@ -70,4 +71,8 @@ sub get_enter_passphrase_for_swap {
});
}

sub get_profile_generator {
return Yam::Agama::Pom::ProfileGenerator->new();
}

1;
37 changes: 37 additions & 0 deletions lib/Yam/Agama/Pom/ProfileGenerator.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SUSE's openQA tests
#
# Copyright 2025 SUSE LLC
# SPDX-License-Identifier: FSFAP

# Summary: Handles Agama auto profile generation.
# Maintainer: QE YaST and Migration (QE Yam) <qe-yam at suse de>

package Yam::Agama::Pom::ProfileGenerator;
use strict;
use warnings;
use testapi;
use autoyast qw(upload_profile);

sub new {
my ($class, $args) = @_;
return bless {}, $class;
}

sub generate_profile {
my ($self) = @_;
my $profile_name = "profile.jsonnet";

system("sudo", "zypper", "-n", "removerepo", "systemsmanagement_Agama_Devel");
system("sudo", "zypper", "-n", "addrepo", "-f", "-G",
"https://download.opensuse.org/repositories/systemsmanagement:Agama:Devel/15.6/systemsmanagement:Agama:Devel.repo");
system("sudo", "zypper", "-n", "install", "-f", "golang-github-google-jsonnet");
my $casedir = get_required_var('CASEDIR');
my $profile_content = `jsonnet $casedir/data/yam/agama/auto/sle.jsonnet`;

save_tmp_file($profile_name, $profile_content);

my $profile_url = autoinst_url . "/files/$profile_name";
upload_profile(path => $profile_name, profile => $profile_content);
}

1;
1 change: 0 additions & 1 deletion schedule/yam/agama_lvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: agama lvm
description: >
Perform agama installation with LVM.
schedule:
- yam/agama/generate_agama_profile
- yam/agama/boot_agama
- yam/agama/patch_agama_tests
- yam/agama/agama
Expand Down
2 changes: 2 additions & 0 deletions tests/yam/agama/boot_agama.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ sub run {
return;
}

my $profile_generator = $testapi::distri->get_profile_generator();
my $grub_menu = $testapi::distri->get_grub_menu_agama();
my $grub_entry_edition = $testapi::distri->get_grub_entry_edition();
my $agama_up_an_running = $testapi::distri->get_agama_up_an_running();
Expand All @@ -63,6 +64,7 @@ sub run {

$grub_menu->expect_is_shown();
$grub_menu->edit_current_entry();
$profile_generator->generate_profile();
$grub_entry_edition->move_cursor_to_end_of_kernel_line();
$grub_entry_edition->type(\@params);
$grub_entry_edition->boot();
Expand Down

0 comments on commit 0213b41

Please sign in to comment.