From: Geliang Tang <tanggeliang(a)kylinos.cn>
This patchset uses post_socket_cb and post_connect_cb callbacks of struct
network_helper_opts to refactor do_test() in bpf_tcp_ca.c to move dctcp
test dedicated code out of do_test() into test_dctcp().
Patch 3 adds a new member in post_socket_opts and patch 4 adds a new
callback in network_helper_opts. I'm not sure if this is going too far.
Geliang Tang (4):
selftests/bpf: Use post_socket_cb in connect_to_fd_opts
selftests/bpf: Use start_server_addr in bpf_tcp_ca
selftests/bpf: Use connect_to_fd_opts in do_test in bpf_tcp_ca
selftests/bpf: Add post_connect_cb callback
tools/testing/selftests/bpf/network_helpers.c | 13 ++-
tools/testing/selftests/bpf/network_helpers.h | 8 +-
.../selftests/bpf/prog_tests/bpf_tcp_ca.c | 105 +++++++++++-------
3 files changed, 81 insertions(+), 45 deletions(-)
--
2.43.0
It seems obvious once you know, but at first I didn't realise that the
suite name is part of this format. Document it and add example.
Signed-off-by: Brendan Jackman <jackmanb(a)google.com>
---
Documentation/dev-tools/kunit/run_wrapper.rst | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Documentation/dev-tools/kunit/run_wrapper.rst b/Documentation/dev-tools/kunit/run_wrapper.rst
index 19ddf5e07013..e75a5fc05814 100644
--- a/Documentation/dev-tools/kunit/run_wrapper.rst
+++ b/Documentation/dev-tools/kunit/run_wrapper.rst
@@ -156,13 +156,20 @@ Filtering tests
===============
By passing a bash style glob filter to the ``exec`` or ``run``
-commands, we can run a subset of the tests built into a kernel . For
+commands, we can run a subset of the tests built into a kernel,
+identified by a string like ``$suite_name.$test_name``. For
example: if we only want to run KUnit resource tests, use:
.. code-block::
./tools/testing/kunit/kunit.py run 'kunit-resource*'
+Or to run just one specific test from that suite:
+
+.. code-block::
+
+ ./tools/testing/kunit/kunit.py run 'kunit-resource-test.kunit_resource_test_init_resources'
+
This uses the standard glob format with wildcard characters.
.. _kunit-on-qemu:
--
2.44.0.396.g6e790dbe36-goog
It seems obvious once you know, but at first I didn't realise that the
suite name is part of this format. Document it and add some examples.
Signed-off-by: Brendan Jackman <jackmanb(a)google.com>
---
v1->v2: Expanded to clarify that suite_glob and test_glob are two separate
patterns. Also made some other trivial changes to formatting etc.
Documentation/dev-tools/kunit/run_wrapper.rst | 33 +++++++++++++++++--
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/Documentation/dev-tools/kunit/run_wrapper.rst b/Documentation/dev-tools/kunit/run_wrapper.rst
index 19ddf5e07013..b07252d3fa9d 100644
--- a/Documentation/dev-tools/kunit/run_wrapper.rst
+++ b/Documentation/dev-tools/kunit/run_wrapper.rst
@@ -156,12 +156,39 @@ Filtering tests
===============
By passing a bash style glob filter to the ``exec`` or ``run``
-commands, we can run a subset of the tests built into a kernel . For
-example: if we only want to run KUnit resource tests, use:
+commands, we can run a subset of the tests built into a kernel,
+identified by a string like ``<suite_glob>[.<test_glob>]``.
+
+For example, to run the ``kunit-resource-test`` suite:
+
+.. code-block::
+
+ ./tools/testing/kunit/kunit.py run kunit-resource-test
+
+To run a specific test from that suite:
+
+.. code-block::
+
+ ./tools/testing/kunit/kunit.py run kunit-resource-test.kunit_resource_test
+
+To run all tests from suites whose names start with ``kunit``:
+
+.. code-block::
+
+ ./tools/testing/kunit/kunit.py run 'kunit*'
+
+To run all tests whose name ends with ``remove_resource``:
+
+.. code-block::
+
+ ./tools/testing/kunit/kunit.py run '*.*remove_resource'
+
+To run all tests whose name ends with ``remove_resource``, from suites whose
+names start with ``kunit``:
.. code-block::
- ./tools/testing/kunit/kunit.py run 'kunit-resource*'
+ ./tools/testing/kunit/kunit.py run 'kunit*.*remove_resource'
This uses the standard glob format with wildcard characters.
--
2.44.0.478.gd926399ef9-goog
Hi Linus,
Please pull the kselftest update for Linux 6.10-rc1.
This kselftest update for Linux 6.10-rc1 consists of:
- changes to make framework and tests reporting KTAP compliant
- changes to make ktap_helpers and power_supply test POSIX compliant
- adds ksft_exit_fail_perror() to include errono in string form
- fixes to avoid clang reporting false positive static analysis errors
about functions that exit and never return. ksft_exit* functions
are marked __noreturn to address this problem
- adds mechanism for reporting a KSFT_ result code
- fixes to build warnings related missing headers and unused variables
- fixes to clang build failures
- cleanups to resctrl test
- adds host arch for LLVM builds
Please note that Stepen found the following conflict in
tools/testing/selftests/mm/soft-dirty.c in next and fixed it up.
between commit:
258ff696db6b ("selftests/mm: soft-dirty should fail if a testcase fails")
from the mm-unstable branch of the mm tree and commit:
e6162a96c81d ("selftests/mm: ksft_exit functions do not return")
from the kselftest tree.
Stepehen's fix taking the 258ff696db6b change to use ksft_finished()
looks good to me.
diff for pull request is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit dd5a440a31fae6e459c0d6271dddd62825505361:
Linux 6.9-rc7 (2024-05-05 14:06:01 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-next-6.10-rc1
for you to fetch changes up to 2c3b8f8f37c6c0c926d584cf4158db95e62b960c:
selftests/sgx: Include KHDR_INCLUDES in Makefile (2024-05-08 17:08:46 -0600)
----------------------------------------------------------------
linux_kselftest-next-6.10-rc1
This kselftest update for Linux 6.10-rc1 consists of:
- changes to make framework and tests reporting KTAP compliant
- changes to make ktap_helpers and power_supply test POSIX compliant
- adds ksft_exit_fail_perror() to include errono in string form
- fixes to avoid clang reporting false positive static analysis errors
about functions that exit and never return. ksft_exit* functions
are marked __noreturn to address this problem
- adds mechanism for reporting a KSFT_ result code
- fixes to build warnings related missing headers and unused variables
- fixes to clang build failures
- cleanups to resctrl test
- adds host arch for LLVM builds
----------------------------------------------------------------
Amer Al Shanawany (2):
selftests: filesystems: add missing stddef header
selftests/capabilities: fix warn_unused_result build warnings
Edward Liaw (2):
selftests: Compile kselftest headers with -D_GNU_SOURCE
selftests/sgx: Include KHDR_INCLUDES in Makefile
John Hubbard (3):
selftests/binderfs: use the Makefile's rules, not Make's implicit rules
selftests/resctrl: fix clang build failure: use LOCAL_HDRS
selftests/resctrl: fix clang build warnings related to abs(), labs() calls
Lu Dai (1):
selftests: kselftest_deps: fix l5_test() empty variable
Maciej Wieczor-Retman (3):
selftests/resctrl: Add cleanup function to test framework
selftests/resctrl: Simplify cleanup in ctrl-c handler
selftests/resctrl: Move cleanups out of individual tests
Mark Brown (8):
kselftest: Add mechanism for reporting a KSFT_ result code
kselftest/tty: Report a consistent test name for the one test we run
kselftest/clone3: Make test names for set_tid test stable
tracing/selftests: Support log output when generating KTAP output
tracing/selftests: Default to verbose mode when running in kselftest
selftests/clone3: Fix compiler warning
selftests/clone3: Check that the child exited cleanly
selftests/clone3: Correct log message for waitpid() failures
Masami Hiramatsu (Google) (2):
selftests/ftrace: Fix BTFARG testcase to check fprobe is enabled correctly
selftests/ftrace: Fix checkbashisms errors
Muhammad Usama Anjum (9):
selftests: x86: test_vsyscall: reorder code to reduce #ifdef blocks
selftests: x86: test_vsyscall: conform test to TAP format output
selftests: x86: test_mremap_vdso: conform test to TAP format output
selftests/dmabuf-heap: conform test to TAP format output
kselftest: Add missing signature to the comments
selftests: add ksft_exit_fail_perror()
selftests: exec: Use new ksft_exit_fail_perror() helper
selftests: Mark ksft_exit_fail_perror() as __noreturn
selftests: cpufreq: conform test to TAP
Nathan Chancellor (10):
selftests/clone3: ksft_exit functions do not return
selftests/ipc: ksft_exit functions do not return
selftests: membarrier: ksft_exit_pass() does not return
selftests/mm: ksft_exit functions do not return
selftests: pidfd: ksft_exit functions do not return
selftests/resctrl: ksft_exit_skip() does not return
selftests: sync: ksft_exit_pass() does not return
selftests: timers: ksft_exit functions do not return
selftests: x86: ksft_exit_pass() does not return
selftests: kselftest: Make ksft_exit functions return void instead of int
Nícolas F. R. A. Prado (2):
selftests: ktap_helpers: Make it POSIX-compliant
selftests: power_supply: Make it POSIX-compliant
Valentin Obst (1):
selftests: default to host arch for LLVM builds
Yo-Jung (Leo) Lin (1):
Documentation: kselftest: fix codeblock
Documentation/dev-tools/kselftest.rst | 2 +-
tools/testing/selftests/Makefile | 4 +-
tools/testing/selftests/capabilities/test_execve.c | 12 +-
.../testing/selftests/capabilities/validate_cap.c | 7 +-
tools/testing/selftests/clone3/clone3.c | 7 +-
.../selftests/clone3/clone3_clear_sighand.c | 2 +-
tools/testing/selftests/clone3/clone3_set_tid.c | 121 +++--
tools/testing/selftests/cpufreq/cpufreq.sh | 3 +-
tools/testing/selftests/cpufreq/main.sh | 47 +-
tools/testing/selftests/cpufreq/module.sh | 6 +-
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 247 ++++------
tools/testing/selftests/exec/recursion-depth.c | 10 +-
.../selftests/filesystems/binderfs/Makefile | 2 -
.../filesystems/statmount/statmount_test.c | 1 +
tools/testing/selftests/ftrace/ftracetest | 8 +-
tools/testing/selftests/ftrace/ftracetest-ktap | 2 +-
.../ftrace/test.d/dynevent/add_remove_btfarg.tc | 2 +-
.../ftrace/test.d/dynevent/fprobe_entry_arg.tc | 2 +-
.../ftrace/test.d/kprobe/kretprobe_entry_arg.tc | 2 +-
tools/testing/selftests/ipc/msgque.c | 11 +-
tools/testing/selftests/kselftest.h | 49 +-
tools/testing/selftests/kselftest/ktap_helpers.sh | 4 +-
tools/testing/selftests/kselftest_deps.sh | 1 +
tools/testing/selftests/kselftest_harness.h | 2 +-
tools/testing/selftests/lib.mk | 14 +-
.../membarrier/membarrier_test_multi_thread.c | 2 +-
.../membarrier/membarrier_test_single_thread.c | 2 +-
tools/testing/selftests/mm/compaction_test.c | 6 +-
tools/testing/selftests/mm/cow.c | 2 +-
tools/testing/selftests/mm/gup_longterm.c | 2 +-
tools/testing/selftests/mm/gup_test.c | 4 +-
tools/testing/selftests/mm/ksm_functional_tests.c | 2 +-
tools/testing/selftests/mm/madv_populate.c | 2 +-
tools/testing/selftests/mm/mkdirty.c | 2 +-
tools/testing/selftests/mm/pagemap_ioctl.c | 4 +-
tools/testing/selftests/mm/soft-dirty.c | 2 +-
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 +-
tools/testing/selftests/pidfd/pidfd_open_test.c | 4 +-
tools/testing/selftests/pidfd/pidfd_poll_test.c | 2 +-
tools/testing/selftests/pidfd/pidfd_test.c | 2 +-
.../power_supply/test_power_supply_properties.sh | 2 +-
tools/testing/selftests/resctrl/Makefile | 4 +-
tools/testing/selftests/resctrl/cat_test.c | 8 +-
tools/testing/selftests/resctrl/cmt_test.c | 8 +-
tools/testing/selftests/resctrl/mba_test.c | 10 +-
tools/testing/selftests/resctrl/mbm_test.c | 10 +-
tools/testing/selftests/resctrl/resctrl.h | 9 +-
tools/testing/selftests/resctrl/resctrl_tests.c | 26 +-
tools/testing/selftests/resctrl/resctrl_val.c | 8 +-
tools/testing/selftests/sgx/Makefile | 2 +-
tools/testing/selftests/sgx/sigstruct.c | 1 -
tools/testing/selftests/sync/sync_test.c | 3 +-
tools/testing/selftests/timers/adjtick.c | 4 +-
.../testing/selftests/timers/alarmtimer-suspend.c | 4 +-
tools/testing/selftests/timers/change_skew.c | 4 +-
tools/testing/selftests/timers/freq-step.c | 4 +-
tools/testing/selftests/timers/leap-a-day.c | 10 +-
tools/testing/selftests/timers/leapcrash.c | 4 +-
tools/testing/selftests/timers/mqueue-lat.c | 4 +-
tools/testing/selftests/timers/posix_timers.c | 12 +-
tools/testing/selftests/timers/raw_skew.c | 6 +-
tools/testing/selftests/timers/set-2038.c | 4 +-
tools/testing/selftests/timers/set-tai.c | 4 +-
tools/testing/selftests/timers/set-timer-lat.c | 4 +-
tools/testing/selftests/timers/set-tz.c | 4 +-
tools/testing/selftests/timers/skew_consistency.c | 4 +-
tools/testing/selftests/timers/threadtest.c | 2 +-
tools/testing/selftests/timers/valid-adjtimex.c | 6 +-
tools/testing/selftests/tty/tty_tstamp_update.c | 48 +-
tools/testing/selftests/x86/lam.c | 2 +-
tools/testing/selftests/x86/test_mremap_vdso.c | 43 +-
tools/testing/selftests/x86/test_vsyscall.c | 506 ++++++++++-----------
72 files changed, 703 insertions(+), 675 deletions(-)
----------------------------------------------------------------
Hi Linus,
Please pull the following KUnit next update for Linux 6.10-rc1.
This kunit update for Linux 6.10-rc1 consists of:
- fix to race condition in try-catch completion
- change to __kunit_test_suites_init() to exit early if there is
nothing to test
- change to string-stream-test to use KUNIT_DEFINE_ACTION_WRAPPER
- moving fault tests behind KUNIT_FAULT_TEST Kconfig option
- kthread test fixes and improvements
- iov_iter test fixes
diff is attached.
Tests passed on linux-next on my test system:
- allmodconfig build
Default arch um:
./tools/testing/kunit/kunit.py run
./tools/testing/kunit/kunit.py run --alltests
./tools/testing/kunit/kunit.py run --arch x86_64
./tools/testing/kunit/kunit.py run --alltests --arch x86_64
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit dd5a440a31fae6e459c0d6271dddd62825505361:
Linux 6.9-rc7 (2024-05-05 14:06:01 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-kunit-6.10-rc1
for you to fetch changes up to 5496b9b77d7420652202b73cf036e69760be5deb:
kunit: bail out early in __kunit_test_suites_init() if there are no suites to test (2024-05-06 14:22:02 -0600)
----------------------------------------------------------------
linux_kselftest-kunit-6.10-rc1
This kunit update for Linux 6.10-rc1 consists of:
- fix to race condition in try-catch completion
- change to __kunit_test_suites_init() to exit early if there is
nothing to test
- change to string-stream-test to use KUNIT_DEFINE_ACTION_WRAPPER
- moving fault tests behind KUNIT_FAULT_TEST Kconfig option
- kthread test fixes and improvements
- iov_iter test fixes
----------------------------------------------------------------
David Gow (2):
kunit: Fix race condition in try-catch completion
kunit: test: Move fault tests behind KUNIT_FAULT_TEST Kconfig option
Ivan Orlov (1):
kunit: string-stream-test: use KUNIT_DEFINE_ACTION_WRAPPER
Mickaël Salaün (7):
kunit: Handle thread creation error
kunit: Fix kthread reference
kunit: Fix timeout message
kunit: Handle test faults
kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests
kunit: Print last test location on fault
kunit: Add tests for fault
Scott Mayhew (1):
kunit: bail out early in __kunit_test_suites_init() if there are no suites to test
Wander Lairson Costa (1):
kunit: unregister the device on error
include/kunit/test.h | 24 +++++++++++++++++++---
include/kunit/try-catch.h | 3 ---
kernel/kthread.c | 1 +
lib/kunit/Kconfig | 11 +++++++++++
lib/kunit/device.c | 2 +-
lib/kunit/kunit-test.c | 45 +++++++++++++++++++++++++++++++++++++++++-
lib/kunit/string-stream-test.c | 12 ++---------
lib/kunit/test.c | 3 +++
lib/kunit/try-catch.c | 40 ++++++++++++++++++++++++++-----------
lib/kunit_iov_iter.c | 18 ++++++++---------
10 files changed, 121 insertions(+), 38 deletions(-)
----------------------------------------------------------------
Hi Linus,
Please pull the nolibc update for Linux 6.10-rc1.
This nolibc update for Linux 6.10-rc1
- adds support for uname(2)
- removes open-coded strnlen()
- exports strlen()
- adds tests for strlcat() and strlcpy()
- fixes memory error in realloc()
- fixes strlcat() return code and size usage
- fixes strlcpy() return code and size usage
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 4cece764965020c22cff7665b18a012006359095:
Linux 6.9-rc1 (2024-03-24 14:10:05 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-nolibc-6.10-rc1
for you to fetch changes up to 0adab2b6b7336fb6ee3c6456a432dad3b1d25647:
tools/nolibc: add support for uname(2) (2024-04-14 20:28:54 +0200)
----------------------------------------------------------------
linux_kselftest-nolibc-6.10-rc1
This nolibc update for Linux 6.10-rc1
- adds support for uname(2)
- removes open-coded strnlen()
- exports strlen()
- adds tests for strlcat() and strlcpy()
- fixes memory error in realloc()
- fixes strlcat() return code and size usage
- fixes strlcpy() return code and size usage
----------------------------------------------------------------
Brennan Xavier McManus (1):
tools/nolibc/stdlib: fix memory error in realloc()
Rodrigo Campos (4):
tools/nolibc/string: export strlen()
tools/nolibc: Fix strlcat() return code and size usage
tools/nolibc: Fix strlcpy() return code and size usage
selftests/nolibc: Add tests for strlcat() and strlcpy()
Thomas Weißschuh (2):
tools/nolibc/string: remove open-coded strnlen()
tools/nolibc: add support for uname(2)
tools/include/nolibc/stdlib.h | 2 +-
tools/include/nolibc/string.h | 46 +++++++++-------
tools/include/nolibc/sys.h | 27 +++++++++
tools/testing/selftests/nolibc/nolibc-test.c | 82 ++++++++++++++++++++++++++++
4 files changed, 136 insertions(+), 21 deletions(-)
----------------------------------------------------------------
Clean up the KVM clock mess somewhat so that it is either based on the guest
TSC ("master clock" mode), or on the host CLOCK_MONOTONIC_RAW in cases where
the TSC isn't usable.
Eliminate the third variant where it was based directly on the *host* TSC,
due to bugs in e.g. __get_kvmclock().
Kill off the last vestiges of the KVM clock being based on CLOCK_MONOTONIC
instead of CLOCK_MONOTONIC_RAW and thus being subject to NTP skew.
Fix up migration support to allow the KVM clock to be saved/restored as an
arithmetic function of the guest TSC, since that's what it actually is in
the *common* case so it can be migrated precisely. Or at least to within
±1 ns which is good enough, as discussed in
https://lore.kernel.org/kvm/c8dca08bf848e663f192de6705bf04aa3966e856.camel@…
In v2 of this series, TSC synchronization is improved and simplified a bit
too, and we allow masterclock mode to be used even when the guest TSCs are
out of sync, as long as they're running at the same *rate*. The different
*offset* shouldn't matter.
And the kvm_get_time_scale() function annoyed me by being entirely opaque,
so I studied it until my brain hurt and then added some comments.
In v2 I also dropped the commits which were removing the periodic clock
syncs. Those are going to be needed still but *only* for non-masterclock
mode, which I'll do next. Along with ensuring that a masterclock update
while already in masterclock mode doesn't jump the clock, and just does
the same as KVM_SET_CLOCK_GUEST does to preserve it.
Needs a *lot* more testing. I think I'm almost done refactoring the code,
so should focus on building up the tests next.
(I do still hate that we're abusing KVM_GET_CLOCK just to get the tuple
of {host_tsc, CLOCK_REALTIME} without even *caring* about the eponymous
KVM clock. Especially as this information is (a) fundamentally what the
vDSO gettimeofday() exposes to us anyway, (b) using CLOCK_REALTIME not
TAI, (c) not available on other platforms, for example for migrating
the Arm arch counter.)
David Woodhouse (13):
KVM: x86/xen: Do not corrupt KVM clock in kvm_xen_shared_info_init()
KVM: x86: Improve accuracy of KVM clock when TSC scaling is in force
KVM: x86: Explicitly disable TSC scaling without CONSTANT_TSC
KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the documentation on TSC migration
KVM: x86: Avoid NTP frequency skew for KVM clock on 32-bit host
KVM: x86: Fix KVM clock precision in __get_kvmclock()
KVM: x86: Fix software TSC upscaling in kvm_update_guest_time()
KVM: x86: Simplify and comment kvm_get_time_scale()
KVM: x86: Remove implicit rdtsc() from kvm_compute_l1_tsc_offset()
KVM: x86: Improve synchronization in kvm_synchronize_tsc()
KVM: x86: Kill cur_tsc_{nsec,offset,write} fields
KVM: x86: Allow KVM master clock mode when TSCs are offset from each other
KVM: x86: Factor out kvm_use_master_clock()
Jack Allister (2):
KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for accurate KVM clock migration
KVM: selftests: Add KVM/PV clock selftest to prove timer correction
Documentation/virt/kvm/api.rst | 37 ++
Documentation/virt/kvm/devices/vcpu.rst | 115 +++-
arch/x86/include/asm/kvm_host.h | 15 +-
arch/x86/include/uapi/asm/kvm.h | 6 +
arch/x86/kvm/svm/svm.c | 3 +-
arch/x86/kvm/vmx/vmx.c | 2 +-
arch/x86/kvm/x86.c | 687 +++++++++++++++-------
arch/x86/kvm/xen.c | 4 +-
include/uapi/linux/kvm.h | 3 +
tools/testing/selftests/kvm/Makefile | 1 +
tools/testing/selftests/kvm/x86_64/pvclock_test.c | 192 ++++++
11 files changed, 822 insertions(+), 243 deletions(-)