so the test still works when it's not installed.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
my $LVS = "/sbin/lvs";
my $LSBLK = "/bin/lsblk";
+sub check_bin {
+ my ($path) = @_;
+
+ return -x $path;
+}
+
sub verify_blockdev_path {
my ($rel_path) = @_;
my ($lsblk_info) = @_;
my $res = {};
- return {} if ! -x $ZPOOL;
+ return {} if !check_bin($ZPOOL);
# use zpool and parttype uuid,
# because log and cache do not have
return 1;
});
print("\tMocked dir_is_empty\n");
+$diskmanage_module->mock('check_bin' => sub { return 1; });
+print("\tMocked check_bin\n");
my $tools_module= new Test::MockModule('PVE::ProcFSTools', no_auto => 1);
$tools_module->mock('parse_proc_mounts' => \&mocked_parse_proc_mounts);
print("\tMocked parse_proc_mounts\n");