1. 10 7月, 2019 1 次提交
  2. 15 5月, 2019 1 次提交
  3. 09 5月, 2019 1 次提交
    • S
      selftests: fix install target to use default install path · c3c59928
      Shuah Khan 提交于
      Install target fails when INSTALL_PATH is undefined. Fix install target
      to use "output_dir/install as the default install location. "output_dir"
      is either the root of selftests directory under kernel source tree or
      output directory specified by O= or KBUILD_OUTPUT.
      
      e.g:
      make -C tools/testing/selftests install
      <installs under tools/testing/selftests/install>
      
      make O=/tmp/kselftest -C tools/testing/selftests install
      <installs under /tmp/kselftest/install>
      
      export KBUILD_OUTPUT=/tmp/kselftest
      make -C tools/testing/selftests install
      <installs under /tmp/kselftest/install>
      
      In addition, add "all" target as dependency to "install" to build and
      install using a single command.
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      c3c59928
  4. 26 4月, 2019 4 次提交
    • K
      selftests: Remove KSFT_TAP_LEVEL · f41c322f
      Kees Cook 提交于
      Since sub-testing can now be detected by indentation level, this removes
      KSFT_TAP_LEVEL so that subtests report their TAP header for later parsing.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      f41c322f
    • K
      selftests: Move test output to diagnostic lines · 5c069b6d
      Kees Cook 提交于
      This changes the selftest output so that each test's output is prefixed
      with "# " as a TAP "diagnostic line".
      
      This creates a bit of a kernel-specific TAP dialect where the diagnostics
      precede the results. The TAP spec isn't entirely clear about this, though,
      so I think it's the correct solution so as to keep interactive runs making
      sense. If the output _followed_ the result line in the spec-suggested
      YAML form, each test would dump all of its output at once instead of as
      it went, making debugging harder.
      
      This does, however, solve the recursive TAP output problem, as sub-tests
      will simply be prefixed by "# ". Parsing sub-tests becomes a simple
      problem of just removing the first two characters of a given top-level
      test's diagnostic output, and parsing the results.
      
      Note that the shell construct needed to both get an exit code from
      the first command in a pipe and still filter the pipe (to add the "# "
      prefix) uses a POSIX solution rather than the bash "pipefail" option
      which is not supported by dash.
      
      Since some test environments may have a very minimal set of utilities
      available, the new prefixing code will fall back to doing line-at-a-time
      prefixing if perl and/or stdbuf are not available.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      5c069b6d
    • K
      selftests: Extract logic for multiple test runs · bf660782
      Kees Cook 提交于
      This moves the logic for running multiple tests into a single "run_many"
      function of runner.sh. Both "run_tests" and "emit_tests" are modified to
      use it. Summary handling is now controlled by the "per_test_logging"
      shell flag.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      bf660782
    • K
      selftests: Use runner.sh for emit targets · d4e59a53
      Kees Cook 提交于
      This reuses the new runner.sh for the emit targets instead of manually
      running each test via run_kselftest.sh.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      d4e59a53
  5. 23 4月, 2019 1 次提交
    • S
      selftests: build and run gpio when output directory is the src dir · d917fb87
      Shuah Khan 提交于
      Build and run gpio when output directory is the src dir.  gpio has
      dependency on tools/gpio and builds tools/gpio objects in the src
      directory in all cases making the src repo dirty even when object
      relocation is specified.
      
      This fixes the following commands from generating gpio objects in
      the source repository:
      
      make O=dir kselftest
      export KBUILD_OUTPUT=dir; make kselftest
      make O=dir -C tools/testing/selftests
      expoert KBUILD_OUTPUT=dir; make -C tools/testing/selftests
      
      The following commands still build gpio objects in the source repo
      (gpio Makefile needs to fixed):
      make O=dir kselftest TARGETS="gpio"
      export KBUILD_OUTPUT=dir; make kselftest TARGETS="gpio"
      make O=dir -C tools/testing/selftests TARGETS="gpio"
      expoert KBUILD_OUTPUT=dir; make -C tools/testing/selftests TARGETS="gpio"
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      d917fb87
  6. 20 4月, 2019 1 次提交
    • S
      selftests: fix headers_install circular dependency · 8ce72dc3
      Shuah Khan 提交于
      "make kselftest" fails with "Circular Makefile.o <- prepare dependency
      dropped." error, when lib.mk invokes "make headers_install".
      
      Make level 0: Main make calls selftests run_tests target
      ...
      Make level n: selftests lib.mk invokes main make's headers_install
      
      The secondary level make inherits builtin-rules which will use the rule
      to generate Makefile.o  and runs into "Circular Makefile.o <- prepare
      dependency dropped." error, and kselftest compile fails.
      
      Invoke headers_install target with --no-builtin-rules to avoid circular
      error.
      
      In addition, lib.mk installs headers in the default HDR_PATH, even when
      build relocation is requested with O= or export KBUILD_OUTPUT. Fix the
      problem by passing in INSTALL_HDR_PATH. The headers are installed under
      the specified output "dir/usr".
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      8ce72dc3
  7. 18 4月, 2019 1 次提交
  8. 06 3月, 2019 2 次提交
  9. 09 2月, 2019 1 次提交
  10. 30 1月, 2019 1 次提交
  11. 12 1月, 2019 1 次提交
  12. 21 12月, 2018 1 次提交
    • W
      selftests: add txtimestamp kselftest · cda261f4
      Willem de Bruijn 提交于
      Run the transmit timestamp tests as part of kselftests.
      
      Add a txtimestamp.sh test script that runs most variants:
      ipv4/ipv6, tcp/udp/raw/raw_ipproto/pf_packet, data/nodata,
      setsockopt/cmsg. The script runs tests with netem delays.
      
      Refine txtimestamp.c to validate results. Take expected
      netem delays as input and compare against real timestamps.
      
      To run without dependencies, add a listener socket to be
      able to connect in the case of TCP.
      
      Add the timestamping directory to the kselftests Makefile.
      Build all the binaries. Only run verified txtimestamp.sh.
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Acked-by: NSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cda261f4
  13. 14 12月, 2018 1 次提交
  14. 11 12月, 2018 1 次提交
    • M
      selftests/ima: kexec_load syscall test · a802ed0d
      Mimi Zohar 提交于
      The kernel CONFIG_KEXEC_VERIFY_SIG option is limited to verifying a
      kernel image's signature, when loaded via the kexec_file_load syscall.
      There is no method for verifying a kernel image's signature loaded
      via the kexec_load syscall.
      
      This test verifies loading the kernel image via the kexec_load syscall
      fails when the kernel CONFIG_KEXEC_VERIFY_SIG option is enabled on
      systems with secureboot enabled[1].
      
      [1] Detecting secureboot enabled is architecture specific.
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      a802ed0d
  15. 12 11月, 2018 1 次提交
  16. 07 11月, 2018 1 次提交
  17. 06 6月, 2018 2 次提交
  18. 31 5月, 2018 3 次提交
    • R
      selftests: cgroup: add memory controller self-tests · 84092dbc
      Roman Gushchin 提交于
      Cgroups are used for controlling the physical resource distribution
      (memory, CPU, io, etc) and often are used as basic building blocks
      for large distributed computing systems. Even small differences
      in the actual behavior may lead to significant incidents.
      
      The codebase is under the active development, which will unlikely
      stop at any time soon. Also it's scattered over different kernel
      subsystems, which makes regressions more probable.
      
      Given that, the lack of any tests is crying.
      
      This patch implements some basic tests for the memory controller,
      as well as a minimal required framework. It doesn't pretend for a
      very good coverage, but pretends to be a starting point.
      
      Hopefully, any following significant changes will include corresponding
      tests.
      
      Tests for CPU and io controllers, as well as cgroup core
      are next in the todo list.
      Signed-off-by: NRoman Gushchin <guro@fb.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: kernel-team@fb.com
      Cc: linux-kselftest@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NShuah Khan (Samsung OSG) <shuah@kernel.org>
      84092dbc
    • S
      selftests: lib.mk: add SKIP handling and test suite name to EMIT_TESTS · 3df6131f
      Shuah Khan (Samsung OSG) 提交于
      EMIT_TESTS which is the common function that implements run_tests target,
      treats all non-zero return codes from tests as failures. When tests are
      skipped with non-zero return code, because of unmet dependencies and/or
      unsupported configuration, it reports them as failed. This will lead to
      too many false negatives even on the tests that couldn't be run.
      
      EMIT_TESTS is changed to test for SKIP=4 return from tests to enable
      the framework for individual tests to return special SKIP code.
      
      Tests will be changed as needed to report SKIP instead FAIL/PASS when
      they get skipped.
      
      Currently just the test name is printed in the RUN_TESTS output. For
      example, when raw_skew sub-test from timers tests in run, the output
      shows just raw_skew. Include main test name when printing sub-test
      results.
      
      In addition, remove duplicate strings for printing common information with
      a new for the test header information.
      
      With this change run_kelftest.sh output for breakpoints test will be:
      
      TAP version 13
      Running tests in breakpoints
      ========================================
      selftests: breakpoints: step_after_suspend_test
      not ok 1..1 selftests: breakpoints: step_after_suspend_test [SKIP]
      selftests: breakpoints: breakpoint_test
      ok 1..2 selftests: breakpoints: breakpoint_test [PASS]
      Signed-off-by: NShuah Khan (Samsung OSG) <shuah@kernel.org>
      3df6131f
    • A
      selftests: move RTC tests to rtc subfolder · a12ab9e1
      Alexandre Belloni 提交于
      Move the RTC tests out of the timers folder as they are mostly unrelated.
      Keep rtcpie in timers as it only test hrtimers.
      Signed-off-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: NShuah Khan (Samsung OSG) <shuah@kernel.org>
      a12ab9e1
  19. 12 4月, 2018 1 次提交
  20. 05 4月, 2018 1 次提交
  21. 27 3月, 2018 1 次提交
    • M
      selftests: Print the test we're running to /dev/kmsg · 88893cf7
      Michael Ellerman 提交于
      Some tests cause the kernel to print things to the kernel log
      buffer (ie. printk), in particular oops and warnings etc. However when
      running all the tests in succession it's not always obvious which
      test(s) caused the kernel to print something.
      
      We can narrow it down by printing which test directory we're running
      in to /dev/kmsg, if it's writable.
      
      Example output:
      
        [  170.149149] kselftest: Running tests in powerpc
        [  305.300132] kworker/dying (71) used greatest stack depth: 7776 bytes
                       left
        [  808.915456] kselftest: Running tests in pstore
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      88893cf7
  22. 14 3月, 2018 1 次提交
  23. 06 3月, 2018 1 次提交
  24. 17 1月, 2018 1 次提交
    • M
      selftests: Fix loss of test output in run_kselftests.sh · 14f1889f
      Michael Ellerman 提交于
      Commit fbcab13d ("selftests: silence test output by default")
      changed the run_tests logic as well as the logic to generate
      run_kselftests.sh to redirect test output away from the console.
      
      As discussed on the list and at kernel summit, this is not a desirable
      default as it means in order to debug a failure the console output is
      not sufficient, you also need access to the test machine to get the
      full test logs. Additionally it's impolite to write directly to
      /tmp/$TEST_NAME on shared systems.
      
      The change to the run_tests logic was reverted in commit
      a323335e ("selftests: lib.mk: print individual test results to
      console by default"), and instead a summary option was added so that
      quiet output could be requested.
      
      However the change to run_kselftests.sh was left as-is.
      
      This commit applies the same logic to the run_kselftests.sh code, ie.
      the script now takes a "--summary" option which suppresses the output,
      but shows all output by default.
      
      Additionally instead of writing to /tmp/$TEST_NAME the output is
      redirected to the directory where the generated test script is
      located.
      
      Fixes: fbcab13d ("selftests: silence test output by default")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      14f1889f
  25. 15 11月, 2017 1 次提交
    • P
      android/ion: userspace test utility for ion buffer sharing · 47a18c42
      Pintu Agarwal 提交于
      This is a test utility to verify ION buffer sharing in user space
      between 2 independent processes.
      It uses unix domain socket (with SCM_RIGHTS) as IPC to transfer an FD to
      another process to share the same buffer.
      This utility demonstrates how ION buffer sharing can be implemented between
      two user space processes, using various heap types.
      
      This utility is made to be run as part of kselftest framework in kernel.
      The utility is verified on Ubuntu-32 bit system with Linux Kernel 4.14,
      using ION system heap.
      
      For more information about the utility please check the README file.
      Signed-off-by: NPintu Agarwal <pintu.ping@gmail.com>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      47a18c42
  26. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  27. 26 9月, 2017 1 次提交
  28. 21 9月, 2017 1 次提交
  29. 22 4月, 2017 2 次提交
  30. 19 2月, 2017 1 次提交
  31. 20 1月, 2017 2 次提交