* [pve-devel] [PATCH qemu-server] tests: mock storage locking for migration tests
@ 2021-01-11 12:34 Fabian Ebner
2021-01-11 13:08 ` Stefan Reiter
2021-01-12 11:02 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 2 replies; 3+ messages in thread
From: Fabian Ebner @ 2021-01-11 12:34 UTC (permalink / raw)
To: pve-devel
by doing it in a local directory instead of /var/lock/pve-manager, which is
used by the installed/non-test PVE code. This also covers the shared case,
which will become relevant after fixing #3229 (currently migration doesn't
touch disks on shared storages).
Reported-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
test/MigrationTest/Shared.pm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/test/MigrationTest/Shared.pm b/test/MigrationTest/Shared.pm
index c09562c..d7aeb36 100644
--- a/test/MigrationTest/Shared.pm
+++ b/test/MigrationTest/Shared.pm
@@ -145,6 +145,18 @@ $storage_module->mock(
},
);
+our $storage_plugin_module = Test::MockModule->new("PVE::Storage::Plugin");
+$storage_plugin_module->mock(
+ cluster_lock_storage => sub {
+ my ($class, $storeid, $shared, $timeout, $func, @param) = @_;
+
+ mkdir "${RUN_DIR_PATH}/lock";
+
+ my $path = "${RUN_DIR_PATH}/lock/pve-storage-${storeid}";
+ return PVE::Tools::lock_file($path, $timeout, $func, @param);
+ },
+);
+
our $systemd_module = Test::MockModule->new("PVE::Systemd");
$systemd_module->mock(
wait_for_unit_removed => sub {
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pve-devel] [PATCH qemu-server] tests: mock storage locking for migration tests
2021-01-11 12:34 [pve-devel] [PATCH qemu-server] tests: mock storage locking for migration tests Fabian Ebner
@ 2021-01-11 13:08 ` Stefan Reiter
2021-01-12 11:02 ` [pve-devel] applied: " Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Reiter @ 2021-01-11 13:08 UTC (permalink / raw)
To: Fabian Ebner, pve-devel
On 1/11/21 1:34 PM, Fabian Ebner wrote:
> by doing it in a local directory instead of /var/lock/pve-manager, which is
> used by the installed/non-test PVE code. This also covers the shared case,
> which will become relevant after fixing #3229 (currently migration doesn't
> touch disks on shared storages).
>
> Reported-by: Stefan Reiter <s.reiter@proxmox.com>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Fixes the issue, though it still fails if you have previously made a
build as root, since 'MigrationTest/run' will have the wrong
permissions. Maybe include that dir in 'make clean'?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pve-devel] applied: [PATCH qemu-server] tests: mock storage locking for migration tests
2021-01-11 12:34 [pve-devel] [PATCH qemu-server] tests: mock storage locking for migration tests Fabian Ebner
2021-01-11 13:08 ` Stefan Reiter
@ 2021-01-12 11:02 ` Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2021-01-12 11:02 UTC (permalink / raw)
To: Proxmox VE development discussion, Fabian Ebner
On 11.01.21 13:34, Fabian Ebner wrote:
> by doing it in a local directory instead of /var/lock/pve-manager, which is
> used by the installed/non-test PVE code. This also covers the shared case,
> which will become relevant after fixing #3229 (currently migration doesn't
> touch disks on shared storages).
>
> Reported-by: Stefan Reiter <s.reiter@proxmox.com>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> test/MigrationTest/Shared.pm | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
>
applied, thanks!
Added removing the MigrationTest/run runtime directory to the make clean
target(s) as Stefan suggested.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-12 11:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 12:34 [pve-devel] [PATCH qemu-server] tests: mock storage locking for migration tests Fabian Ebner
2021-01-11 13:08 ` Stefan Reiter
2021-01-12 11:02 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox