From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 qemu-server 1/2] tests: mock storage locking for migration tests
Date: Mon, 11 Jan 2021 15:00:23 +0100 [thread overview]
Message-ID: <20210111140024.13377-1-f.ebner@proxmox.com> (raw)
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
next reply other threads:[~2021-01-11 14:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-11 14:00 Fabian Ebner [this message]
2021-01-11 14:00 ` [pve-devel] [PATCH v2 qemu-server 2/2] tests: remove migration test run dir with make clean Fabian Ebner
2021-01-12 8:03 ` [pve-devel] [PATCH v2 qemu-server 1/2] tests: mock storage locking for migration tests Fabian Ebner
2021-01-12 11:07 ` Thomas Lamprecht
2021-01-15 7:47 ` Fabian Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210111140024.13377-1-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox