Skip to content

Commit 01c9bc5

Browse files
waynechen55alice-suse
authored andcommitted
Output disk information in automation
Output disk information in automation to facilitate information lookup on disks which benefits the latest updates collecting and avoids manual intervention.
1 parent 3fe38c3 commit 01c9bc5

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

lib/utils.pm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ our @EXPORT = qw(
146146
parse_json
147147
inspect_existing_issue
148148
dump_tasktrace
149+
show_all_disks
149150
);
150151

151152
our @EXPORT_OK = qw(
@@ -3716,4 +3717,14 @@ sub dump_tasktrace {
37163717
select_console($old_console, await_console => 0);
37173718
}
37183719

3720+
=head2 show_all_disks
3721+
3722+
Output information about all disks on system to facilitate convenient and quick
3723+
information lookup on the fly without manual intervention.
3724+
=cut
3725+
3726+
sub show_all_disks {
3727+
record_info('Disk info', script_output('lsblk -p -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT,WWN;ls -ahl /dev/disk/by-id;df -ah', proceed_on_failure => 1));
3728+
}
3729+
37193730
1;

tests/virt_autotest/prepare_non_transactional_server.pm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ sub run {
2929

3030
$self->prepare_ground;
3131
$self->prepare_console;
32+
$self->prepare_storages;
3233
$self->prepare_extensions;
3334
$self->prepare_packages;
3435
$self->prepare_bootloader;
@@ -61,6 +62,12 @@ sub prepare_console {
6162
select_backend_console(init => 0);
6263
}
6364

65+
sub prepare_storages {
66+
my $self = shift;
67+
68+
show_all_disks;
69+
}
70+
6471
sub prepare_extensions {
6572
my $self = shift;
6673

tests/virt_autotest/prepare_transactional_server.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ sub prepare_in_trup_shell {
4141
sub prepare_on_active_system {
4242
my $self = shift;
4343

44+
show_all_disks;
4445
double_check_xen_role if (is_xen_host and is_sle('>=16.1') and is_disk_image);
4546
check_kvm_modules if (is_kvm_host and is_sle('>=16.1') and is_disk_image);
4647
$self->prepare_services;

0 commit comments

Comments
 (0)