kiwi-el8/test/unit/utils/os_release_test.py
Marcus Schäfer bddf25559d
Compat entry name for kernel-install in sd-boot
systemd-boot tools like kernel-install expect a certain
entry naming policy. This commit adapts kiwi to adapt to
this policy. The name for the default entry is constructed
out of the ID information from /etc/os-release followed
by the name of the kernel as it is represented by the
directory name in /lib/modules/... This Fixes #2417
2024-01-13 23:25:41 +01:00

20 lines
484 B
Python

from pytest import raises
from kiwi.utils.os_release import OsRelease
from kiwi.exceptions import KiwiOSReleaseImportError
class TestOsRelease(object):
def setup(self):
self.os_release = OsRelease('../data')
def setup_method(self, cls):
self.setup()
def test_setup_raises(self):
with raises(KiwiOSReleaseImportError):
OsRelease('does-not-exist')
def test_get(self):
assert self.os_release.get('ID') == 'opensuse-leap'