Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
mloviska committed Aug 6, 2018
1 parent ec1fac5 commit 783b431
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/partition_setup.pm
Expand Up @@ -17,7 +17,7 @@ use testapi;
use version_utils 'is_storage_ng';
use installation_user_settings 'await_password_check';

our @EXPORT = qw(addpart addlv create_new_partition_table enable_encryption_guided_setup select_first_hard_disk take_first_disk %partition_roles);
our @EXPORT = qw(addpart addlv addvg create_new_partition_table enable_encryption_guided_setup select_first_hard_disk take_first_disk %partition_roles);

our %partition_roles = qw(
OS alt-o
Expand Down
25 changes: 20 additions & 5 deletions tests/console/lvm_thin_check.pm
Expand Up @@ -20,6 +20,13 @@ use y2logsstep;
use serial_terminal 'select_virtio_console';

sub run {
my $lv_stats = {
write_access => 'read/write',
status => 'available',
readahead => 'auto',
block_device => "\d+:\d"
};

select_virtio_console();
record_info('INFO', 'Print lvm setup');
assert_script_run 'lsblk';
Expand All @@ -29,24 +36,32 @@ sub run {
assert_script_run 'pvs -a';
# thin volume does not exceed thin pool size in our tests
my @volumes = split(/\n/, script_output q[lvscan | awk '{print $2}'| sed s/\'//g]);

# check for read only volumes and
foreach (@volumes) {
chomp;
assert_script_run "lvdisplay $_";
foreach (keys %{$lv_stats}) {
chomp;
assert_script_run "lvdisplay $_ | grep $lv_stats->{$_}";
}
}

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 $test_file";
assert_script_run 'lvs -a | tee instant_usage';
assert_script_run 'diff original_usage instant_usage';
if ((assert_script_run 'diff original_usage instant_usage') != 1) {
die "LVM usage stats do not differ!";
}
}

sub post_fail_hook {
my $self = shift;
select_console 'root-console';
$self->save_and_upload_log('lvmdump', '/tmp/lvmdump_output');
my $lvmdump_regex = "\/root\/ldmdump-.*-\d+\.tgz";
if (script_output 'lvmdump' =~ /(?<lvmdump_gzip>$lvmdump_regex)/) {
upload_logs "$+{lvmdump_gzip}";
}
$self->save_and_upload_log('lvm dumpconfig', '/tmp/lvm_dumpconf.out');
}

1;
Expand Down
2 changes: 1 addition & 1 deletion tests/installation/partitioning_lvm_thin_provisioning.pm
Expand Up @@ -15,7 +15,7 @@ use strict;
use warnings;
use base 'y2logsstep';
use testapi;
use partition_setup qw(create_new_partition_table addpart addlv);
use partition_setup qw(create_new_partition_table addpart addlv addvg);
use version_utils 'is_storage_ng';

sub run {
Expand Down

0 comments on commit 783b431

Please sign in to comment.