-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add spec and parser for etc_sysconfig_kernel (#4221)
* feat: add spec and parser for etc_sysconfig_kernel Signed-off-by: Xiaoxue Wang <xiaoxwan@redhat.com> * fix: test coverage to 100% for insights/specs/default.py Signed-off-by: Xiaoxue Wang <xiaoxwan@redhat.com>
- Loading branch information
Showing
6 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from insights.parsers.sysconfig import KernelSysconfig | ||
from insights.tests import context_wrap | ||
|
||
SYSCONFIG_KERNEL = """ | ||
# UPDATEDEFAULT specifies if new-kernel-pkg should make | ||
# new kernels the default | ||
UPDATEDEFAULT=yes | ||
# DEFAULTKERNEL specifies the default kernel package type | ||
DEFAULTKERNEL=kernel | ||
# MAKEDEBUG specifies if new-kernel-pkg should create non-default | ||
# "debug" entries for new kernels. | ||
MAKEDEBUG=yes | ||
""".strip() | ||
|
||
|
||
def test_sysconfig_nfs(): | ||
result = KernelSysconfig(context_wrap(SYSCONFIG_KERNEL)) | ||
assert result['UPDATEDEFAULT'] == 'yes' | ||
assert result.get('DEFAULTKERNEL') == 'kernel' | ||
assert result.get('MAKEDEBUG') == 'yes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters