From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 0507D1FF09F for ; Thu, 17 Sep 2026 18:24:01 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E633E215A3; Thu, 17 Sep 2026 18:23:48 +0200 (CEST) From: =?UTF-8?q?Michael=20K=C3=B6ppl?= To: pve-devel@lists.proxmox.com Subject: [PATCH test-tools,e2e-tests 0/6] randomly select VMIDs for test Date: Thu, 17 Sep 2026 18:23:18 +0200 Message-ID: <20260917162324.1926056-1-m.koeppl@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1789662222256 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.637 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) 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: KFMWQSEQSJWE4VOWASICRUKEEITRJPFT X-Message-ID-Hash: KFMWQSEQSJWE4VOWASICRUKEEITRJPFT X-MailFrom: m.koeppl@proxmox.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: Instead of using `/cluster/nextid`, VMIDs are randomly selected from a range (by default from 1000000 to 9999999). This is supposed to make 2 problems that would occur very unlikely: 1) Some tests would fail if multiple guests were created sequentially because `/cluster/nextid` would return an ID that was already free after the VM using it had been destroyed, but the cleanup process for the VM was still running. By randomly selecting, this is vanishingly unlikely. 2) When multiple test runs run in parallel (e.g. on different nodes of the same cluster), it could also happen that `/cluster/nextid` returned the same VMID for both runs, resulting in an error upon creation of the guest in one of the runs. The initial plan was to add a lock file in /etc/pve/priv/proxmox-e2e-tests (or a similarly named dir) for each VMID currently in use. However, this would not solve the first issue, making the random selection necessary anyway. In addition, the file lock could leave behind lock files on a user's test system upon interrupted test runs. Thus, the patch series adds a new library function to the test repository, replaces all uses of `/cluster/nextid` to `random_vmid()` in the 3 test suites, and adds a runner param for manipulating the range. proxmox-test-tools: Michael Köppl (1): runner: add vmid-range option for test guest VMIDs README.md | 7 ++- proxmox-test-runner/src/cli.rs | 28 ++++++++++-- proxmox-test-runner/src/main.rs | 1 + proxmox-test-runner/src/types.rs | 78 ++++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 proxmox-test-runner/src/types.rs proxmox-e2e-tests: Michael Köppl (5): lib: add function for drawing a random unused VMID storage-plugin: use random_vmid function for getting VMIDs hw-validation: use random_vmid function for getting VMIDs tests: use random_vmid function for getting VMIDs storage-plugin: README: document the vmid-range option Proxmox/Test/StorageGuest.pm | 4 +- Proxmox/Test/Util.pm | 39 ++++++++++++++++++- hw-validation-tests/tests/kvm_linux.pl | 3 +- hw-validation-tests/tests/lxc_lifecycle.pl | 3 +- hw-validation-tests/tests/storage_local.pl | 3 +- storage-plugin-tests/README | 4 ++ storage-plugin-tests/tests/backup_ct.pl | 4 +- storage-plugin-tests/tests/backup_restore.pl | 4 +- storage-plugin-tests/tests/backup_running.pl | 4 +- storage-plugin-tests/tests/backup_vm.pl | 4 +- .../tests/cluster_migration.pl | 4 +- storage-plugin-tests/tests/ct_create.pl | 4 +- storage-plugin-tests/tests/disk_clone.pl | 6 +-- storage-plugin-tests/tests/disk_migration.pl | 4 +- storage-plugin-tests/tests/disk_purge.pl | 4 +- storage-plugin-tests/tests/disk_resize.pl | 4 +- storage-plugin-tests/tests/disk_snapshot.pl | 6 +-- .../tests/disk_thin_discard.pl | 4 +- storage-plugin-tests/tests/io_integrity.pl | 4 +- .../tests/snapshot_volume_chain.pl | 4 +- .../tests/template_linked_clone.pl | 6 +-- .../tests/vm_additional_disk_vtpm.pl | 4 +- .../tests/vm_create_default.pl | 4 +- .../tests/vm_destroy_with_snapshots.pl | 4 +- storage-plugin-tests/tests/vm_disk_buses.pl | 4 +- tests/pbs/test_pbs_s3_datastore.pl | 5 ++- tests/pve_backup_job.pl | 3 +- tests/pve_create_pool.pl | 3 +- tests/pve_create_vm.pl | 4 +- tests/pve_firewall.pl | 4 +- tests/pve_ha_resource_config.pl | 3 +- tests/pve_ha_resource_state.pl | 4 +- tests/pve_ha_rules_config.pl | 5 ++- tests/pve_ha_status.pl | 3 +- tests/pve_migration.pl | 4 +- tests/pve_replication.pl | 3 +- tests/pve_storage_basic.pl | 3 +- 37 files changed, 116 insertions(+), 66 deletions(-) Summary over all repositories: 41 files changed, 225 insertions(+), 71 deletions(-) -- Generated by murpp 0.12.1