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 (parent:
646cc66
)
Introduce the ComplexOptCheck superclass
author
Alexander Popov
<alex.popov@linux.com>
Tue, 12 Mar 2019 12:02:49 +0000
(15:02 +0300)
committer
Alexander Popov
<alex.popov@linux.com>
Tue, 12 Mar 2019 12:02:49 +0000
(15:02 +0300)
kconfig-hardened-check.py
patch
|
blob
|
history
diff --git
a/kconfig-hardened-check.py
b/kconfig-hardened-check.py
index fea5ef958b6eeec515cc9172cea07e825f6e86ca..6714f0570beed84adf26d54e6ad08b9017644bae 100755
(executable)
--- a/
kconfig-hardened-check.py
+++ b/
kconfig-hardened-check.py
@@
-68,16
+68,11
@@
class OptCheck:
return '{} = {}'.format(self.name, self.state)
return '{} = {}'.format(self.name, self.state)
-class
OR
:
+class
ComplexOptCheck
:
def __init__(self, *opts):
self.opts = opts
self.result = None
def __init__(self, *opts):
self.opts = opts
self.result = None
- # self.opts[0] is the option which this OR-check is about.
- # Use case:
- # OR(<X_is_hardened>, <X_is_disabled>)
- # OR(<X_is_hardened>, <X_is_hardened_old>)
-
@property
def name(self):
return self.opts[0].name
@property
def name(self):
return self.opts[0].name
@@
-98,6
+93,13
@@
class OR:
def reason(self):
return self.opts[0].reason
def reason(self):
return self.opts[0].reason
+
+class OR(ComplexOptCheck):
+ # self.opts[0] is the option which this OR-check is about.
+ # Use case:
+ # OR(<X_is_hardened>, <X_is_disabled>)
+ # OR(<X_is_hardened>, <X_is_hardened_old>)
+
def check(self):
for i, opt in enumerate(self.opts):
result, msg = opt.check()
def check(self):
for i, opt in enumerate(self.opts):
result, msg = opt.check()