[pve-devel] [PATCH v2 proxmox 5/5] apt: tests: add tests for Ceph Quincy repository detection on Bookworm

Fiona Ebner f.ebner at proxmox.com
Fri Jun 2 10:48:24 CEST 2023


Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---

No changes in v2.

 proxmox-apt/tests/repositories.rs             | 30 +++++++++++++++++++
 .../ceph-quincy-bookworm.list                 |  6 ++++
 .../ceph-quincy-nosub-bookworm.list           |  2 ++
 .../sources.list.d/ceph-quincy-bookworm.list  |  4 +++
 .../ceph-quincy-nosub-bookworm.list           |  2 ++
 5 files changed, 44 insertions(+)
 create mode 100644 proxmox-apt/tests/sources.list.d.expected/ceph-quincy-bookworm.list
 create mode 100644 proxmox-apt/tests/sources.list.d.expected/ceph-quincy-nosub-bookworm.list
 create mode 100644 proxmox-apt/tests/sources.list.d/ceph-quincy-bookworm.list
 create mode 100644 proxmox-apt/tests/sources.list.d/ceph-quincy-nosub-bookworm.list

diff --git a/proxmox-apt/tests/repositories.rs b/proxmox-apt/tests/repositories.rs
index 2fb7ac8..be6aaff 100644
--- a/proxmox-apt/tests/repositories.rs
+++ b/proxmox-apt/tests/repositories.rs
@@ -397,6 +397,36 @@ fn test_standard_repositories() -> Result<(), Error> {
 
     assert_eq!(std_repos, expected);
 
+    let pve_alt_list = read_dir.join("ceph-quincy-bookworm.list");
+    let mut file = APTRepositoryFile::new(&pve_alt_list)?.unwrap();
+    file.parse()?;
+
+    expected[0].status = None;
+    expected[1].status = None;
+    expected[2].status = None;
+    expected[3].status = Some(true);
+    expected[4].status = Some(true);
+    expected[5].status = Some(true);
+
+    let std_repos = standard_repositories(&[file], "pve", DebianCodename::Bookworm);
+
+    assert_eq!(std_repos, expected);
+
+    let pve_alt_list = read_dir.join("ceph-quincy-nosub-bookworm.list");
+    let mut file = APTRepositoryFile::new(&pve_alt_list)?.unwrap();
+    file.parse()?;
+
+    expected[0].status = None;
+    expected[1].status = None;
+    expected[2].status = None;
+    expected[3].status = None;
+    expected[4].status = Some(true);
+    expected[5].status = None;
+
+    let std_repos = standard_repositories(&[file], "pve", DebianCodename::Bookworm);
+
+    assert_eq!(std_repos, expected);
+
     Ok(())
 }
 
diff --git a/proxmox-apt/tests/sources.list.d.expected/ceph-quincy-bookworm.list b/proxmox-apt/tests/sources.list.d.expected/ceph-quincy-bookworm.list
new file mode 100644
index 0000000..9095e27
--- /dev/null
+++ b/proxmox-apt/tests/sources.list.d.expected/ceph-quincy-bookworm.list
@@ -0,0 +1,6 @@
+deb https://enterprise.proxmox.com/debian/ceph-quincy bookworm enterprise
+
+deb http://download.proxmox.com/debian/ceph-quincy bookworm main
+
+deb http://download.proxmox.com/debian/ceph-quincy bookworm test
+
diff --git a/proxmox-apt/tests/sources.list.d.expected/ceph-quincy-nosub-bookworm.list b/proxmox-apt/tests/sources.list.d.expected/ceph-quincy-nosub-bookworm.list
new file mode 100644
index 0000000..b60fa98
--- /dev/null
+++ b/proxmox-apt/tests/sources.list.d.expected/ceph-quincy-nosub-bookworm.list
@@ -0,0 +1,2 @@
+deb http://download.proxmox.com/debian/ceph-quincy bookworm no-subscription
+
diff --git a/proxmox-apt/tests/sources.list.d/ceph-quincy-bookworm.list b/proxmox-apt/tests/sources.list.d/ceph-quincy-bookworm.list
new file mode 100644
index 0000000..fde8eba
--- /dev/null
+++ b/proxmox-apt/tests/sources.list.d/ceph-quincy-bookworm.list
@@ -0,0 +1,4 @@
+deb https://enterprise.proxmox.com/debian/ceph-quincy bookworm enterprise
+deb http://download.proxmox.com/debian/ceph-quincy bookworm main
+deb http://download.proxmox.com/debian/ceph-quincy bookworm test
+
diff --git a/proxmox-apt/tests/sources.list.d/ceph-quincy-nosub-bookworm.list b/proxmox-apt/tests/sources.list.d/ceph-quincy-nosub-bookworm.list
new file mode 100644
index 0000000..b60fa98
--- /dev/null
+++ b/proxmox-apt/tests/sources.list.d/ceph-quincy-nosub-bookworm.list
@@ -0,0 +1,2 @@
+deb http://download.proxmox.com/debian/ceph-quincy bookworm no-subscription
+
-- 
2.39.2






More information about the pve-devel mailing list