X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=kconfig_hardened_check%2F__init__.py;h=d3cbad160280568c90b8a51d04ce338c0048c35b;hb=80d998f6a81715f020ea3032848d1f834ed2c730;hp=ae373d2241dcc8ad93b46bc3578465a6d13cf220;hpb=bbe60e75ac73b5513f86943775ac02285e0aecd0;p=kconfig-hardened-check.git diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index ae373d2..d3cbad1 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -97,6 +97,10 @@ class OptCheck: self.state = None self.result = None + @property + def type(self): + return None + def check(self): # handle the option presence check if self.expected is None: @@ -716,6 +720,8 @@ def print_checklist(mode, checklist, with_results): def populate_simple_opt_with_data(opt, data, data_type): if opt.type == 'complex': sys.exit('[!] ERROR: unexpected ComplexOptCheck {}: {}'.format(opt.name, vars(opt))) + if opt.type not in TYPES_OF_CHECKS: + sys.exit('[!] ERROR: invalid opt type "{}" for {}'.format(opt.type, opt.name)) if data_type not in TYPES_OF_CHECKS: sys.exit('[!] ERROR: invalid data type "{}"'.format(data_type))