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:
01cd404
)
Improve ComplexOptCheck use cases
author
Alexander Popov
<alex.popov@linux.com>
Wed, 15 Jul 2020 13:12:54 +0000
(16:12 +0300)
committer
Alexander Popov
<alex.popov@linux.com>
Wed, 15 Jul 2020 13:12:54 +0000
(16:12 +0300)
kconfig_hardened_check/__init__.py
patch
|
blob
|
history
diff --git
a/kconfig_hardened_check/__init__.py
b/kconfig_hardened_check/__init__.py
index 060b1de3148ad8da88dcdc0b08d223a1b8a60313..635c927b4fbca6f75987c8d8c4d4f2c381f36e71 100644
(file)
--- a/
kconfig_hardened_check/__init__.py
+++ b/
kconfig_hardened_check/__init__.py
@@
-178,9
+178,9
@@
class ComplexOptCheck:
class OR(ComplexOptCheck):
# self.opts[0] is the option that this OR-check is about.
class OR(ComplexOptCheck):
# self.opts[0] is the option that this OR-check is about.
- # Use case:
+ # Use case
s
:
# OR(<X_is_hardened>, <X_is_disabled>)
# OR(<X_is_hardened>, <X_is_disabled>)
- # OR(<X_is_hardened>, <
X_is_hardened_ol
d>)
+ # OR(<X_is_hardened>, <
old_X_is_hardene
d>)
def check(self):
if not self.opts:
def check(self):
if not self.opts:
@@
-200,8
+200,10
@@
class OR(ComplexOptCheck):
class AND(ComplexOptCheck):
# self.opts[0] is the option that this AND-check is about.
class AND(ComplexOptCheck):
# self.opts[0] is the option that this AND-check is about.
- # Use case: AND(<suboption>, <main_option>)
- # Suboption is not checked if checking of the main_option is failed.
+ # Use cases:
+ # AND(<suboption>, <main_option>)
+ # Suboption is not checked if checking of the main_option is failed.
+ # AND(<X_is_disabled>, <old_X_is_disabled>)
def check(self):
for i, opt in reversed(list(enumerate(self.opts))):
def check(self):
for i, opt in reversed(list(enumerate(self.opts))):
@@
-211,7
+213,7
@@
class AND(ComplexOptCheck):
return ret
if not ret:
if hasattr(opt, 'expected'):
return ret
if not ret:
if hasattr(opt, 'expected'):
- self.result = 'FAIL: CONFIG_{}
is needed'.format(opt.name
)
+ self.result = 'FAIL: CONFIG_{}
not "{}"'.format(opt.name, opt.expected
)
else:
self.result = opt.result
return False
else:
self.result = opt.result
return False