public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH test-tools 0/4] remove PDM submodule
@ 2026-09-10 16:20 Michael Köppl
  2026-09-10 16:20 ` [PATCH test-tools 1/4] scheduler: drop the unused pdm-api-types dependency Michael Köppl
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michael Köppl @ 2026-09-10 16:20 UTC (permalink / raw)
  To: pve-devel

The submodule was initially added to avoid reimplementing add_remote and
some of the structs and enums used for interacting with both the PDM as
well as the PVE API. In both cases, the functionality is so limited that
it doesn't really warrant pulling PDM into the build over reimplementing
these few pieces of code.

These patches remove the dependency from proxmox-test-scheduler (where
it was unused anyway) and proxmox-test-instance and all the dependencies
that were only pulled in for proxmox-datacenter-manager. The
functionality for adding remotes is reimplemented here, but keeps only
the parts actually required for proxmox-test-instance's use case.

I ran multiple different plans with and without clusters, adding the
test instances as remotes for a PDM instance and did not notice any
problems. I also verified that `wait_for_task` still works as expected
since it was using `TaskStateType` from pdm_api_types.


proxmox-test-tools:

Michael Köppl (4):
  scheduler: drop the unused pdm-api-types dependency
  instance: register PDM remotes without pdm-client
  instance: source certificate and task types directly
  buildsys: drop the proxmox-datacenter-manager submodule

 .gitmodules                                 |  3 -
 Cargo.toml                                  | 10 ---
 Makefile                                    |  4 +-
 README.md                                   |  3 -
 debian/control                              | 11 ---
 proxmox-datacenter-manager                  |  1 -
 proxmox-test-instance/Cargo.toml            |  6 +-
 proxmox-test-instance/src/api/pdm_client.rs | 76 +++++++++++++++++----
 proxmox-test-instance/src/api/pve_client.rs | 26 ++++++-
 proxmox-test-scheduler/Cargo.toml           |  2 -
 10 files changed, 92 insertions(+), 50 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 proxmox-datacenter-manager


Summary over all repositories:
  10 files changed, 92 insertions(+), 50 deletions(-)

-- 
Generated by murpp 0.12.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH test-tools 1/4] scheduler: drop the unused pdm-api-types dependency
  2026-09-10 16:20 [PATCH test-tools 0/4] remove PDM submodule Michael Köppl
@ 2026-09-10 16:20 ` Michael Köppl
  2026-09-10 16:20 ` [PATCH test-tools 2/4] instance: register PDM remotes without pdm-client Michael Köppl
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Köppl @ 2026-09-10 16:20 UTC (permalink / raw)
  To: pve-devel

Nothing in proxmox-test-scheduler refers to pdm-api-types. The
dependency only pulled the crate, and with it the datacenter manager
submodule, into the scheduler's build.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 proxmox-test-scheduler/Cargo.toml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/proxmox-test-scheduler/Cargo.toml b/proxmox-test-scheduler/Cargo.toml
index 8445e9d..643c199 100644
--- a/proxmox-test-scheduler/Cargo.toml
+++ b/proxmox-test-scheduler/Cargo.toml
@@ -34,8 +34,6 @@ proxmox-test-common.workspace = true
 proxmox-tfa.workspace = true
 proxmox-uuid.workspace = true
 
-pdm-api-types.workspace = true
-
 anyhow.workspace = true
 chrono.workspace = true
 const_format.workspace = true
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH test-tools 2/4] instance: register PDM remotes without pdm-client
  2026-09-10 16:20 [PATCH test-tools 0/4] remove PDM submodule Michael Köppl
  2026-09-10 16:20 ` [PATCH test-tools 1/4] scheduler: drop the unused pdm-api-types dependency Michael Köppl
