1. 01 Nov, 2019 1 commit
    • David Gow's avatar
      lib/list-test: add a test for the 'list' doubly linked list · ea2dd7c0
      David Gow authored
      Add a KUnit test for the kernel doubly linked list implementation in
      include/linux/list.h
      
      Each test case (list_test_x) is focused on testing the behaviour of the
      list function/macro 'x'. None of the tests pass invalid lists to these
      macros, and so should behave identically with DEBUG_LIST enabled and
      disabled.
      
      Note that, at present, it only tests the list_ types (not the
      singly-linked hlist_), and does not yet test all of the
      list_for_each_entry* macros (and some related things like
      list_prepare_entry).
      
      Ignoring checkpatch.pl spurious errors related to its handling of for_each
      and other list macros. checkpatch.pl expects anything with for_each in its
      name to be a loop and expects that the open brace is placed on the same
      line as for a for loop. In this case, test case naming scheme includes
      name of the macro it is testing, which results in the spurious errors.
      Commit message updated by Shuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: default avatarDavid Gow <davidgow@google.com>
      Reviewed-by: default avatarBrendan Higgins <brendanhiggins@google.com>
      Tested-by: default avatarBrendan Higgins <brendanhiggins@google.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      ea2dd7c0
  2. 23 Oct, 2019 1 commit
  3. 07 Oct, 2019 2 commits
    • SeongJae Park's avatar
      Documentation: kunit: Fix verification command · d460623c
      SeongJae Park authored
      kunit wrapper script ('kunit.py') receives a sub-command (only 'run' for
      now) as its argument.  If no sub-command is given, it prints help
      message and just quit.  However, an example command in the kunit
      documentation for a verification of kunit is missing the sub-command.
      This commit fixes the example.
      Signed-off-by: default avatarSeongJae Park <sj38.park@gmail.com>
      Reviewed-by: default avatarBrendan Higgins <brendanhiggins@google.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      d460623c
    • SeongJae Park's avatar
      kunit: Fix '--build_dir' option · 6ec1b81d
      SeongJae Park authored
      Running kunit with '--build_dir' option gives following error message:
      
      ```
      $ ./tools/testing/kunit/kunit.py run --build_dir ../linux.out.kunit/
      [00:57:24] Building KUnit Kernel ...
      [00:57:29] Starting KUnit Kernel ...
      Traceback (most recent call last):
        File "./tools/testing/kunit/kunit.py", line 136, in <module>
          main(sys.argv[1:])
        File "./tools/testing/kunit/kunit.py", line 129, in main
          result = run_tests(linux, request)
        File "./tools/testing/kunit/kunit.py", line 68, in run_tests
          test_result = kunit_parser.parse_run_tests(kunit_output)
        File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line
      283, in parse_run_tests
          test_result =
      parse_test_result(list(isolate_kunit_output(kernel_output)))
        File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line
      54, in isolate_kunit_output
          for line in kernel_output:
        File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line
      145, in run_kernel
          process = self._ops.linux_bin(args, timeout, build_dir)
        File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line
      69, in linux_bin
          stderr=subprocess.PIPE)
        File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
          restore_signals, start_new_session)
        File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
          raise child_exception_type(errno_num, err_msg)
      FileNotFoundError: [Errno 2] No such file or directory: './linux'
      ```
      
      This error occurs because the '--build_dir' option value is not passed
      to the 'run_kernel()' function.  Consequently, the function assumes
      the kernel image that built for the tests, which is under the
      '--build_dir' directory, is in kernel source directory and finally raises
      the 'FileNotFoundError'.
      
      This commit fixes the problem by properly passing the '--build_dir'
      option value to the 'run_kernel()'.
      Signed-off-by: default avatarSeongJae Park <sj38.park@gmail.com>
      Reviewed-by: default avatarBrendan Higgins <brendanhiggins@google.com>
      Tested-by: default avatarBrendan Higgins <brendanhiggins@google.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      6ec1b81d
  4. 30 Sep, 2019 36 commits