class OptCheck:
def __init__(self, reason, decision, name, expected):
assert(name and name == name.strip() and len(name.split()) == 1), \
class OptCheck:
def __init__(self, reason, decision, name, expected):
assert(name and name == name.strip() and len(name.split()) == 1), \
val_len = len(expected.split())
if val_len == 3:
assert(expected in ('is not set', 'is not off')), \
val_len = len(expected.split())
if val_len == 3:
assert(expected in ('is not set', 'is not off')), \
self.result = 'FAIL: "' + self.state + '"'
def table_print(self, _mode, with_results):
self.result = 'FAIL: "' + self.state + '"'
def table_print(self, _mode, with_results):
- print('{:<40}|{:^7}|{:^12}|{:^10}|{:^18}'.format(self.name, self.type, self.expected, self.decision, self.reason), end='')
+ print(f'{self.name:<40}|{self.type:^7}|{self.expected:^12}|{self.decision:^10}|{self.reason:^18}', end='')
def json_dump(self, with_results):
dump = [self.name, self.type, self.expected, self.decision, self.reason]
def json_dump(self, with_results):
dump = [self.name, self.type, self.expected, self.decision, self.reason]
class VersionCheck:
def __init__(self, ver_expected):
assert(ver_expected and isinstance(ver_expected, tuple) and len(ver_expected) == 2), \
class VersionCheck:
def __init__(self, ver_expected):
assert(ver_expected and isinstance(ver_expected, tuple) and len(ver_expected) == 2), \
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])
assert(isinstance(opts[0], (KconfigCheck, CmdlineCheck))), \
assert(isinstance(opts[0], (KconfigCheck, CmdlineCheck))), \
def json_dump(self, with_results):
dump = self.opts[0].json_dump(False)
def json_dump(self, with_results):
dump = self.opts[0].json_dump(False)
else:
# VersionCheck provides enough info
assert(opt.result.startswith('OK: version')), \
else:
# VersionCheck provides enough info
assert(opt.result.startswith('OK: version')), \
# VersionCheck provides enough info
self.result = opt.result
assert(opt.result.startswith('FAIL: version')), \
# VersionCheck provides enough info
self.result = opt.result
assert(opt.result.startswith('FAIL: version')), \
if hasattr(o3, 'name'):
known_options.append(o3.name)
for option, value in parsed_options.items():
if option not in known_options:
if hasattr(o3, 'name'):
known_options.append(o3.name)
for option, value in parsed_options.items():
if option not in known_options:
- print('{:^40}|{:^7}|{:^12}|{:^10}|{:^18}'.format('option name', 'type', 'desired val', 'decision', 'reason'), end='')
+ print(f"{'option name':^40}|{'type':^7}|{'desired val':^12}|{'decision':^10}|{'reason':^18}", end='')
def populate_simple_opt_with_data(opt, data, data_type):
assert(opt.type != 'complex'), \
def populate_simple_opt_with_data(opt, data, data_type):
assert(opt.type != 'complex'), \
opt.state = data.get(opt.name, None)
else:
assert(data_type == 'version'), \
opt.state = data.get(opt.name, None)
else:
assert(data_type == 'version'), \
populate_simple_opt_with_data(o, data, data_type)
else:
assert(opt.type in ('kconfig', 'cmdline')), \
populate_simple_opt_with_data(o, data, data_type)
else:
assert(opt.type in ('kconfig', 'cmdline')), \
arch, msg = detect_arch(args.config, supported_archs)
if not arch:
sys.exit('[!] ERROR: {}'.format(msg))
if mode != 'json':
arch, msg = detect_arch(args.config, supported_archs)
if not arch:
sys.exit('[!] ERROR: {}'.format(msg))
if mode != 'json':
kernel_version, msg = detect_kernel_version(args.config)
if not kernel_version:
sys.exit('[!] ERROR: {}'.format(msg))
if mode != 'json':
kernel_version, msg = detect_kernel_version(args.config)
if not kernel_version:
sys.exit('[!] ERROR: {}'.format(msg))
if mode != 'json':
# add relevant kconfig checks to the checklist
add_kconfig_checks(config_checklist, arch)
# add relevant kconfig checks to the checklist
add_kconfig_checks(config_checklist, arch)
add_kconfig_checks(config_checklist, arch)
add_cmdline_checks(config_checklist, arch)
if mode != 'json':
add_kconfig_checks(config_checklist, arch)
add_cmdline_checks(config_checklist, arch)
if mode != 'json':