Skip to content

Commit

Permalink
Ignore the file '/etc/board-release'
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrolamas committed Feb 20, 2023
1 parent 16ae9cb commit 5cdd431
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/distro/distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,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"
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 @@ -508,6 +508,21 @@ def test_cloudlinux7_os_release(self) -> None:
"minor_version": "3",
}
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):
Expand Down

0 comments on commit 5cdd431

Please sign in to comment.