all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] test: migrate: correctly mock storage module
@ 2021-02-08 14:26 Fabian Ebner
  2021-02-08 15:26 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2021-02-08 14:26 UTC (permalink / raw)
  To: pve-devel

by fixing a typo. Since cfs_read_file within the storage module was not mocked,
the tests could fail on some setups. Now that get_bandwidth_limit is mocked,
cfs_read_file is not called anymore, but still mock it too for good measure and
to make it more future-proof.

Reported-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 test/MigrationTest/Shared.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/MigrationTest/Shared.pm b/test/MigrationTest/Shared.pm
index d7aeb36..6552465 100644
--- a/test/MigrationTest/Shared.pm
+++ b/test/MigrationTest/Shared.pm
@@ -140,9 +140,10 @@ $storage_module->mock(
     config => sub {
 	return $storage_config;
     },
-    get_bandwitdth_limit => sub {
+    get_bandwidth_limit => sub {
 	return 123456;
     },
+    cfs_read_file => $mocked_cfs_read_file,
 );
 
 our $storage_plugin_module = Test::MockModule->new("PVE::Storage::Plugin");
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH qemu-server] test: migrate: correctly mock storage module
  2021-02-08 14:26 [pve-devel] [PATCH qemu-server] test: migrate: correctly mock storage module Fabian Ebner
@ 2021-02-08 15:26 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-02-08 15:26 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Ebner

On 08.02.21 15:26, Fabian Ebner wrote:
> by fixing a typo. Since cfs_read_file within the storage module was not mocked,
> the tests could fail on some setups. Now that get_bandwidth_limit is mocked,
> cfs_read_file is not called anymore, but still mock it too for good measure and
> to make it more future-proof.
> 
> Reported-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  test/MigrationTest/Shared.pm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-08 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 14:26 [pve-devel] [PATCH qemu-server] test: migrate: correctly mock storage module Fabian Ebner
2021-02-08 15:26 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal