-#!/usr/bin/python3
+#!/usr/bin/env python3
"""
This tool is for checking the security hardening options of the Linux kernel.
return input_text
if input_text.startswith('OK'):
color = GREEN_COLOR
- elif input_text.startswith('FAIL:'):
- color = RED_COLOR
else:
- assert(False), f'unexpected result "{input_text}"'
+ assert(input_text.startswith('FAIL:')), f'unexpected result "{input_text}"'
+ color = RED_COLOR
return f'{color}{input_text}{COLOR_END}'
self.state = None
self.result = None
+ @property
+ def type(self):
+ return None
+
def check(self):
# handle the 'is present' check
if self.expected == 'is present':
class KconfigCheck(OptCheck):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
- self.name = 'CONFIG_' + self.name
+ self.name = f'CONFIG_{self.name}'
@property
def type(self):
def table_print(self, mode, with_results):
if mode == 'verbose':
- print(f' {"<<< " + self.__class__.__name__ + " >>>":87}', end='')
+ class_name = f'<<< {self.__class__.__name__} >>>'
+ print(f' {class_name:87}', end='')
if with_results:
print(f'| {colorize_result(self.result)}', end='')
for o in self.opts: