summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2018-06-01Merge branch 'akpm-current/current'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'nvdimm/libnvdimm-for-next'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'kselftest/next'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'staging/staging-next'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'rcu/rcu/next'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'tip/auto-latest'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'bpf-next/master'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'net-next/master'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'cpupower/cpupower'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'pm/linux-next'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'powerpc/next'Stephen Rothwell
2018-06-01Merge remote-tracking branch 'dma-mapping/for-next'Stephen Rothwell
2018-05-30selftests: lib: fix prime_numbers module search and skip logicShuah Khan (Samsung OSG)
prime_numbers modules search and skip logic removes the module instead of searching for it. Fix it. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: intel_pstate: notification about privilege required to run ↵Jeffrin Jose T
intel_pstate testing script The intel_pstate related testing script need root level privileges when trying to access certain file for the successful execution of the script.But this is not the case always like when using evaluation only mode, which only require user level privilege. This patch is to notify the user about the privilege the script demands for the successful execution of the test. Signed-off-by: Jeffrin Jose T (Rajagiri SET) <ahiliation@gmail.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: cgroup/memcontrol: add basic test for socket accountingMike Rapoport
The test verifies that when there is active TCP connection, the memory.stat.sock and memory.current values are close. Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Acked-by: Roman Gushchin <guro@fb.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftest: intel_pstate: debug support message from aperf.c and return valueJeffrin Jose T
Additional message along with an error message which is more verbose for debug support from aperf.c and updated with the new return value "KSFT_SKIP". Signed-off-by: Jeffrin Jose T [Rajagiri SET] <ahiliation@gmail.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30kselftest/cgroup: fix variable dereferenced before check warningRoman Gushchin
cg_name(const char *root, const char *name) is always called with non-empty root and name arguments, so there is no sense in checking it in the function body (after using in strlen()). Signed-off-by: Roman Gushchin <guro@fb.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests/intel_pstate: Enhance table printingDaniel Díaz
Using coreutils' pr, a nicer table is printed out with the results. Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests/intel_pstate: Improve test, minor fixesDaniel Díaz
A few changes improve the overall usability of the test: * fix a hard-coded maximum frequency (3300), * don't adjust the CPU frequency if only evaluating results, * fix a comparison for multiple frequencies. A symptom of that last issue looked like this: ./run.sh: line 107: [: too many arguments ./run.sh: line 110: 3099 3099 3100-3100: syntax error in expression (error token is \"3099 3100-3100\") Because a check will count how many differente frequencies there are among the CPUs of the system, and after they are tallied another read is performed, which might produce different results. Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: cgroup/memcontrol: add basic test for swap controlsMike Rapoport
The new test verifies that memory.swap.max and memory.swap.current behave as expected for simple allocation scenarios Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Roman Gushchin <guro@fb.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: cgroup: add memory controller self-testsRoman 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: Roman 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: Tejun Heo <tj@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: memfd: split regular and hugetlbfs testsShuah Khan (Samsung OSG)
Split normal memfd and hugetlbfs tests to improve the test reporting. Remove run_fuse_test.sh and memfd_test from run_tests.sh and add them to the Makefile. Add memfd_test to TEST_GEN_PROGS to be run separately. Rename run_tests.sh to run_hugetlbfs_test.sh Add run_fuse_test.sh and run_hugetlbfs_test.sh to TEST_PROGS The report for non-root run wth this change is: TAP version 13 selftests: memfd: memfd_test ======================================== memfd: CREATE memfd: BASIC memfd: SEAL-WRITE memfd: SEAL-SHRINK memfd: SEAL-GROW memfd: SEAL-RESIZE memfd: SHARE-DUP memfd: SHARE-MMAP memfd: SHARE-OPEN memfd: SHARE-FORK memfd: SHARE-DUP (shared file-table) memfd: SHARE-MMAP (shared file-table) memfd: SHARE-OPEN (shared file-table) memfd: SHARE-FORK (shared file-table) memfd: DONE ok 1..1 selftests: memfd: memfd_test [PASS] selftests: memfd: run_fuse_test.sh ======================================== opening: ./mnt/memfd fuse: DONE ok 1..2 selftests: memfd: run_fuse_test.sh [PASS] selftests: memfd: run_hugetlbfs_test.sh ======================================== Please run memfd with hugetlbfs test as root not ok 1..3 selftests: memfd: run_hugetlbfs_test.sh [SKIP] Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: net: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When net test is skipped because of unmet dependencies and/or unsupported configuration, it returns 0 which is treated as a pass by the Kselftest framework. This leads to false positive result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Change psock_tpacket to use ksft_exit_skip() when a non-root user runs the test and add an explicit check for root and a clear message, instead of failing the test when /sys/power/state file open fails. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: mqueue: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When mqueue test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Change it to use ksft_exit_skip() when the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: memory-hotplug: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When memory-hotplug test is skipped because of unmet dependencies and/or unsupported configuration, it returns non-zero value hich is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: memfd: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When memfd test is skipped because of unmet dependencies and/or unsupported configuration, it returns non-zero value which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Added an explicit check for root user at the start of memfd hugetlbfs test and return skip code if a non-root user attempts to run it. In addition, return skip code when not enough huge pages are available to run the test. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: membarrier: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When membarrier test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Change it to use ksft_exit_skip() when the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: media_tests: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When media_tests test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Change it to use ksft_exit_skip() when the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: locking: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When locking test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Added an explicit search for ww_mutex module and return skip code if it isn't found to differentiate between the failure to load the module condition and module not found condition. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: locking: add Makefile for locking testShuah Khan (Samsung OSG)
Add Makefile for locking test. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: lib: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When lib test(s) is skipped because of unmet dependencies and/or unsupported configuration, it returns non-zero value hich is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: lib: add prime_numbers.sh test to MakefileShuah Khan (Samsung OSG)
prime_numbers.sh is not included in TEST_PROGS. Add it. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: kvm: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When kvm test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Change it to use ksft_exit_skip() when the test is skipped. In addition, refine test_assert() message to include strerror() string and add explicit check for EACCES to cleary identify when test doesn't run when access is denied to resources required e.g: open /dev/kvm failed, rc: -1 errno: 13 Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: kmod: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When kmod test is skipped because of unmet dependencies and/or unsupported configuration, it returns 0 which is treated as a pass by the Kselftest framework. This leads to false positive result even when the test could not be run. It returns fail in some cases when test is skipped. Either way, it is incorrect and incosnistent reporting. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Reviewed-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: ipc: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When ipc test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Change it to use ksft_exit_skip() when the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: intel_pstate: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When intel_pstate test is skipped because of unmet dependencies and/or unsupported configuration, it returns 0 which is treated as a pass by the Kselftest framework. This leads to false positive result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: gpio: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When gpio test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: firmware: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When firmware test(s) get skipped because of unmet dependencies and/or unsupported configuration, it returns 0 which is treated as a pass by the Kselftest framework. This leads to false positive result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Reviewed-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: filesystems: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When devpts_pts test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. In another case, it returns pass for a skipped test reporting a false postive. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Change it to use ksft_exit_skip() when test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: exec: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When execveat test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Change it to use ksft_exit_skip() when kernel doesn't support execveat. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: efivarfs: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When efivarfs test is skipped because of unmet dependencies and/or unsupported configuration, it returns 0 which is treated as a pass by the Kselftest framework. This leads to false positive result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: cpufreq: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When cpufreq test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: cpu-hotplug: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When cpu-on-off-test is skipped because of unmet dependencies and/or unsupported configuration, it returns 0 which is treated as a pass by the Kselftest framework. This leads to false positive result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: breakpoints: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When step_after_suspend_test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Change it to use ksft_exit_skip() when a non-root user runs the test and add an explicit check for root and a clear message, instead of failing the test when /sys/power/state file open fails. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: android: ion: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)
When ion test is skipped because of unmet dependencies and/or unsupported configuration, it returns 0 which is treated as a pass by the Kselftest framework. This leads to false positive result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Acked-by: Pintu Agarwal <pintu.ping@gmail.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: memory-hotplug: delete RUN_TESTS and EMIT_TESTS overridesShuah Khan (Samsung OSG)
Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in lib.mk. Common defines work after making the change the test to run with ratio=2 as the default mode to be able to invoke the test without the "-r 2" argument from the common RUN_TESTS and EMIT_TESTS. The run_full_tests target now calls the test with "-r 10". Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Lei.Yang@windriver.com Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: mqueue: delete RUN_TESTS and EMIT_TESTS overridesShuah Khan (Samsung OSG)
Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in lib.mk. The overrides are in place to call mq_open_tests with queue name argument. The change to delete overrides is coupled with a change to mq_open_tests to use default queue name when it is called without one. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: mount: delete RUN_TESTS and EMIT_TESTS overridesShuah Khan (Samsung OSG)
Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in lib.mk. Add new run_tests.sh to do the dependency checks the custom RUN_TESTS did. Common defines work with the run_tests.sh set as the TEST_PROGS and defining unprivileged-remount-test in TEST_GEN_FILES. Kselftest framework builds and installs TEST_GEN_FILES and doesn't run them via RUN_TESTS and include it in EMIT_TESTS. With this change the new run_tests.sh runs the test after checking dependencies. This change also adds Skip handling to return kselftest skip code when test is skipped to clearly identify when the test is skipped instead of reporting it as failed. Output with this change: TAP version 13 selftests: mount: run_tests.sh ======================================== WARN: No /proc/self/uid_map exist, test skipped. not ok 1..1 selftests: mount: run_tests.sh [SKIP] Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: futex: delete RUN_TESTS and EMIT_TESTS overridesShuah Khan (Samsung OSG)
Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in lib.mk. Common defines work just fine and there is no need to define custom overrides. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: android: delete RUN_TESTS and EMIT_TESTS overridesShuah Khan (Samsung OSG)
Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in lib.mk. Common defines work just fine and there is no need to define custom overrides. Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>