• Rae Moar's avatar
    kunit: add ability to run tests after boot using debugfs · c72a8709
    Rae Moar authored
    Add functionality to run built-in tests after boot by writing to a
    debugfs file.
    
    Add a new debugfs file labeled "run" for each test suite to use for
    this purpose.
    
    As an example, write to the file using the following:
    
    echo "any string" > /sys/kernel/debugfs/kunit/<testsuite>/run
    
    This will trigger the test suite to run and will print results to the
    kernel log.
    
    To guard against running tests concurrently with this feature, add a
    mutex lock around running kunit. This supports the current practice of
    not allowing tests to be run concurrently on the same kernel.
    
    This new functionality could be used to design a parameter
    injection feature in the future.
    
    Fixed up merge conflict duing rebase to Linux 6.7-rc6
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    Reviewed-by: default avatarDavid Gow <davidgow@google.com>
    Signed-off-by: default avatarRae Moar <rmoar@google.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    c72a8709
debugfs.c 5.84 KB