public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 qemu-server 01/13] test: migration: add parse_volume_id calls
Date: Fri, 29 Jan 2021 16:11:31 +0100	[thread overview]
Message-ID: <20210129151143.10014-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210129151143.10014-1-f.ebner@proxmox.com>

so it fails when something bad comes in.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

New in v2, added because I ran into a problem with an early version of patch #12
which wasn't detected by the tests. See patch #12 for the details.

 test/MigrationTest/QemuMigrateMock.pm | 3 +++
 test/MigrationTest/QmMock.pm          | 2 ++
 test/MigrationTest/Shared.pm          | 4 ++++
 3 files changed, 9 insertions(+)

diff --git a/test/MigrationTest/QemuMigrateMock.pm b/test/MigrationTest/QemuMigrateMock.pm
index efd6130..2d424e0 100644
--- a/test/MigrationTest/QemuMigrateMock.pm
+++ b/test/MigrationTest/QemuMigrateMock.pm
@@ -221,6 +221,8 @@ $MigrationTest::Shared::storage_module->mock(
     vdisk_free => sub {
 	my ($scfg, $volid) = @_;
 
+	PVE::Storage::parse_volume_id($volid);
+
 	die "vdisk_free '$volid' error\n" if defined($fail_config->{vdisk_free})
 					  && $fail_config->{vdisk_free} eq $volid;
 
@@ -292,6 +294,7 @@ $MigrationTest::Shared::tools_module->mock(
 		    $cmd = shift @{$cmd_tail};
 		    if ($cmd eq 'free') {
 			my $volid = shift @{$cmd_tail};
+			PVE::Storage::parse_volume_id($volid);
 			return 1 if $fail_config->{ssh_pvesm_free}
 				 && $fail_config->{ssh_pvesm_free} eq $volid;
 			MigrationTest::Shared::remove_target_volid($volid);
diff --git a/test/MigrationTest/QmMock.pm b/test/MigrationTest/QmMock.pm
index 2f1fffc..2d5d5c6 100644
--- a/test/MigrationTest/QmMock.pm
+++ b/test/MigrationTest/QmMock.pm
@@ -86,6 +86,8 @@ $MigrationTest::Shared::storage_module->mock(
 	    $volid = "${storeid}:${name_without_extension}";
 	}
 
+	PVE::Storage::parse_volume_id($volid);
+
 	die "vdisk_alloc '$volid' error\n" if $fail_config->{vdisk_alloc}
 					   && $fail_config->{vdisk_alloc} eq $volid;
 
diff --git a/test/MigrationTest/Shared.pm b/test/MigrationTest/Shared.pm
index d7aeb36..e48b82c 100644
--- a/test/MigrationTest/Shared.pm
+++ b/test/MigrationTest/Shared.pm
@@ -23,6 +23,8 @@ my $test_vmid = $migrate_params->{vmid};
 sub add_target_volid {
     my ($volid) = @_;
 
+    PVE::Storage::parse_volume_id($volid);
+
     lock_file_full("${RUN_DIR_PATH}/target_volids.lock", undef, 0, sub {
 	my $target_volids = decode_json(file_get_contents("${RUN_DIR_PATH}/target_volids"));
 	die "target volid already present " if defined($target_volids->{$volid});
@@ -35,6 +37,8 @@ sub add_target_volid {
 sub remove_target_volid {
     my ($volid) = @_;
 
+    PVE::Storage::parse_volume_id($volid);
+
     lock_file_full("${RUN_DIR_PATH}/target_volids.lock", undef, 0, sub {
 	my $target_volids = decode_json(file_get_contents("${RUN_DIR_PATH}/target_volids"));
 	die "target volid does not exist " if !defined($target_volids->{$volid});
-- 
2.20.1





  reply	other threads:[~2021-01-29 15:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29 15:11 [pve-devel] [PATCH-SERIES v2 qemu-server] Cleanup migration code and improve migration disk cleanup Fabian Ebner
2021-01-29 15:11 ` Fabian Ebner [this message]
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 02/13] migration: split sync_disks into two functions Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 03/13] migration: avoid re-scanning all volumes Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 04/13] migration: split out config_update_local_disksizes from scan_local_volumes Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 05/13] migration: fix calculation of bandwith limit for non-disk migration Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 06/13] migration: save targetstorage and bwlimit in local_volumes hash and re-use information Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 07/13] migration: add nbd migrated volumes to volume_map earlier Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 08/13] migration: simplify removal of local volumes and get rid of self->{volumes} Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 09/13] migration: cleanup_remotedisks: simplify and include more disks Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 10/13] migration: use storage_migration for checks instead of online_local_volumes Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 11/13] migration: keep track of replicated volumes via local_volumes Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 12/13] migration: split out replication from scan_local_volumes Fabian Ebner
2021-01-29 15:11 ` [pve-devel] [PATCH v2 qemu-server 13/13] migration: move finishing block jobs to phase2 for better/uniform error handling Fabian Ebner
2021-04-19  6:49 ` [pve-devel] [PATCH-SERIES v2 qemu-server] Cleanup migration code and improve migration disk cleanup Fabian Ebner
2021-04-19 11:50 ` [pve-devel] applied-series: " Thomas Lamprecht

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=20210129151143.10014-2-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal