Skip to content

Commit

Permalink
Use unified method to open expert partitioner module
Browse files Browse the repository at this point in the history
Use open() method from YaST::Module to open the YaST module.
  • Loading branch information
Oleksandr Orlov committed Mar 16, 2021
1 parent 90f8e3c commit 6c96cfb
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions tests/yast2_gui/yast2_expert_partitioner.pm
Expand Up @@ -39,6 +39,7 @@ use warnings;
use testapi;
use YuiRestClient;
use scheduler 'get_test_suite_data';
use YaST::Module;

my $partitioner;
my $test_data;
Expand All @@ -49,16 +50,13 @@ sub pre_run_hook {
}

sub open_expert_partitioner {
my ($self) = shift;
$self->launch_yast2_module_x11('storage', extra_vars => get_var('YUI_PARAMS'));
YuiRestClient::connect_to_app_running_system();
YaST::Module::open({module => 'storage', ui => 'qt'});
$partitioner->get_confirmation_warning_controller()->confirm_only_use_if_familiar();
}

sub add_custom_partition {
my ($self) = shift;
my $disk = $test_data->{disks}[0];
$self->open_expert_partitioner;
open_expert_partitioner;
$partitioner->add_partition_on_gpt_disk({
disk => $disk->{name},
partition => $disk->{partitions}[0]
Expand All @@ -82,8 +80,7 @@ sub verify_custom_partition {
}

sub resize_custom_partition {
my ($self) = shift;
$self->open_expert_partitioner;
open_expert_partitioner;
$partitioner->resize_partition({
disk => $test_data->{disks}[0]->{name},
partition => $test_data->{disks}[0]->{partitions}[1]
Expand All @@ -96,8 +93,7 @@ sub verify_resized_partition {
}

sub delete_resized_partition {
my ($self) = shift;
$self->open_expert_partitioner;
open_expert_partitioner;
$partitioner->delete_partition({
disk => $test_data->{disks}[0]->{name},
partition => $test_data->{disks}[0]->{partitions}[1]
Expand All @@ -106,8 +102,7 @@ sub delete_resized_partition {
}

sub add_logical_volumes {
my ($self) = shift;
$self->open_expert_partitioner;
open_expert_partitioner;
$partitioner->setup_lvm($test_data->{lvm});
$partitioner->show_summary_and_accept_changes();
}
Expand All @@ -123,26 +118,24 @@ sub verify_logical_volumes {
}

sub delete_volume_group {
my ($self) = shift;
$self->open_expert_partitioner;
open_expert_partitioner;
my $vg = $test_data->{lvm}->{volume_groups}[0];

$partitioner->delete_volume_group($vg->{name});
$partitioner->show_summary_and_accept_changes();
}

sub run {
my ($self) = shift;
select_console "x11";

$self->add_custom_partition;
add_custom_partition;
verify_custom_partition;
$self->resize_custom_partition;
resize_custom_partition;
verify_resized_partition;
$self->delete_resized_partition;
$self->add_logical_volumes;
delete_resized_partition;
add_logical_volumes;
verify_logical_volumes;
$self->delete_volume_group;
delete_volume_group;
}

1;

0 comments on commit 6c96cfb

Please sign in to comment.