@ 2026-09-10 16:20 ` Michael Köppl
  2026-09-10 16:20 ` [PATCH test-tools 3/4] instance: source certificate and task types directly Michael Köppl
  2026-09-10 16:20 ` [PATCH test-tools 4/4] buildsys: drop the proxmox-datacenter-manager submodule Michael Köppl
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Köppl @ 2026-09-10 16:20 UTC (permalink / raw)
  To: pve-devel

pdm-client was pulled in only for add_remote(), which the repository
can express directly through the proxmox-client HttpApiClient trait that
the PVE client already uses.

Declare the request body locally instead. Only the fields the call
actually sends are kept. The format constants on NodeUrl are dropped as
well, since they only validate input that is constructed here from the
instance address and the fingerprint fetched just before.

Authid keeps coming from proxmox-auth-api, which is where pdm-api-types
re-exported it from.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 proxmox-test-instance/Cargo.toml            |  4 +-
 proxmox-test-instance/src/api/pdm_client.rs | 76 +++++++++++++++++----
 2 files changed, 66 insertions(+), 14 deletions(-)

diff --git a/proxmox-test-instance/Cargo.toml b/proxmox-test-instance/Cargo.toml
index 0c5d207..5a7c333 100644
--- a/proxmox-test-instance/Cargo.toml
+++ b/proxmox-test-instance/Cargo.toml
@@ -10,7 +10,6 @@ repository.workspace = true
 [dependencies]
 proxmox-test-common = { workspace = true }
 pdm-api-types = { workspace = true }
-pdm-client = { workspace = true }
 
 anyhow.workspace = true
 dirs-next.workspace = true
@@ -30,10 +29,11 @@ tokio = { workspace = true, features = [ "rt" ]}
 toml.workspace = true
 
 proxmox-async.workspace = true
+proxmox-auth-api = { workspace = true, features = [ "api-types" ] }
 proxmox-client = { workspace = true, features = ["hyper-client"] }
 proxmox-config-digest = { workspace = true, features = [ "openssl" ] }
 proxmox-http = { workspace = true, features = ["client-sync"] }
 proxmox-login = { workspace = true }
-proxmox-schema = { workspace = true }
+proxmox-schema = { workspace = true, features = [ "api-macro" ] }
 
 pve-api-types = { workspace = true, features = ["client"] }
diff --git a/proxmox-test-instance/src/api/pdm_client.rs b/proxmox-test-instance/src/api/pdm_client.rs
index 9c79923..8067f37 100644
--- a/proxmox-test-instance/src/api/pdm_client.rs
+++ b/proxmox-test-instance/src/api/pdm_client.rs
@@ -1,16 +1,62 @@
 use anyhow::{Error, bail};
-use pdm_api_types::{
-    Authid,
-    remotes::{NodeUrl, RemoteType},
-};
-use pdm_client::{PdmClient as ExistingPdmClient, types::Remote};
-use proxmox_client::Client;
+use proxmox_auth_api::types::Authid;
+use proxmox_client::{Client, HttpApiClient};
 use proxmox_login::Login;
+use proxmox_schema::api;
 use proxmox_schema::property_string::PropertyString;
+use serde::Serialize;
+
 use proxmox_test_common::types::TestInstance;
 
+/// The type of a remote entry.
+#[derive(Clone, Copy, Serialize)]
+#[serde(rename_all = "lowercase")]
+enum RemoteType {
+    /// A Proxmox VE node.
+    Pve,
+}
+
+#[api(
+    properties: {
+        fingerprint: {
+            type: String,
+            optional: true,
+        },
+    },
+    default_key: "hostname",
+)]
+/// A node and its certificate information.
+#[derive(Clone, Serialize)]
+struct NodeUrl {
+    /// The node address.
+    hostname: String,
+
+    /// Certificate fingerprint.
+    #[serde(skip_serializing_if = "Option::is_none")]
+    fingerprint: Option<String>,
+}
+
+/// The part of PDM's remote configuration that registering a test instance needs.
+#[derive(Serialize)]
+struct Remote {
+    #[serde(rename = "type")]
+    ty: RemoteType,
+    id: String,
+    nodes: Vec<PropertyString<NodeUrl>>,
+    authid: Authid,
+    token: String,
+}
+
+#[derive(Serialize)]
+#[serde(rename_all = "kebab-case")]
+struct AddRemoteParams<'a> {
+    #[serde(flatten)]
+    remote: &'a Remote,
+    create_token: &'a str,
+}
+
 pub struct PdmClient {
-    client: ExistingPdmClient<Client>,
+    client: Client,
 }
 
 impl PdmClient {
@@ -33,9 +79,7 @@ impl PdmClient {
             bail!("two factor authentication is not supported");
         }
 
-        Ok(PdmClient {
-            client: ExistingPdmClient(client),
-        })
+        Ok(PdmClient { client })
     }
 
     pub async fn add_remote(
@@ -52,10 +96,18 @@ impl PdmClient {
             })],
             authid: Authid::root_auth_id().clone(),
             token: instance_pw.to_string(),
-            web_url: None,
         };
 
-        self.client.add_remote(&remote, Some("pdm-admin")).await?;
+        self.client
+            .post(
+                "/api2/extjs/remotes/remote",
+                &AddRemoteParams {
+                    remote: &remote,
+                    create_token: "pdm-admin",
+                },
+            )
+            .await?
+            .nodata()?;
 
         Ok(())
     }
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH test-tools 3/4] instance: source certificate and task types directly
  2026-09-10 16:20 [PATCH test-tools 0/4] remove PDM submodule Michael Köppl
  2026-09-10 16:20 ` [PATCH test-tools 1/4] scheduler: drop the unused pdm-api-types dependency Michael Köppl
  2026-09-10 16:20 ` [PATCH test-tools 2/4] instance: register PDM remotes without pdm-client Michael Köppl
@ 2026-09-10 16:20 ` Michael Köppl
  2026-09-10 16:20 ` [PATCH test-tools 4/4] buildsys: drop the proxmox-datacenter-manager submodule Michael Köppl
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Köppl @ 2026-09-10 16:20 UTC (permalink / raw)
  To: pve-devel

Both types pdm-api-types provided here were a detour. CertificateInfo is
its re-export of proxmox_acme_api::CertificateInfo, so take it from
there. TaskStateType is simple enough to warrant a direct declaration
here.

This leaves proxmox-test-instance free of pdm crates.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 proxmox-test-instance/Cargo.toml            |  2 +-
 proxmox-test-instance/src/api/pve_client.rs | 26 +++++++++++++++++++--
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/proxmox-test-instance/Cargo.toml b/proxmox-test-instance/Cargo.toml
index 5a7c333..9cbfc9b 100644
--- a/proxmox-test-instance/Cargo.toml
+++ b/proxmox-test-instance/Cargo.toml
@@ -9,7 +9,6 @@ repository.workspace = true
 
 [dependencies]
 proxmox-test-common = { workspace = true }
-pdm-api-types = { workspace = true }
 
 anyhow.workspace = true
 dirs-next.workspace = true
@@ -28,6 +27,7 @@ termcolor.workspace = true
 tokio = { workspace = true, features = [ "rt" ]}
 toml.workspace = true
 
+proxmox-acme-api.workspace = true
 proxmox-async.workspace = true
 proxmox-auth-api = { workspace = true, features = [ "api-types" ] }
 proxmox-client = { workspace = true, features = ["hyper-client"] }
diff --git a/proxmox-test-instance/src/api/pve_client.rs b/proxmox-test-instance/src/api/pve_client.rs
index f719895..4e4c1f4 100644
--- a/proxmox-test-instance/src/api/pve_client.rs
+++ b/proxmox-test-instance/src/api/pve_client.rs
@@ -2,7 +2,7 @@ use std::net::Ipv4Addr;
 use std::{collections::HashSet, sync::Arc, time::Duration};
 
 use anyhow::{Context, Error, bail};
-use pdm_api_types::{CertificateInfo, TaskStateType};
+use proxmox_acme_api::CertificateInfo;
 use proxmox_client::{AuthenticationKind, Client, HttpApiClient, HttpApiResponse, TlsOptions};
 use proxmox_http::HttpOptions;
 use proxmox_login::Login;
@@ -33,6 +33,28 @@ const SHUTDOWN_TIMEOUT_SECS: u64 = 300;
 /// This does not cancel the server-side task; large or slow operations can outlive this deadline.
 const TASK_TIMEOUT: Duration = Duration::from_secs(60 * 60);
 
+/// The state a finished PVE task ended up in, as derived from its exit status.
+enum TaskStateType {
+    Ok,
+    Warning,
+    Error,
+    Unknown,
+}
+
+impl TaskStateType {
+    fn new_from_str(status: &str) -> Self {
+        if status == "unknown" || status.is_empty() {
+            TaskStateType::Unknown
+        } else if status == "OK" {
+            TaskStateType::Ok
+        } else if status.starts_with("WARNINGS: ") {
+            TaskStateType::Warning
+        } else {
+            TaskStateType::Error
+        }
+    }
+}
+
 #[derive(Debug)]
 struct TaskFailure {
     upid: String,
@@ -1049,7 +1071,7 @@ where
 
             let exitstatus = value["exitstatus"].as_str().unwrap_or("unknown");
             return match TaskStateType::new_from_str(exitstatus) {
-                TaskStateType::OK | TaskStateType::Warning => Ok(()),
+                TaskStateType::Ok | TaskStateType::Warning => Ok(()),
                 TaskStateType::Error | TaskStateType::Unknown => {
                     bail!(TaskFailure {
                         upid: upid.to_string(),
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH test-tools 4/4] buildsys: drop the proxmox-datacenter-manager submodule
  2026-09-10 16:20 [PATCH test-tools 0/4] remove PDM submodule Michael Köppl
                   ` (2 preceding siblings ...)
  2026-09-10 16:20 ` [PATCH test-tools 3/4] instance: source certificate and task types directly Michael Köppl
@ 2026-09-10 16:20 ` Michael Köppl
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Köppl @ 2026-09-10 16:20 UTC (permalink / raw)
  To: pve-devel

Nothing depends on pdm-api-types or pdm-client any more, so the whole
datacenter manager submodule can go. It was originally added for 2
library crates which are easily replicated here and this avoids the
entire PDM tree being pulled into the build.

Remove any dependencies only required by pdm-api-types and pdm-client as
well.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 .gitmodules                |  3 ---
 Cargo.toml                 | 10 ----------
 Makefile                   |  4 +---
 README.md                  |  3 ---
 debian/control             | 11 -----------
 proxmox-datacenter-manager |  1 -
 6 files changed, 1 insertion(+), 31 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 proxmox-datacenter-manager

diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 93075c0..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "proxmox-datacenter-manager"]
-	path = proxmox-datacenter-manager
-	url = https://git.proxmox.com/git/proxmox-datacenter-manager.git
diff --git a/Cargo.toml b/Cargo.toml
index 7ac0bfb..2a9c359 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,24 +29,16 @@ percent-encoding = "2.1"
 proxmox-client = "1.0"
 proxmox-http = "1.0"
 proxmox-login = "1.0"
-proxmox-serde = "1.0"
 pve-api-types = "8.1"
 serde = "1"
 serde_plain = "1"
 
-# pdm-api-types
 const_format = "0.2"
 proxmox-acme-api = "1"
-proxmox-apt-api-types = "3.0.0"
 proxmox-config-digest = "1"
 proxmox-dns-api = "1"
