From 59e6e07b7457cb032fdedc525008d277f82bf48c Mon Sep 17 00:00:00 2001 From: Harshula Jayasuriya Date: Wed, 15 Mar 2023 05:51:17 +1100 Subject: [PATCH] Add Debian Testing to the tests (#356) --- .../distros/debiantesting/bin/lsb_release | 23 ++++++++++++++++ .../distros/debiantesting/etc/debian_version | 1 + .../distros/debiantesting/etc/os-release | 7 +++++ tests/test_distro.py | 26 +++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100755 tests/resources/distros/debiantesting/bin/lsb_release create mode 100644 tests/resources/distros/debiantesting/etc/debian_version create mode 100644 tests/resources/distros/debiantesting/etc/os-release diff --git a/tests/resources/distros/debiantesting/bin/lsb_release b/tests/resources/distros/debiantesting/bin/lsb_release new file mode 100755 index 0000000..40b0a88 --- /dev/null +++ b/tests/resources/distros/debiantesting/bin/lsb_release @@ -0,0 +1,23 @@ +#!/bin/bash +# +# lsb_release command for testing the ld module. +# Only the -a option is supported. +# +# This version of the lsb_release command works without a corresponding +# etc/lsb-release file. +# + +if [[ "$@" != "-a" ]]; then + echo "Usage: lsb_release -a" + exit 2 +fi + +cat < None: } self._test_outcome(desired_outcome) + def test_debiantesting_os_release(self) -> None: + desired_outcome = { + "id": "debian", + "name": "Debian GNU/Linux", + "pretty_name": "Debian GNU/Linux bookworm/sid", + "version": "bookworm/sid", + "pretty_version": "bookworm/sid (bookworm)", + "best_version": "bookworm/sid", + "codename": "bookworm", + } + self._test_outcome(desired_outcome) + def test_fedora19_os_release(self) -> None: desired_outcome = { "id": "fedora", @@ -1297,6 +1309,20 @@ def test_debian10_release(self) -> None: self._test_outcome(desired_outcome) self._test_non_existing_release_file() + def test_debiantesting_release(self) -> None: + desired_outcome = { + "id": "debian", + "name": "Debian GNU/Linux", + "pretty_name": "Debian GNU/Linux bookworm/sid", + "version": "bookworm/sid", + "pretty_version": "bookworm/sid (bookworm)", + "best_version": "bookworm/sid", + "codename": "bookworm", + "major_version": "", + } + self._test_outcome(desired_outcome) + self._test_non_existing_release_file() + def test_exherbo_release(self) -> None: desired_outcome = { "id": "exherbo",