Commit 9f692ffe authored by Harald Sitter's avatar Harald Sitter

merge upgrade logic in base and livetest

livetest is based on basetest, so we can simply move the method there
(I'd assume). and then use the same code paths in both variants
parent 82eae4d4
......@@ -89,6 +89,25 @@ sub logout {
assert_and_click ('ksmserver-logout');
}
sub _upgrade {
if (!get_var('OPENQA_APT_UPGRADE')) {
return
}
if (get_var('OPENQA_INSTALLATION_OFFLINE')) {
die 'You cannot upgrade on an offline test!!!'
}
assert_script_sudo 'apt update', 2 * 60;
my $pkgs = get_var('OPENQA_APT_UPGRADE');
if ($pkgs eq "all") {
$pkgs = "dist-upgrade";
} else {
$pkgs = "install " . $pkgs;
}
assert_script_sudo 'DEBIAN_FRONTEND=noninteractive apt -y ' . $pkgs, 30 * 60;
}
sub boot_to_dm {
my ($self, %args) = @_;
$args{run_setup} //= 1;
......@@ -119,17 +138,7 @@ sub boot_to_dm {
assert_script_run 'wget ' . data_url('basetest_setup.rb'), 60;
assert_script_sudo 'ruby basetest_setup.rb', 60;
# FIXME: copy pasta from install core.pm
if (get_var('OPENQA_APT_UPGRADE')) {
assert_script_sudo 'apt update', 2 * 60;
my $pkgs = get_var('OPENQA_APT_UPGRADE');
if ($pkgs eq "all") {
$pkgs = "dist-upgrade";
} else {
$pkgs = "install " . $pkgs;
}
assert_script_sudo 'DEBIAN_FRONTEND=noninteractive apt -y ' . $pkgs, 30 * 60;
}
$self->_upgrade;
}
select_console 'x11';
$self->{boot_setup_ran} = 1;
......
......@@ -65,25 +65,6 @@ sub _secureboot {
assert_screen 'mokutil-sb-on';
}
sub _upgrade {
if (!get_var('OPENQA_APT_UPGRADE')) {
return
}
if (get_var('OPENQA_INSTALLATION_OFFLINE')) {
die 'You cannot upgrade on an offline test!!!'
}
assert_script_sudo 'apt update', 2 * 60;
my $pkgs = get_var('OPENQA_APT_UPGRADE');
if ($pkgs eq "") {
$pkgs = "dist-upgrade";
} else {
$pkgs = "install " . $pkgs;
}
assert_script_sudo 'DEBIAN_FRONTEND=noninteractive apt -y ' . $pkgs, 30 * 60;
}
sub offline {
my ($self, $args) = @_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment