[pve-devel] [PATCH v6 proxmox-apt 10/11] allow upgrade to bullseye

Fabian Ebner f.ebner at proxmox.com
Fri Jun 11 13:43:59 CEST 2021


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

New in v6.

Intended for the stable branch.

 src/repositories/mod.rs                       |  2 +-
 tests/repositories.rs                         |  8 +----
 .../absolute_suite.list                       |  5 ++++
 .../absolute_suite.sources                    |  5 ++++
 .../bad.sources                               | 30 +++++++++++++++++++
 .../case.sources                              | 16 ++++++++++
 .../multiline.sources                         | 10 +++++++
 .../options_comment.list                      |  6 ++++
 .../pbs-enterprise.list                       |  2 ++
 .../sources.list.d.upgraded.expected/pve.list | 15 ++++++++++
 .../standard.list                             |  7 +++++
 .../standard.sources                          | 11 +++++++
 12 files changed, 109 insertions(+), 8 deletions(-)
 create mode 100644 tests/sources.list.d.upgraded.expected/absolute_suite.list
 create mode 100644 tests/sources.list.d.upgraded.expected/absolute_suite.sources
 create mode 100644 tests/sources.list.d.upgraded.expected/bad.sources
 create mode 100644 tests/sources.list.d.upgraded.expected/case.sources
 create mode 100644 tests/sources.list.d.upgraded.expected/multiline.sources
 create mode 100644 tests/sources.list.d.upgraded.expected/options_comment.list
 create mode 100644 tests/sources.list.d.upgraded.expected/pbs-enterprise.list
 create mode 100644 tests/sources.list.d.upgraded.expected/pve.list
 create mode 100644 tests/sources.list.d.upgraded.expected/standard.list
 create mode 100644 tests/sources.list.d.upgraded.expected/standard.sources

diff --git a/src/repositories/mod.rs b/src/repositories/mod.rs
index eceede3..8a09eb2 100644
--- a/src/repositories/mod.rs
+++ b/src/repositories/mod.rs
@@ -25,7 +25,7 @@ const APT_SOURCES_LIST_DIRECTORY: &str = "/etc/apt/sources.list.d/";
 /// The codename of the current stable Debian release.
 pub const STABLE_SUITE: &str = check::STABLE_SUITE;
 /// The codename of the next stable Debian release or `None` if an upgrade is not yet possible.
-pub const UPGRADE_SUITE: Option<&str> = None;
+pub const UPGRADE_SUITE: Option<&str> = Some(check::NEXT_STABLE_SUITE);
 
 impl APTRepository {
     /// Crates an empty repository.
diff --git a/tests/repositories.rs b/tests/repositories.rs
index ee7f1a8..c3d2719 100644
--- a/tests/repositories.rs
+++ b/tests/repositories.rs
@@ -332,13 +332,7 @@ fn test_release_upgrade() -> Result<(), Error> {
         file.digest = None;
     }
 
-    let res = release_upgrade(&mut files);
-
-    // FIXME adapt test after branching off the stable-X branch!
-    assert!(res.is_err());
-    if res.is_err() {
-        return Ok(());
-    }
+    release_upgrade(&mut files)?;
 
     write_repositories(&files).map_err(|err| format_err!("{:?}", err))?;
 
diff --git a/tests/sources.list.d.upgraded.expected/absolute_suite.list b/tests/sources.list.d.upgraded.expected/absolute_suite.list
new file mode 100644
index 0000000..af6b966
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/absolute_suite.list
@@ -0,0 +1,5 @@
+# From Debian Administrator's Handbook
+deb http://packages.falcot.com/ updates/ 
+
+deb http://user.name@packages.falcot.com:80/ internal/ 
+
diff --git a/tests/sources.list.d.upgraded.expected/absolute_suite.sources b/tests/sources.list.d.upgraded.expected/absolute_suite.sources
new file mode 100644
index 0000000..51e4d56
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/absolute_suite.sources
@@ -0,0 +1,5 @@
+# From Debian Administrator's Handbook
+Types: deb
+URIs: http://packages.falcot.com/
+Suites: updates/ internal/
+
diff --git a/tests/sources.list.d.upgraded.expected/bad.sources b/tests/sources.list.d.upgraded.expected/bad.sources
new file mode 100644
index 0000000..b630c89
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/bad.sources
@@ -0,0 +1,30 @@
+Types: deb
+URIs: http://ftp.at.debian.org/debian
+Suites: sid
+Components: main contrib
+
+Types: deb
+URIs: http://ftp.at.debian.org/debian
+Suites: lenny-backports
+Components: contrib
+
+Types: deb
+URIs: http://security.debian.org:80
+Suites: stretch/updates
+Components: main contrib
+
+Types: deb
+URIs: http://ftp.at.debian.org:80/debian
+Suites: stable
+Components: main
+
+Types: deb
+URIs: http://ftp.at.debian.org/debian
+Suites: bullseye
+Components: main
+
+Types: deb
+URIs: http://ftp.at.debian.org/debian
+Suites: testing
+Components: main
+
diff --git a/tests/sources.list.d.upgraded.expected/case.sources b/tests/sources.list.d.upgraded.expected/case.sources
new file mode 100644
index 0000000..a266594
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/case.sources
@@ -0,0 +1,16 @@
+# comment in here
+Types: deb deb-src
+URIs: http://ftp.at.debian.org/debian
+Suites: buster-updates
+Components: main contrib
+languages: it de fr
+Enabled: false
+languages-Add: ja
+languages-Remove: de
+
+# comment in here
+Types: deb deb-src
+URIs: http://ftp.at.debian.org/debian
+Suites: bullseye
+Components: main contrib
+
diff --git a/tests/sources.list.d.upgraded.expected/multiline.sources b/tests/sources.list.d.upgraded.expected/multiline.sources
new file mode 100644
index 0000000..d96acea
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/multiline.sources
@@ -0,0 +1,10 @@
+# comment in here
+Types: deb deb-src
+URIs: http://ftp.at.debian.org/debian
+Suites: buster buster-updates
+Components: main contrib
+Languages: it de fr
+Enabled: false
+Languages-Add: ja
+Languages-Remove: de
+
diff --git a/tests/sources.list.d.upgraded.expected/options_comment.list b/tests/sources.list.d.upgraded.expected/options_comment.list
new file mode 100644
index 0000000..caef5e0
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/options_comment.list
@@ -0,0 +1,6 @@
+# comment
+deb [ lang=it,de arch=amd64 ] http://ftp.at.debian.org/debian bullseye main contrib
+
+# non-free :(
+deb [ lang=it,de arch=amd64 lang+=fr lang-=de ] http://ftp.at.debian.org/debian bullseye non-free
+
diff --git a/tests/sources.list.d.upgraded.expected/pbs-enterprise.list b/tests/sources.list.d.upgraded.expected/pbs-enterprise.list
new file mode 100644
index 0000000..cb6e779
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/pbs-enterprise.list
@@ -0,0 +1,2 @@
+deb https://enterprise.proxmox.com/debian/pbs bullseye pbs-enterprise
+
diff --git a/tests/sources.list.d.upgraded.expected/pve.list b/tests/sources.list.d.upgraded.expected/pve.list
new file mode 100644
index 0000000..c52c651
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/pve.list
@@ -0,0 +1,15 @@
+deb http://ftp.debian.org/debian bullseye main contrib
+
+deb http://ftp.debian.org/debian bullseye-updates main contrib
+
+# PVE pve-no-subscription repository provided by proxmox.com,
+# NOT recommended for production use
+deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
+
+# deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise
+
+deb-src https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise
+
+# security updates
+deb http://security.debian.org/debian-security bullseye-security main contrib
+
diff --git a/tests/sources.list.d.upgraded.expected/standard.list b/tests/sources.list.d.upgraded.expected/standard.list
new file mode 100644
index 0000000..51f7ed0
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/standard.list
@@ -0,0 +1,7 @@
+deb http://ftp.at.debian.org/debian bullseye main contrib
+
+deb http://ftp.at.debian.org/debian bullseye-updates main contrib
+
+# security updates
+deb http://security.debian.org bullseye-security main contrib
+
diff --git a/tests/sources.list.d.upgraded.expected/standard.sources b/tests/sources.list.d.upgraded.expected/standard.sources
new file mode 100644
index 0000000..85539b3
--- /dev/null
+++ b/tests/sources.list.d.upgraded.expected/standard.sources
@@ -0,0 +1,11 @@
+Types: deb
+URIs: http://ftp.at.debian.org/debian
+Suites: bullseye bullseye-updates
+Components: main contrib
+
+# security updates
+Types: deb
+URIs: http://security.debian.org
+Suites: bullseye-security
+Components: main contrib
+
-- 
2.20.1






More information about the pve-devel mailing list