Diskmanage: change parttype uuid detection

previously ceph included a udev rule to populate
/dev/disk/by-parttypeuuid/

but not anymore, so we now use 'lsblk --json -o path,parttype' to
get a mapping between parttype uuid and partition

fix the test by simulating empty lsblk output

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2019-07-12 12:13:49 +02:00
committed by Fabian Grünbichler
parent 1c5dfef226
commit 8cd6d7e8e3
2 changed files with 85 additions and 47 deletions

View File

@ -54,9 +54,14 @@ sub mocked_run_command {
@$outputlines = split(/\n/, read_test_file('pvs'));
} elsif ($cmd->[0] =~ m/lvs/i) {
@$outputlines = split(/\n/, read_test_file('lvs'));
} elsif ($cmd->[0] =~ m/lsblk/i) {
my $content = read_test_file('lsblk');
if ($content eq '') {
$content = '{}';
}
@$outputlines = split(/\n/, $content);
} else {
print "unexpected run_command call: '@$cmd', aborting\n";
die;
die "unexpected run_command call: '@$cmd', aborting\n";
}
} else {
print "unexpected run_command call: '@$cmd', aborting\n";