Merge pull request #62 from evdenis/master
authorAlexander Popov <a13xp0p0v@users.noreply.github.com>
Thu, 28 Apr 2022 11:38:31 +0000 (14:38 +0300)
committerGitHub <noreply@github.com>
Thu, 28 Apr 2022 11:38:31 +0000 (14:38 +0300)
Add BLK_DEV_FD_RAWCMD

Thanks @evdenis!

kconfig_hardened_check/__init__.py

index ae373d2241dcc8ad93b46bc3578465a6d13cf220..d3cbad160280568c90b8a51d04ce338c0048c35b 100644 (file)
@@ -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))