Skip to content
  • Janusz Krzysztofik's avatar
    lib/kunit: Read results from debugfs · 2d95df57
    Janusz Krzysztofik authored
    
    
    KUnit can provide KTAP reports from test modules via debugfs files, one
    per test suite.  Using that source of test results instead of extracting
    them from dmesg, where they may be interleaved with other kernel messages,
    seems more easy to handle and less error prone.  Switch to it.
    
    If KUnit debugfs support is found not configured then fall back to legacy
    processing path.
    
    v3: Try to open KUnit debugfs directory before applying KUnit filters we
        use for test case listing, otherwise those skip-all filters applied
        can break legacy path we may enter on missing KUnit debugfs support
        (detected by Kamil).
    v2: Check validity of debugfs argument before calling kunit_get_tests()
        (Kamil),
      - replace multiple openat() + fdopen/fdopendir(), each followed by an
        error check, with less expensive fopen/opendir() of file/dir pathname
        components concatenated to a local buffer, protected from buffer
        overflow or truncation with a single check for enough buffer space
        (Lucas),
      - avoid confusing 'if' statement condition (Lucas).
    
    Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
    Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
    Reviewed-by: default avatarKamil Konieczny <kamil.konieczny@linux.intel.com>
    2d95df57