From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 286CB1FF0AF for ; Thu, 08 Oct 2026 11:47:24 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 943F521612; Thu, 08 Oct 2026 11:47:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1791452815; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=mchnzxPE39UXkIjeRLd7dHM+vgodiJ3+mnEYjgf5JtY=; b=6a2vhFGtZr38rlSnrcqD9DwvnlvH1YHxPL/+ShQJxDP/6QW02mgK6cihsV8jJLJchXBp8W p43yWuiIUh1gx+EJzQote+4Wy5CON9q6gi0NoLD0u8FBjgWW7zzbqk0DhymrQNOVfcGKgk hqHqqMMHYSDnAGhykyDzkS2rZEEtfXn6lUDjPdVa/tjRNV4oX7oOkbNNCedMtUEy2DALfL YTJQ8HNG2+XwRnBUOiSA7sNmofS0AHnb7ewoOHtluhs1h1OILZ/bH8/R4araMzWU5jO7t1 8vv1MCZ8Y2MkgQCe0uuEVrphPOFKe5+ilOZ5/1ajUQugSqAzsVjOz5yfiZ1Lrw== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v2 1/2] test: migration: support volumes other than images Date: Thu, 8 Oct 2026 09:46:49 +0000 Message-ID: <20261008094650.7-2-me@dualfroz.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261008094650.7-1-me@dualfroz.com> References: <20261008094650.7-1-me@dualfroz.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.136 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VZPCICWB57LBJ4ISVHLIKF42YMDNFLES X-Message-ID-Hash: VZPCICWB57LBJ4ISVHLIKF42YMDNFLES X-MailFrom: me@dualfroz.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The mocked vdisk_list() is based on $source_vdisks, but the real one only returns images. Add a separate list for other volumes on the source, e.g. ISO images, which is only considered by the mocked volume_size_info(). This is in preparation for a test with an ISO image that is only referenced by a snapshot. Suggested-by: Fiona Ebner Signed-off-by: Michal Fox --- src/test/MigrationTest/QemuMigrateMock.pm | 5 +++-- src/test/run_qemu_migrate_tests.pl | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/MigrationTest/QemuMigrateMock.pm b/src/test/MigrationTest/QemuMigrateMock.pm index 3a483817..c715a60e 100644 --- a/src/test/MigrationTest/QemuMigrateMock.pm +++ b/src/test/MigrationTest/QemuMigrateMock.pm @@ -21,6 +21,7 @@ my $QM_LIB_PATH = $ENV{QM_LIB_PATH} or die "no QM_LIB_PATH set\n"; my $source_volids = decode_json(file_get_contents("${RUN_DIR_PATH}/source_volids")); my $source_vdisks = decode_json(file_get_contents("${RUN_DIR_PATH}/source_vdisks")); +my $source_other_volumes = decode_json(file_get_contents("${RUN_DIR_PATH}/source_other_volumes")); my $vm_status = decode_json(file_get_contents("${RUN_DIR_PATH}/vm_status")); my $expected_calls = decode_json(file_get_contents("${RUN_DIR_PATH}/expected_calls")); my $fail_config = decode_json(file_get_contents("${RUN_DIR_PATH}/fail_config")); @@ -304,11 +305,11 @@ $MigrationTest::Shared::storage_module->mock( my ($scfg, $volid) = @_; my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid); - for my $v ($source_vdisks->{$storeid}->@*) { + for my $v ($source_vdisks->{$storeid}->@*, $source_other_volumes->{$storeid}->@*) { return wantarray ? ($v->{size}, $v->{format}, $v->{used}, $v->{parent}) : $v->{size} if $v->{volid} eq $volid; } - die "could not find '$volid' in mock 'source_vdisks'\n"; + die "could not find '$volid' in mock 'source_vdisks' or 'source_other_volumes'\n"; }, ); diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl index 05eed1d9..13962f72 100755 --- a/src/test/run_qemu_migrate_tests.pl +++ b/src/test/run_qemu_migrate_tests.pl @@ -436,6 +436,10 @@ my $source_vdisks = { ], }; +# non-image volumes on the source, e.g. ISO images, in the same format as $source_vdisks. They +# are only used for the mocked volume_size_info(), because vdisk_list() only returns images. +my $source_other_volumes = {}; + my $default_expected_calls_online = { move_config_to_node => 1, ssh_qm_start => 1, @@ -1732,6 +1736,7 @@ foreach my $test (@{$tests}) { file_set_contents("${run_dir}/replication_config", to_json($replication_config)); file_set_contents("${run_dir}/storage_config", to_json($storage_config)); file_set_contents("${run_dir}/source_vdisks", to_json($source_vdisks)); + file_set_contents("${run_dir}/source_other_volumes", to_json($source_other_volumes)); my $expect_die = $test->{expect_die}; my $expected = $test->{expected}; -- 2.43.0