Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore the file '/etc/board-release' #353

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/distro/distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class InfoDict(TypedDict):
"system-release",
"plesk-release",
"iredmail-release",
"board-release",
)


Expand Down
9 changes: 9 additions & 0 deletions tests/resources/distros/bttcb1/etc/board-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# PLEASE DO NOT EDIT THIS FILE
BOARD=h616
BOARD_NAME="BTT-CB1"
DISTRIBUTION_CODENAME=bullseye
VERSION=2.3.1
LINUXFAMILY=sun50iw9
ARCH=arm64
INITRD_ARCH=arm64
BRANCH=current
9 changes: 9 additions & 0 deletions tests/resources/distros/bttcb1/etc/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PRETTY_NAME="BTT-CB1 2.3.1 Bullseye"
HorlogeSkynet marked this conversation as resolved.
Show resolved Hide resolved
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
9 changes: 9 additions & 0 deletions tests/resources/distros/bttcb1/usr/lib/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
15 changes: 15 additions & 0 deletions tests/test_distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,21 @@ def test_altlinux10_os_release(self) -> None:
}
self._test_outcome(desired_outcome)

def test_bttcb1_os_release(self) -> None:
desired_outcome = {
"id": "debian",
"codename": "bullseye",
"name": "Debian GNU/Linux",
"pretty_name": "BTT-CB1 2.3.1 Bullseye",
"like": "",
"version": "11",
"pretty_version": "11 (bullseye)",
"best_version": "11",
"major_version": "11",
"minor_version": "0",
}
self._test_outcome(desired_outcome)


class TestWithRootDir(TestOSRelease):
"""Test that a LinuxDistribution can be created using an arbitrary root_dir
Expand Down