projects
/
kconfig-hardened-check.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
25f10dd
)
Add check type
author
Alexander Popov
<alex.popov@linux.com>
Fri, 21 Jan 2022 22:33:43 +0000
(
01:33
+0300)
committer
Alexander Popov
<alex.popov@linux.com>
Fri, 21 Jan 2022 22:35:04 +0000
(
01:35
+0300)
kconfig_hardened_check/__init__.py
patch
|
blob
|
history
diff --git
a/kconfig_hardened_check/__init__.py
b/kconfig_hardened_check/__init__.py
index b6ff953ad920912a8dd18294981fcba00ee285fc..9a2d2c9aa59f94f81d035b07977c9ca1f69d5f09 100644
(file)
--- a/
kconfig_hardened_check/__init__.py
+++ b/
kconfig_hardened_check/__init__.py
@@
-108,8
+108,12
@@
class OptCheck:
class KconfigCheck(OptCheck):
class KconfigCheck(OptCheck):
+ @property
+ def type(self):
+ return "kconfig"
+
def table_print(self, _mode, with_results):
def table_print(self, _mode, with_results):
- print('CONFIG_{:<33}|{:^
11}|{:^10}|{:^18}'.format(self.nam
e, self.expected, self.decision, self.reason), end='')
+ print('CONFIG_{:<33}|{:^
7}|{:^11}|{:^10}|{:^18}'.format(self.name, self.typ
e, self.expected, self.decision, self.reason), end='')
if with_results:
print('| {}'.format(self.result), end='')
if with_results:
print('| {}'.format(self.result), end='')
@@
-135,7
+139,7
@@
class VerCheck:
def table_print(self, _mode, with_results):
ver_req = 'kernel version >= ' + str(self.ver_expected[0]) + '.' + str(self.ver_expected[1])
def table_print(self, _mode, with_results):
ver_req = 'kernel version >= ' + str(self.ver_expected[0]) + '.' + str(self.ver_expected[1])
- print('{:<
82
}'.format(ver_req), end='')
+ print('{:<
90
}'.format(ver_req), end='')
if with_results:
print('| {}'.format(self.result), end='')
if with_results:
print('| {}'.format(self.result), end='')
@@
-154,7
+158,7
@@
class PresenceCheck:
return True
def table_print(self, _mode, with_results):
return True
def table_print(self, _mode, with_results):
- print('CONFIG_{:<
75
}'.format(self.name + ' is present'), end='')
+ print('CONFIG_{:<
83
}'.format(self.name + ' is present'), end='')
if with_results:
print('| {}'.format(self.result), end='')
if with_results:
print('| {}'.format(self.result), end='')
@@
-186,7
+190,7
@@
class ComplexOptCheck:
def table_print(self, mode, with_results):
if mode == 'verbose':
def table_print(self, mode, with_results):
if mode == 'verbose':
- print(' {:
78
}'.format('<<< ' + self.__class__.__name__ + ' >>>'), end='')
+ print(' {:
86
}'.format('<<< ' + self.__class__.__name__ + ' >>>'), end='')
if with_results:
print('| {}'.format(self.result), end='')
for o in self.opts:
if with_results:
print('| {}'.format(self.result), end='')
for o in self.opts:
@@
-630,7
+634,7
@@
def print_checklist(mode, checklist, with_results):
if with_results:
sep_line_len += 30
print('=' * sep_line_len)
if with_results:
sep_line_len += 30
print('=' * sep_line_len)
- print('{:^40}|{:^
11}|{:^10}|{:^18}'.format('kconfig option nam
e', 'desired val', 'decision', 'reason'), end='')
+ print('{:^40}|{:^
7}|{:^11}|{:^10}|{:^18}'.format('option name', 'typ
e', 'desired val', 'decision', 'reason'), end='')
if with_results:
print('| {}'.format('check result'), end='')
print()
if with_results:
print('| {}'.format('check result'), end='')
print()