Sample module code templateΒΆ

from chipsec.module_common import BaseModule
from chipsec.library.returncode import ModuleResult

class ModuleClass(BaseModule):
    """Class name aligns with file name, eg"""
    def __init__(self):

    def is_supported(self):
        """Module prerequisite checks"""
        if some_module_requirement():
            return True  # Module is applicable
        self.res = ModuleResult.NOTAPPLICABLE
        return False  # Module is not applicable

    def action(self):
        """Module test logic and methods as needed"""
        self.logger.log_passed('Module was successful!')
        return ModuleResult.PASSED

    def run(self, module_argv):
        """Primary module execution and result handling"""
        self.logger.start_test('Module Description')
        self.res = self.action()
        return self.res