Am 30.01.25 um 12:31 schrieb Daniel Herzig: > @@ -393,6 +410,25 @@ $pci_module->mock( > } > ); > > +my $pve_storage_plugin_module = > Test::MockModule->new("PVE::Storage::Plugin"); > +$pve_storage_plugin_module->mock( > + activate_storage => sub { > + return 1; > + }, > +); > + > +my $pve_storage_cifsplugin_module = > Test::MockModule->new("PVE::Storage::CIFSPlugin"); > +$pve_storage_cifsplugin_module->mock( > + check_connection => sub { > + return 1; > + }, > + cifs_is_mounted => sub { > + my ($scfg, $mountdata) = @_; > + my ($mountpoint, $server, $share) = $scfg->@{'path', 'server', 'share'}; > + return $mountpoint; > + }, > +); > +
Can't we avoid mocking PVE::Storage::Plugin and PVE::Storage::CIFSPlugin? It should be enough to just mock the top-level storage API from PVE::Storage. Ideally, the qemu-server package should not have any idea how the storage package works internally. You can add conditionals for the storage IDs if you need specific behavior for certain storages. > sub diff($$) { > my ($a, $b) = @_; > return if $a eq $b; _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel