From e805291a104a36eb1e845759044d8d2becf5edd3 Mon Sep 17 00:00:00 2001 From: Penn Bauman Date: Tue, 12 Nov 2024 21:45:58 +0100 Subject: [PATCH] test/system: Support host operating systems without VERSION_ID The VERSION_ID field in os-release(5) is optional [1]. It's absent on Arch Linux, which follows a rolling-release model and uses the BUILD_ID field instead: BUILD_ID=rolling A subsequent commit will run the CI on Arch Linux. Hence, the code to get the default release from the host operating system can no longer assume the presence of the VERSION_ID field in os-release(5). Note that the arch-toolbox image is tagged with 'latest', in accordance with OCI conventions, not 'rolling' [2,3], which is the os-release(5) BUILD_ID. A similar change was made to toolbox(1) in commits 2ee82affebd49a86 and d14fd7bb50f0e71b. [1] https://www.freedesktop.org/software/systemd/man/os-release.html [2] Commit 2568528cb7f52663 https://github.com/containers/toolbox/commit/2568528cb7f52663 https://github.com/containers/toolbox/pull/861 [3] Commit a4e5861ae5c93625 https://github.com/containers/toolbox/commit/a4e5861ae5c93625 https://github.com/containers/toolbox/pull/1308 https://github.com/containers/toolbox/issues/1438 https://github.com/containers/toolbox/pull/1535 --- test/system/libs/helpers.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/system/libs/helpers.bash b/test/system/libs/helpers.bash index b26b81bda..dda471ea3 100644 --- a/test/system/libs/helpers.bash +++ b/test/system/libs/helpers.bash @@ -560,7 +560,10 @@ function get_system_version() ( # shellcheck disable=SC1090 . "$os_release" - echo "$VERSION_ID" + local system_version="$VERSION_ID" + [ "$ID" = "arch" ] && system_version="latest" + + echo "$system_version" )