-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change needle-based installation testing to libyui
Perform testing with libyui REST API since the version of the product where it is available, SP3 and above. Related ticket: https://progress.opensuse.org/issues/112574
- Loading branch information
Showing
7 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
lib/Installation/ModuleRegistration/ModuleRegCodeController.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright 2022 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
|
||
# Summary: The class introduces business actions for Module Registration Code dialog. | ||
# | ||
# Maintainer: QE YaST <qa-sle-yast@suse.de> | ||
|
||
package Installation::ModuleRegistration::ModuleRegCodeController; | ||
use strict; | ||
use warnings; | ||
use Installation::ModuleRegistration::ModuleRegCodePage; | ||
use Installation::Popups::UntrustedGPGPopup; | ||
use YuiRestClient; | ||
|
||
sub new { | ||
my ($class, $args) = @_; | ||
my $self = bless {}, $class; | ||
return $self->init($args); | ||
} | ||
|
||
sub init { | ||
my ($self, $args) = @_; | ||
$self->{ModuleRegCodePage} = Installation::ModuleRegistration::ModuleRegCodePage->new({app => YuiRestClient::get_app()}); | ||
$self->{UntrustedGPGKeyPopup} = Installation::Popups::UntrustedGPGPopup->new({app => YuiRestClient::get_app()}); | ||
return $self; | ||
} | ||
|
||
sub get_module_regcode_page { | ||
my ($self) = @_; | ||
die "Module Registration Code page is not displayed" unless $self->{ModuleRegCodePage}->is_shown(); | ||
return $self->{ModuleRegCodePage}; | ||
} | ||
|
||
sub get_untrusted_GPG_popup { | ||
my ($self) = @_; | ||
die "Untrusted GPG key popup is not displayed" unless $self->{UntrustedGPGKeyPopup}->is_shown(); | ||
return $self->{UntrustedGPGKeyPopup}; | ||
} | ||
|
||
sub wait_regcode_page { | ||
my ($self, $args) = @_; | ||
YuiRestClient::Wait::wait_until(object => sub { | ||
$self->{ModuleRegCodePage}->is_shown({timeout => 0}); | ||
}, %$args); | ||
} | ||
|
||
sub license_workstation_ext_module { | ||
my ($self, $regcode) = @_; | ||
$self->get_module_regcode_page()->set_we_code($regcode); | ||
$self->get_module_regcode_page()->press_next(); | ||
} | ||
|
||
sub handle_untrusted_gpg_key { | ||
my ($self) = @_; | ||
$self->get_untrusted_GPG_popup()->press_trust(); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright 2022 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
|
||
# Summary: The module provides interface to act with page that ask for module extra registration code | ||
# | ||
# Maintainer: QE YaST <qa-sle-yast@suse.de> | ||
|
||
package Installation::ModuleRegistration::ModuleRegCodePage; | ||
use parent 'Installation::Navigation::NavigationBase'; | ||
use strict; | ||
use warnings; | ||
|
||
sub new { | ||
my ($class, $args) = @_; | ||
my $self = bless { | ||
app => $args->{app} | ||
}, $class; | ||
return $self->init(); | ||
} | ||
|
||
sub init { | ||
my ($self) = @_; | ||
$self->SUPER::init(); | ||
$self->{tb_we_code} = $self->{app}->textbox({id => '"sle-we"'}); | ||
return $self; | ||
} | ||
|
||
sub is_shown { | ||
my ($self) = @_; | ||
return $self->{tb_we_code}->exist(); | ||
} | ||
|
||
sub set_we_code { | ||
my ($self, $code) = @_; | ||
$self->{tb_we_code}->set($code); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright 2022 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
|
||
# Summary: The class introduces methods to handle | ||
# a Trust&Import popup. | ||
# Maintainer: QE YaST <qa-sle-yast@suse.de> | ||
|
||
package Installation::Popups::UntrustedGPGPopup; | ||
use strict; | ||
use warnings; | ||
|
||
sub new { | ||
my ($class, $args) = @_; | ||
my $self = bless { | ||
app => $args->{app} | ||
}, $class; | ||
return $self->init(); | ||
} | ||
|
||
sub init { | ||
my $self = shift; | ||
$self->{btn_trust} = $self->{app}->button({id => 'trust'}); | ||
return $self; | ||
} | ||
|
||
sub is_shown { | ||
my ($self) = @_; | ||
$self->{btn_trust}->exist(); | ||
} | ||
|
||
sub press_trust { | ||
my ($self) = @_; | ||
$self->{btn_trust}->click(); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name: qam-yast_self_update_libyui-rest | ||
description: installation using self_update as boot parameter | ||
vars: | ||
YUI_REST_API: 1 | ||
schedule: | ||
- installation/bootloader_start | ||
- installation/setup_libyui | ||
- installation/product_selection/install_SLES | ||
- installation/validate_self_update | ||
- installation/licensing/accept_license | ||
- installation/registration/register_via_scc | ||
- installation/module_registration/register_modules | ||
- installation/add_on_product/skip_install_addons | ||
- installation/system_role | ||
- installation/partitioning | ||
- installation/partitioning_finish | ||
- installation/installer_timezone | ||
- installation/hostname_inst | ||
- installation/user_settings | ||
- installation/user_settings_root | ||
- 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 | ||
- '{{efi}}' | ||
conditional_schedule: | ||
efi: | ||
MACHINE: | ||
uefi: | ||
- console/consoletest_setup | ||
- console/verify_efi_mok |
33 changes: 33 additions & 0 deletions
33
tests/installation/module_registration/register_modules.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright 2021 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
|
||
# Summary: Register Application module | ||
# in "Extension and Module Selection" dialog | ||
# Medium: Online (you see the "Hide Development versions" checkbox) | ||
# | ||
# Maintainer: QA SLE YaST team <qa-sle-yast@suse.de> | ||
|
||
use base 'y2_installbase'; | ||
use strict; | ||
use warnings; | ||
use testapi; | ||
|
||
sub run { | ||
$testapi::distri->get_module_registration()->register_modules([qw(workstation basesystem development legacy containers python3 desktop)]); | ||
save_screenshot; | ||
my $timeout = 2400 * get_var('TIMEOUT_SCALE', 1); | ||
$testapi::distri->get_module_regcode()->wait_regcode_page({ | ||
timeout => $timeout, | ||
interval => 2, | ||
message => 'Page to insert module registration code did not appear'}); | ||
# some modules (e.g. workstation) require registration, provide code | ||
my $regcode = get_var('SCC_REGCODE_WE'); | ||
$testapi::distri->get_module_regcode()->license_workstation_ext_module($regcode); | ||
save_screenshot; | ||
# confirm to trust the untrusted GPG key | ||
$testapi::distri->get_module_regcode()->handle_untrusted_gpg_key(); | ||
} | ||
|
||
1; |