Skip to content

Commit

Permalink
Ensure Manjaro ARM reports the correct os_family of Arch.
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgreenaway committed Aug 9, 2024
1 parent c222b6e commit ba39288
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/66796.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure Manjaro ARM reports the correct os_family of Arch.
1 change: 1 addition & 0 deletions salt/grains/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,7 @@ def _derive_os_grain(osfullname, os_id=None):
"SLES_SAP": "Suse",
"Arch ARM": "Arch",
"Manjaro": "Arch",
"Manjaro ARM": "Arch",
"Antergos": "Arch",
"EndeavourOS": "Arch",
"ALT": "RedHat",
Expand Down
33 changes: 33 additions & 0 deletions tests/pytests/unit/grains/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,39 @@ def test_Parrot_OS_grains():
_run_os_grains_tests(_os_release_data, _os_release_map, expectation)


@pytest.mark.skip_unless_on_linux
def test_manjaro_arm_grains():
"""
Test if OS grains are parsed correctly in Manjaro ARM
"""
# /etc/os-release data taken from ParrotOS 5.1
_os_release_data = {
"NAME": "Manjaro ARM",
"ID": "manjaro-arm",
"ID_LIKE": "manjaro arch",
"PRETTY_NAME": "Manjaro ARM",
"ANSI_COLOR": "1;32",
"HOME_URL": "https://www.manjaro.org/",
"SUPPORT_URL": "https://forum.manjaro.org/c/arm/",
"LOGO": "manjarolinux",
}
_os_release_map = {
"_linux_distribution": ("Manjaro ARM", "24.03", "n/a"),
}

expectation = {
"os": "Manjaro ARM",
"os_family": "Arch",
"oscodename": "Manjaro ARM",
"osfullname": "Manjaro ARM",
"osrelease": "24.03",
"osrelease_info": (24, 3),
"osmajorrelease": 24,
"osfinger": "Manjaro ARM-24",
}
_run_os_grains_tests(_os_release_data, _os_release_map, expectation)


def test_unicode_error():
raise_unicode_mock = MagicMock(name="raise_unicode_error", side_effect=UnicodeError)
with patch("salt.grains.core.hostname"), patch(
Expand Down

0 comments on commit ba39288

Please sign in to comment.