Skip to content

Commit

Permalink
Ignore the file '/etc/board-release' (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrolamas committed Mar 11, 2023
1 parent 40ecdd9 commit 5fc214c
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 @@ -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"
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

0 comments on commit 5fc214c

Please sign in to comment.