1. 06 Sep, 2017 1 commit
  2. 25 Aug, 2017 5 commits
    • Shuah Khan's avatar
      selftests: lib.mk: change RUN_TESTS to print messages in TAP13 format · 1f87c7c1
      Shuah Khan authored
      Change common RUN_TESTS to print messages in user friendly TAP13 format.
      This change add TAP13 header at the start of RUN_TESTS target run, and
      prints the resulting pass/fail messages with test number information in
      the TAP 13 format for each test in the run tests list.
      
      This change covers test scripts as well as test programs. Test programs
      have an option to use ksft_ API, however test scripts won't be able to.
      With this change, test scripts can print TAP13 format output without any
      changes to individual scripts.
      
      Test programs can provide TAP13 format output as needed as some tests
      already do. Tests that haven't been converted will benefit from this
      change. Tests that are converted benefit from the test counts for all
      the tests in each test directory.
      
      Running firmware tests:
      make --silent -C tools/testing/selftests/firmware/ run_tests
      
      Before the change:
      
      modprobe: ERROR: could not insert 'test_firmware': Operation not
      permitted
      ./fw_filesystem.sh: /sys/devices/virtual/misc/test_firmware not present
      You must have the following enabled in your kernel:
      CONFIG_TEST_FIRMWARE=y
      selftests:  fw_filesystem.sh [FAIL]
      modprobe: ERROR: could not insert 'test_firmware': Operation not
      permitted
      selftests:  fw_fallback.sh [FAIL]
      
      After the change:
      
      TAP version 13
      selftests: fw_filesystem.sh
      ========================================
      modprobe: ERROR: could not insert 'test_firmware': Operation not
      permitted
      ./fw_filesystem.sh: /sys/devices/virtual/misc/test_firmware not present
      You must have the following enabled in your kernel:
      CONFIG_TEST_FIRMWARE=y
      not ok 1..1 selftests:  fw_filesystem.sh [FAIL]
      selftests: fw_fallback.sh
      ========================================
      modprobe: ERROR: could not insert 'test_firmware': Operation not
      permitted
      not ok 1..2 selftests:  fw_fallback.sh [FAIL]
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      1f87c7c1
    • Shuah Khan's avatar
      selftests: change lib.mk RUN_TESTS to take test list as an argument · 77d802e2
      Shuah Khan authored
      Change lib.mk RUN_TESTS to take test list as an argument. This will
      allow it to be called from individual test makefiles to run additional
      tests that aren't suitable for a default kselftest run. As an example,
      timers test includes destructive tests that aren't included in the
      common run_tests target.
      
      Change times/Makefile to use RUN_TESTS call with destructive test list
      as an argument instead of using its own RUN_TESTS target.
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      77d802e2
    • Shuah Khan's avatar
      selftests: lib.mk: suppress "cd" output from run_tests target · 49b73645
      Shuah Khan authored
      Suppress "cd" output from run_tests while running tests to declutter the
      test results.
      
      Running efivarfs test:
      make --silent -C tools/testing/selftests/efivarfs/ run_tests
      
      Before the change:
      
      skip all tests: must be run as root
      selftests: efivarfs.sh [PASS]
      /lkml/linux-kselftest/tools/testing/selftests/efivarfs
      
      After the change:
      
      skip all tests: must be run as root
      selftests: efivarfs.sh [PASS]
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      49b73645
    • Shuah Khan's avatar
      selftests: kselftest framework: change skip exit code to 0 · 11867a77
      Shuah Khan authored
      When a test is skipped, instead of using a special exit code of 4, treat
      it as pass condition and use exit code of 0. It makes sense to treat skip
      as pass since the test couldn't be run as opposed to a failed test.
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      11867a77
    • Benjamin Gaignard's avatar
      selftests/timers: make loop consistent with array size · 8f14e26b
      Benjamin Gaignard authored
      clocksource_list array is defined as char [10][30] so
      to initialise it we only have to iterate 10 times.
      Signed-off-by: default avatarBenjamin Gaignard <benjamin.gaignard@linaro.org>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      8f14e26b
  3. 23 Aug, 2017 1 commit
  4. 22 Aug, 2017 3 commits
  5. 16 Aug, 2017 4 commits
  6. 14 Aug, 2017 1 commit
  7. 11 Aug, 2017 1 commit
  8. 09 Aug, 2017 2 commits
  9. 02 Aug, 2017 6 commits
  10. 28 Jul, 2017 3 commits
  11. 26 Jul, 2017 6 commits
  12. 24 Jul, 2017 7 commits
    • Daniel Díaz's avatar
      selftests: Fix installation for splice test · 5cc3027f
      Daniel Díaz authored
      Simplify the Makefile rules so that the test is
      automatically installed (and cleaned) by leveraging
      the TEST_GEN_PROGS_EXTENDED definition.
      Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
      Signed-off-by: default avatarDaniel Díaz <daniel.diaz@linaro.org>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      5cc3027f
    • Eugeniu Rosca's avatar
      selftests: watchdog: get boot reason via WDIOC_GETBOOTSTATUS · a3d6d79f
      Eugeniu Rosca authored
      Some watchdog drivers implement WDIOF_CARDRESET feature. As example,
      see commit b6ef36d2 ("watchdog: qcom: Report reboot reason").
      This option allows reporting to userspace the cause of the last boot
      (POR/watchdog reset), being helpful in e.g. automated test-cases.
      
      Add support for WDIOC_GETBOOTSTATUS in the test code, to be able to:
      - check if watchdog drivers properly implement WDIOF_CARDRESET.
      - check the last boot status, if WDIOF_CARDRESET is implemented.
      
      Make the `-b, --bootstatus` option one-shot. That means, skip the
      keepalive mechanism if `-b` is provided on the command line, as we
      are only interested in the boot status information.
      
      Tested on Rcar-H3 Salvator-X board:
      
      ********************** Cold boot finished
      salvator-x:/home/root# ./watchdog-test -h
      Usage: ./watchdog-test [options]
       -b, --bootstatus    Get last boot status (Watchdog/POR)
       -d, --disable       Turn off the watchdog timer
       -e, --enable        Turn on the watchdog timer
       -h, --help          Print the help message
       -p, --pingrate=P    Set ping rate to P seconds (default 1)
       -t, --timeout=T     Set timeout to T seconds
      
      Parameters are parsed left-to-right in real-time.
      Example: ./watchdog-test -d -t 10 -p 5 -e
      salvator-x:/home/root#
      salvator-x:/home/root# ./watchdog-test -b
      Last boot is caused by: Power-On-Reset.
      salvator-x:/home/root#
      salvator-x:/home/root# ./watchdog-test -d -t 1 -p 2 -e
      Watchdog card disabled.
      Watchdog timeout set to 1 seconds.
      Watchdog ping rate set to 2 seconds.
      Watchdog card enabled.
      Watchdog Ticking Away!
      ********************** Reboot due to watchdog trigger finished
      salvator-x:/home/root# ./watchdog-test -b
      Last boot is caused by: Watchdog.
      salvator-x:/home/root#
      salvator-x:/home/root# reboot
      ********************** Reboot due to user action finished
      salvator-x:/home/root# ./watchdog-test -b
      Last boot is caused by: Power-On-Reset.
      salvator-x:/home/root#
      Signed-off-by: default avatarEugeniu Rosca <erosca@de.adit-jv.com>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      a3d6d79f
    • Eugeniu Rosca's avatar
      selftests: watchdog: avoid keepalive flood · f8f92c07
      Eugeniu Rosca authored
      Calling `watchdog-test [options] -p 0` results in flooding the kernel
      with WDIOC_KEEPALIVE. Fix this by enforcing 1 second as minimal/default
      keepalive/ping rate.
      Signed-off-by: default avatarEugeniu Rosca <erosca@de.adit-jv.com>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      f8f92c07
    • Eugeniu Rosca's avatar
      selftests: watchdog: point out ioctl() failures · 42f34c4e
      Eugeniu Rosca authored
      Report the failure of WDIOC_SETOPTIONS/WDIOC_SETTIMEOUT ioctls.
      Signed-off-by: default avatarEugeniu Rosca <erosca@de.adit-jv.com>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      42f34c4e
    • Eugeniu Rosca's avatar
      selftests: watchdog: prefer strtoul() over atoi() · 7a5e10d4
      Eugeniu Rosca authored
      commit f15d7114 ("Documentation/watchdog: add timeout and ping rate
      control to watchdog-test.c") used both atoi() and strtoul() for string
      to integer conversion. As usage of atoi() is discouraged in newer code,
      replace it with strtoul() for consistency.
      Signed-off-by: default avatarEugeniu Rosca <erosca@de.adit-jv.com>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      7a5e10d4
    • Eugeniu Rosca's avatar
      selftests: watchdog: use getopt_long() · 749fb263
      Eugeniu Rosca authored
      Switch from manual argv[] parsing to getopt_long() argument processing.
      This creates more readable code and allows easier feature addition.
      This also fixes some segmentation faults introduced by
      commit 1dbdcc81 ("selftests: watchdog: accept multiple params on
      command line"), when options -t or -p are not given the required value:
      
      ./watchdog-test -p 1 -t
      ./watchdog-test -t 1 -p
      
      No changes are intended in the way watchdog-test interacts with the
      kernel. The only noticible changes, tightly related to the addition
      of getopt (and done for easier maintenance),  are:
      - help message has been reworked and migrated to a dedicated function.
      - all short/long options and the help message are sorted alphabetically.
      - all case statements inside the getopt loop are sorted alphabetically.
      
      Fixes: 1dbdcc81 ("selftests: watchdog: accept multiple params on command line")
      Signed-off-by: default avatarEugeniu Rosca <erosca@de.adit-jv.com>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      749fb263
    • Eugeniu Rosca's avatar
      selftests: watchdog: fix mixed whitespace · 0c528da8
      Eugeniu Rosca authored
      Convert spaces to tabs for checkpatch compliance. Quick way to verify
      this is by running `git show -w <commit-id>`, which returns an empty
      commit body. No functional change intended.
      Signed-off-by: default avatarEugeniu Rosca <erosca@de.adit-jv.com>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      0c528da8