Skip to content

Commit

Permalink
Merge pull request #6120 from rwx788/storage_ng
Browse files Browse the repository at this point in the history
Fix tests for storage ng new UI on TW
  • Loading branch information
okurz committed Nov 7, 2018
2 parents 17c3201 + c8893d2 commit 0f3b551
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
11 changes: 7 additions & 4 deletions lib/partition_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ our %partition_roles = qw(

# We got changes to the storage-ng UI in SLE 15 SP1, Leap 15.1 and TW
sub is_storage_ng_newui {
return is_storage_ng && (is_sle('15-SP1+') || is_leap('15.1+') || is_tumbleweed || get_var('STORAGE_NG_NEW_UI'));
return is_storage_ng && (
is_sle('15-SP1+')
|| (is_opensuse && !is_leap('<15.1'))
|| get_var('STORAGE_NG_NEW_UI')
);
}

sub wipe_existing_partitions_storage_ng {
Expand Down Expand Up @@ -78,7 +82,6 @@ sub create_new_partition_table {

# empty disk partitions by creating new partition table
my $expert_menu_key = (is_storage_ng) ? 'alt-r' : 'alt-x'; # expert menu keys
$expert_menu_key = 'alt-e' if is_tumbleweed;

if (is_storage_ng_newui) {
# partition table management has been moved from Partitions tab to Overview
Expand All @@ -104,9 +107,9 @@ sub create_new_partition_table {
send_key $table_type_hotkey{$table_type};
assert_screen "partition-table-$table_type-selected";
send_key((is_storage_ng) ? $cmd{next} : $cmd{ok}); # OK
send_key 'alt-p' if (is_storage_ng and (!is_tumbleweed)); # return back to Partitions tab
send_key 'alt-p' if (is_storage_ng); # return back to Partitions tab
}
unless (is_storage_ng and (!is_tumbleweed)) {
unless (is_storage_ng) {
assert_screen 'partition-create-new-table';
send_key 'alt-y';
}
Expand Down
6 changes: 3 additions & 3 deletions tests/installation/partitioning_splitusr.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ sub run {
send_key "home";
wait_still_screen(2);
send_key_until_needlematch 'root-partition-selected', 'down', 5, 2; # Select root partition
# Resize has been moved under drop down button Modify in storage-ng
if (is_storage_ng and (!is_tumbleweed)) {

# Resize has been moved under drop down button Modify in storage-ng
if (is_storage_ng) {
wait_screen_change { send_key 'alt-m' };
wait_still_screen(2);
send_key 'down' for (0 .. 1);
save_screenshot;
send_key 'ret';
}

wait_screen_change { send_key $cmd{resize} }; # Resize
send_key 'alt-u'; # Custom size
send_key $cmd{size_hotkey} if is_storage_ng;
Expand Down
3 changes: 1 addition & 2 deletions tests/installation/partitioning_warnings.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use warnings;
use base 'y2logsstep';
use testapi;
use partition_setup qw(create_new_partition_table addpart addboot);
use version_utils qw(is_opensuse is_storage_ng is_tumbleweed);
use version_utils qw(is_opensuse is_storage_ng);

sub process_warning {
my (%args) = @_;
Expand Down Expand Up @@ -52,7 +52,6 @@ sub process_missing_special_partitions {

sub remove_partition {
my $remove_key = (is_storage_ng) ? 'alt-e' : 'alt-t';
$remove_key = 'alt-t' if is_tumbleweed;
wait_screen_change { send_key($remove_key) };
assert_screen 'remove-partition';
send_key 'alt-y';
Expand Down

0 comments on commit 0f3b551

Please sign in to comment.