-proxmox-installer-types = "0.2"
-proxmox-network-types = "1.1"
 proxmox-section-config = "3"
-proxmox-subscription = { version = "1", features = [ "api-types"], default-features = false }
 proxmox-time = "2"
-pbs-api-types = "1.0.3"
-proxmox-rrd-api-types = "1.0.2"
 proxmox-tfa = { version = "6", features = [ "api-types" ], default-features = false }
 
 proxmox-access-control = "1"
@@ -89,8 +81,6 @@ termcolor = "1.1"
 tokio = "1.32"
 toml = "0.8"
 
-pdm-api-types = { path = "./proxmox-datacenter-manager/lib/pdm-api-types/" }
-pdm-client = { path = "./proxmox-datacenter-manager/lib/pdm-client/" }
 proxmox-product-config = "1"
 proxmox-test-common = { path = "./proxmox-test-common/"}
 
diff --git a/Makefile b/Makefile
index 024bfa2..699626d 100644
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,7 @@ cargo-build-scheduler:
 build: $(BUILDDIR)
 $(BUILDDIR):
 	rm -rf $@ $@.tmp; mkdir $@.tmp
-	cp -a proxmox-test-common proxmox-datacenter-manager proxmox-test-runner proxmox-test-instance proxmox-test-scheduler debian Cargo.toml LICENSE Makefile README.md defines.mk $@.tmp/
+	cp -a proxmox-test-common proxmox-test-runner proxmox-test-instance proxmox-test-scheduler debian Cargo.toml LICENSE Makefile README.md defines.mk $@.tmp/
 	mv $@.tmp $@
 
 .PHONY: deb
@@ -126,8 +126,6 @@ gendeps:
 	cargo-fairy d-control \
 	  ./Cargo.toml \
 	  proxmox-test-common/Cargo.toml \
-	  proxmox-datacenter-manager/lib/pdm-api-types/Cargo.toml \
-	  proxmox-datacenter-manager/lib/pdm-client/Cargo.toml \
 	  proxmox-test-instance/Cargo.toml \
 	  proxmox-test-runner/Cargo.toml \
 	  proxmox-test-scheduler/Cargo.toml
