From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 05F971FF13E for ; Fri, 20 Mar 2026 10:26:54 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3CB3411CF2; Fri, 20 Mar 2026 10:27:08 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager 3/5] fake remote: factor out cpu/disk/mem values Date: Fri, 20 Mar 2026 10:25:40 +0100 Message-ID: <20260320092702.1069143-4-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260320092702.1069143-1-d.csapak@proxmox.com> References: <20260320092702.1069143-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: UWQJ3QKEF75PH2XPVKX6ORSDICFGQAOY X-Message-ID-Hash: UWQJ3QKEF75PH2XPVKX6ORSDICFGQAOY X-MailFrom: d.csapak@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 Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: makes it much easier to modify all of them at once. Signed-off-by: Dominik Csapak --- server/src/test_support/fake_remote.rs | 52 +++++++++++++++----------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/server/src/test_support/fake_remote.rs b/server/src/test_support/fake_remote.rs index 21e3a1c9..501f2dc6 100644 --- a/server/src/test_support/fake_remote.rs +++ b/server/src/test_support/fake_remote.rs @@ -137,23 +137,33 @@ impl pve_api_types::client::PveClient for FakePveClient { let mut vmid = 100; + let disk: u64 = 42 * 1024 * 1024 * 1024; + let maxdisk: u64 = 100 * 1024 * 1024 * 1024; + + let mem: u64 = 3 * 1024 * 1024 * 1024; + let memhost: u64 = 4 * 1024 * 1024 * 1024; + let maxmem: i64 = 8 * 1024 * 1024 * 1024; + + let cpu = 0.1; + let maxcpu = 4.0; + for _ in 0..self.nr_of_vms { vmid += 1; result.push(ClusterResource { cgroup_mode: None, content: None, - cpu: Some(0.1), + cpu: Some(cpu), diskread: Some(1034), diskwrite: Some(1034), - disk: Some(42 * 1024 * 1024 * 1024), + disk: Some(disk), hastate: None, id: format!("qemu/{vmid}"), level: Some("".into()), - maxcpu: Some(4.), - maxdisk: Some(100 * 1024 * 1024 * 1024), - maxmem: Some(8 * 1024 * 1024 * 1024), - mem: Some(3 * 1024 * 1024 * 1024), - memhost: Some(4 * 1024 * 1024 * 1024), + maxcpu: Some(maxcpu), + maxdisk: Some(maxdisk), + maxmem: Some(maxmem), + mem: Some(mem), + memhost: Some(memhost), name: Some(format!("vm-{vmid}")), netin: Some(1034), netout: Some(1034), @@ -182,18 +192,18 @@ impl pve_api_types::client::PveClient for FakePveClient { result.push(ClusterResource { cgroup_mode: None, content: None, - cpu: Some(0.1), - disk: Some(42 * 1024 * 1024 * 1024), + cpu: Some(cpu), + disk: Some(disk), diskread: Some(1034), diskwrite: Some(1034), hastate: None, id: format!("lxc/{vmid}"), level: Some("".into()), - maxcpu: Some(4.), - maxdisk: Some(100 * 1024 * 1024 * 1024), - maxmem: Some(8 * 1024 * 1024 * 1024), - memhost: Some(4 * 1024 * 1024 * 1024), - mem: Some(3 * 1024 * 1024 * 1024), + maxcpu: Some(maxcpu), + maxdisk: Some(maxdisk), + maxmem: Some(maxmem), + memhost: Some(memhost), + mem: Some(mem), name: Some(format!("ct-{vmid}")), netin: Some(1034), netout: Some(1034), @@ -221,17 +231,17 @@ impl pve_api_types::client::PveClient for FakePveClient { result.push(ClusterResource { cgroup_mode: None, content: None, - cpu: Some(0.1), - disk: Some(42 * 1024 * 1024 * 1024), + cpu: Some(cpu), + disk: Some(disk), diskread: None, diskwrite: None, hastate: None, id: format!("node/node-{i}"), level: Some("".into()), maxcpu: Some(16.), - maxdisk: Some(100 * 1024 * 1024 * 1024), - maxmem: Some(8 * 1024 * 1024 * 1024), - mem: Some(3 * 1024 * 1024 * 1024), + maxdisk: Some(maxdisk), + maxmem: Some(maxmem), + mem: Some(mem), memhost: None, name: None, netin: None, @@ -261,14 +271,14 @@ impl pve_api_types::client::PveClient for FakePveClient { cgroup_mode: None, content: Some(vec![StorageContent::Images, StorageContent::Rootdir]), cpu: None, - disk: Some(42 * 1024 * 1024 * 1024), + disk: Some(disk), diskread: None, diskwrite: None, hastate: None, id: format!("storage/node-0/storage-{i}"), level: None, maxcpu: None, - maxdisk: Some(100 * 1024 * 1024 * 1024), + maxdisk: Some(maxdisk), maxmem: None, mem: None, memhost: None, -- 2.47.3