Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
125 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
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,53 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2009-2013 Bernhard M. Wiedemann | ||
# Copyright © 2012-2018 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: Simple LVM thin provisioning check | ||
# Maintainer: Martin Loviska <mloviska@suse.com> | ||
|
||
use strict; | ||
use warnings; | ||
use base "opensusebasetest"; | ||
use testapi; | ||
use utils; | ||
use y2logsstep; | ||
use serial_terminal 'select_virtio_console'; | ||
|
||
sub run { | ||
select_virtio_console(); | ||
record_info('INFO', 'Print lvm setup'); | ||
assert_script_run 'lsblk'; | ||
assert_script_run 'lvmdiskscan'; | ||
assert_script_run 'lvscan'; | ||
assert_script_run 'lvs -a'; | ||
assert_script_run 'pvs -a'; | ||
# thin volume does not exceed thin pool size in our tests | ||
#my $thin_volume_size = script_output q[lvs | grep Vwi | awk '{print $(NF-1)}' | cut -d'.' -f 1]; | ||
my @volumes = split(/\n/, script_output q[lvscan | awk '{print $2}'| sed s/\'//g]); | ||
|
||
foreach (@volumes) { | ||
chomp; | ||
assert_script_run "lvdisplay $_"; | ||
} | ||
|
||
record_info('INFO', 'Create a file on thin volume'); | ||
my $test_file = '/home/bernhard/test_file.txt'; | ||
assert_script_run "dd if=/dev/zero of=$test_file count=1024 bs=1M"; | ||
assert_script_run "ls -lah /home/bernhard/test_file.txt2"; | ||
assert_script_run 'lvs -a'; | ||
} | ||
|
||
sub post_fail_hook { | ||
my $self = shift; | ||
select_console 'root-console'; | ||
$self->save_and_upload_log('lvmdump', '/tmp/lvmdump_output'); | ||
} | ||
|
||
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,62 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2009-2013 Bernhard M. Wiedemann | ||
# Copyright © 2012-2018 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: LVM thin provisioning setup | ||
# Maintainer: Martin Loviska <mloviska@suse.com> | ||
|
||
use strict; | ||
use warnings; | ||
use base 'y2logsstep'; | ||
use testapi; | ||
use partition_setup qw(create_new_partition_table addpart addlv); | ||
use version_utils 'is_storage_ng'; | ||
|
||
sub addvg { | ||
my (%args) = @_; | ||
|
||
assert_screen 'expert-partitioner'; | ||
send_key $cmd{system_view}; | ||
send_key_until_needlematch('volume_management_feature', 'down'); | ||
send_key $cmd{addpart}; | ||
wait_still_screen 2; | ||
save_screenshot; | ||
send_key 'down'; | ||
send_key 'ret'; | ||
assert_screen 'partition-add-volume-group'; | ||
send_key 'alt-v'; | ||
type_string $args{name}; | ||
wait_screen_change { send_key 'tab' } for (0 .. 1); | ||
wait_screen_change { send_key 'spc' }; | ||
assert_screen 'partition-select-first-from-top'; | ||
send_key 'alt-a'; | ||
wait_still_screen 2; | ||
save_screenshot; | ||
send_key(is_storage_ng() ? $cmd{next} : $cmd{finish}); | ||
} | ||
|
||
sub run { | ||
create_new_partition_table; | ||
# create boot and 2 lvm partitions | ||
addpart(role => 'raw', fsid => 'bios-boot', size => 2); | ||
addpart(role => 'raw', size => 10000); | ||
addpart(role => 'raw'); | ||
# create volume group for root and swap non thin lvs | ||
addvg(name => 'vg-no-thin'); | ||
addlv(name => 'lv-swap', role => 'swap', size => 2000); | ||
addlv(name => 'lv-root', role => 'OS'); | ||
# create volume group for thin lv | ||
addvg(name => 'vg-thin'); | ||
addlv(name => 'thin_pool', thinpool => 1); | ||
addlv(name => 'thin_lv_home', role => 'data', thinvolume => 1); | ||
send_key $cmd{accept}; | ||
|
||
} | ||
|
||
1; |