diff --git a/README.md b/README.md
index 9b2f7bc..84c4828 100644
--- a/README.md
+++ b/README.md
@@ -16,9 +16,6 @@ JSON file the runner injects into each test via `$CONFIG_PATH` (see
 | `proxmox-test-runner` | Runs the test cases from a testcase file against the instances described by an inventory file. |
 | `proxmox-test-scheduler` | HTTPS daemon that coordinates CI runs over SSH: sets up instances, installs the packages under test, runs the runner, and mails the report. |
 
-`proxmox-datacenter-manager` is a git submodule; only its `pdm-api-types` and
-`pdm-client` crates are used (for the PDM client).
-
 ## Pipeline
 
 ```
diff --git a/debian/control b/debian/control
index 33b9a2c..b9216e9 100644
--- a/debian/control
+++ b/debian/control
@@ -28,15 +28,12 @@ Build-Depends: apt-utils,
                librust-openssh-0.11+default-dev,
                librust-openssh-0.11+process-mux-dev,
                librust-openssl-0.10+default-dev (>= 0.10.45-~~),
-               librust-pbs-api-types-1+default-dev (>= 1.0.3-~~),
                librust-pico-args-0.5+default-dev,
-               librust-proxmox-access-control-1+acl-dev,
                librust-proxmox-access-control-1+api-dev,
                librust-proxmox-access-control-1+default-dev,
                librust-proxmox-acme-api-1+default-dev,
                librust-proxmox-acme-api-1+impl-dev,
                librust-proxmox-api-macro-1+default-dev (>= 1.4-~~),
-               librust-proxmox-apt-api-types-3+default-dev,
                librust-proxmox-async-0.5+default-dev,
                librust-proxmox-auth-api-1+api-dev (>= 1.0.5-~~),
                librust-proxmox-auth-api-1+api-types-dev (>= 1.0.5-~~),
@@ -51,31 +48,23 @@ Build-Depends: apt-utils,
                librust-proxmox-dns-api-1+default-dev,
                librust-proxmox-http-1+client-sync-dev,
                librust-proxmox-http-1+default-dev,
-               librust-proxmox-installer-types-0.2+api-types-dev,
-               librust-proxmox-installer-types-0.2+default-dev,
                librust-proxmox-lang-1+default-dev (>= 1.1-~~),
                librust-proxmox-ldap-1+default-dev,
                librust-proxmox-ldap-1+sync-dev,
                librust-proxmox-log-1+default-dev,
                librust-proxmox-login-1+default-dev,
                librust-proxmox-network-api-1+default-dev,
-               librust-proxmox-network-types-1+api-types-dev (>= 1.1-~~),
-               librust-proxmox-network-types-1+default-dev (>= 1.1-~~),
                librust-proxmox-product-config-1+default-dev,
                librust-proxmox-rest-server-1+default-dev,
                librust-proxmox-router-3+cli-dev (>= 3.2.4-~~),
-               librust-proxmox-rrd-api-types-1+default-dev (>= 1.0.2-~~),
                librust-proxmox-schema-5+api-macro-dev,
                librust-proxmox-schema-5+default-dev,
                librust-proxmox-section-config-3+default-dev,
-               librust-proxmox-serde-1+default-dev,
                librust-proxmox-sortable-macro-1+default-dev,
-               librust-proxmox-subscription-1+api-types-dev,
                librust-proxmox-sys-1+crypt-dev,
                librust-proxmox-sys-1+default-dev,
                librust-proxmox-systemd-1+default-dev,
                librust-proxmox-tfa-6+api-types-dev,
-               librust-proxmox-tfa-6+types-dev,
                librust-proxmox-time-2+default-dev,
                librust-proxmox-uuid-1+default-dev,
                librust-proxmox-uuid-1+serde-dev,
diff --git a/proxmox-datacenter-manager b/proxmox-datacenter-manager
deleted file mode 160000
index 30f827a..0000000
--- a/proxmox-datacenter-manager
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 30f827a3dd1877517d5ba20de56391fd7b39098a
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-10 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10 16:20 [PATCH test-tools 0/4] remove PDM submodule Michael Köppl
2026-09-10 16:20 ` [PATCH test-tools 1/4] scheduler: drop the unused pdm-api-types dependency Michael Köppl
2026-09-10 16:20 ` [PATCH test-tools 2/4] instance: register PDM remotes without pdm-client Michael Köppl
2026-09-10 16:20 ` [PATCH test-tools 3/4] instance: source certificate and task types directly Michael Köppl
2026-09-10 16:20 ` [PATCH test-tools 4/4] buildsys: drop the proxmox-datacenter-manager submodule Michael Köppl

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