From: Chuck Lever <chuck.lever(a)oracle.com>
Allow the new GSS Kerberos encryption type test suites to run
outside of the kunit infrastructure. Replace the assertion that
fires when lookup_enctype() so that the case is skipped instead of
failing outright.
Reported-by: Geert Uytterhoeven <geert(a)linux-m68k.org>
Signed-off-by: Chuck Lever <chuck.lever(a)oracle.com>
---
Hey Geert -
This patch addresses part of your concern: with this patch applied,
you should be able to run only the tests that target the encryption
types that are enabled in your kernel. The other tests will be
skipped rather than fail outright.
net/sunrpc/auth_gss/gss_krb5_test.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/net/sunrpc/auth_gss/gss_krb5_test.c b/net/sunrpc/auth_gss/gss_krb5_test.c
index c287ce15c419..0a7c5280e4e3 100644
--- a/net/sunrpc/auth_gss/gss_krb5_test.c
+++ b/net/sunrpc/auth_gss/gss_krb5_test.c
@@ -49,7 +49,8 @@ static void kdf_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
derivedkey.data = kunit_kzalloc(test, param->expected_result->len,
GFP_KERNEL);
@@ -83,7 +84,8 @@ static void checksum_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
Kc.len = gk5e->Kc_length;
Kc.data = kunit_kzalloc(test, Kc.len, GFP_KERNEL);
@@ -725,7 +727,8 @@ static void rfc3962_encrypt_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
cbc_tfm = crypto_alloc_sync_skcipher(gk5e->aux_cipher, 0, 0);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
@@ -1319,7 +1322,8 @@ static void rfc6803_encrypt_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
usage.data[3] = param->constant;
@@ -1810,7 +1814,8 @@ static void rfc8009_encrypt_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
*(__be32 *)usage.data = cpu_to_be32(2);
@@ -1975,7 +1980,8 @@ static void encrypt_selftest_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
cbc_tfm = crypto_alloc_sync_skcipher(gk5e->aux_cipher, 0, 0);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
Add basic support to run m68k under QEMU via kunit_tool.
Signed-off-by: Geert Uytterhoeven <geert(a)linux-m68k.org>
---
Does this need CONFIG_VIRTIO_CONSOLE=y? It seems to work fine without.
drivers/clk/.kunitconfig:
Fails because m68k uses big-endian I/O ops
drivers/gpu/drm/tests/.kunitconfig
kernel BUG at drivers/gpu/drm/drm_buddy.c:21!
(also on arm, ignored)
drivers/gpu/drm/vc4/tests/.kunitconfig
Depends on arm, works on arm
drivers/hid/.kunitconfig
Unable to handle kernel NULL pointer dereference at virtual address (ptrval)
Oops: 00000000
PC: [<001d7380>] uclogic_params_ugee_v2_has_battery+0x6/0x68
(also on arm, ignored)
fs/ext4/.kunitconfig: OK
fs/fat/.kunitconfig: OK
kernel/kcsan/.kunitconfig
Needs HAVE_ARCH_KCSAN and SMP
(the former also on arm, ignored)
lib/kunit/.kunitconfig: OK
mm/kfence/.kunitconfig
Needs HAVE_ARCH_KFENCE
(fails on arm due to missing CONFIG_KFENCE_KUNIT_TEST=y, which
depends on TRACEPOINTS)
net/sunrpc/.kunitconfig
After dropping CONFIG_STACKTRACE=y (why is this needed?) from
net/sunrpc/.kunitconfig:
Unable to handle kernel NULL pointer dereference at virtual address (ptrval)
(also on arm, ignored)
---
tools/testing/kunit/qemu_configs/m68k.py | 10 ++++++++++
1 file changed, 10 insertions(+)
create mode 100644 tools/testing/kunit/qemu_configs/m68k.py
diff --git a/tools/testing/kunit/qemu_configs/m68k.py b/tools/testing/kunit/qemu_configs/m68k.py
new file mode 100644
index 0000000000000000..287fc386f8a7ff16
--- /dev/null
+++ b/tools/testing/kunit/qemu_configs/m68k.py
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0-only
+from ..qemu_config import QemuArchParams
+
+QEMU_ARCH = QemuArchParams(linux_arch='m68k',
+ kconfig='''
+CONFIG_VIRT=y''',
+ qemu_arch='m68k',
+ kernel_path='vmlinux',
+ kernel_command_line='console=hvc0',
+ extra_qemu_params=['-machine', 'virt'])
--
2.34.1
Fix spelling mistakes in run.sh "drvier" => "driver" and
in gitsource.sh "senconds" => "seconds".
Signed-off-by: Sukrut Bellary <sukrut.bellary(a)gmail.com>
---
tools/testing/selftests/amd-pstate/gitsource.sh | 4 ++--
tools/testing/selftests/amd-pstate/run.sh | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/amd-pstate/gitsource.sh b/tools/testing/selftests/amd-pstate/gitsource.sh
index dbc1fe45599d..5f2171f0116d 100755
--- a/tools/testing/selftests/amd-pstate/gitsource.sh
+++ b/tools/testing/selftests/amd-pstate/gitsource.sh
@@ -117,7 +117,7 @@ parse_gitsource()
printf "Gitsource-$1-#$2 power consumption(J): $en_sum\n" | tee -a $OUTFILE_GIT.result
# Permance is the number of run gitsource per second, denoted 1/t, where 1 is the number of run gitsource in t
- # senconds. It is well known that P=E/t, where P is power measured in watts(W), E is energy measured in joules(J),
+ # seconds. It is well known that P=E/t, where P is power measured in watts(W), E is energy measured in joules(J),
# and t is time measured in seconds(s). This means that performance per watt becomes
# 1/t 1/t 1
# ----- = ----- = ---
@@ -175,7 +175,7 @@ gather_gitsource()
printf "Gitsource-$1 avg power consumption(J): $avg_en\n" | tee -a $OUTFILE_GIT.result
# Permance is the number of run gitsource per second, denoted 1/t, where 1 is the number of run gitsource in t
- # senconds. It is well known that P=E/t, where P is power measured in watts(W), E is energy measured in joules(J),
+ # seconds. It is well known that P=E/t, where P is power measured in watts(W), E is energy measured in joules(J),
# and t is time measured in seconds(s). This means that performance per watt becomes
# 1/t 1/t 1
# ----- = ----- = ---
diff --git a/tools/testing/selftests/amd-pstate/run.sh b/tools/testing/selftests/amd-pstate/run.sh
index 57cad57e59c0..de4d8e9c9565 100755
--- a/tools/testing/selftests/amd-pstate/run.sh
+++ b/tools/testing/selftests/amd-pstate/run.sh
@@ -244,7 +244,7 @@ prerequisite()
if [ "$scaling_driver" != "$CURRENT_TEST" ]; then
echo "$0 # Skipped: Test can only run on $CURRENT_TEST driver or run comparative test."
echo "$0 # Please set X86_AMD_PSTATE enabled or run comparative test."
- echo "$0 # Current cpufreq scaling drvier is $scaling_driver."
+ echo "$0 # Current cpufreq scaling driver is $scaling_driver."
exit $ksft_skip
fi
else
@@ -252,7 +252,7 @@ prerequisite()
"tbench" | "gitsource")
if [ "$scaling_driver" != "$COMPARATIVE_TEST" ]; then
echo "$0 # Skipped: Comparison test can only run on $COMPARISON_TEST driver."
- echo "$0 # Current cpufreq scaling drvier is $scaling_driver."
+ echo "$0 # Current cpufreq scaling driver is $scaling_driver."
exit $ksft_skip
fi
;;
--
2.25.1
Hi Linus,
Please pull the following KUnit next update for Linux 6.3-rc1.
This KUnit update for Linux 6.3-rc1 consists of cleanups, new features,
and documentation updates:
-- adds Function Redirection API to isolate the code being tested from
other parts of the kernel. functionredirection.rst has the details.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 4ec5183ec48656cec489c49f989c508b68b518e3:
Linux 6.2-rc7 (2023-02-05 13:13:28 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-kunit-6.3-rc1
for you to fetch changes up to 82649c7c0da431d147a75c6ae768ee42c1053f53:
kunit: Add printf attribute to fail_current_test_impl (2023-02-08 18:08:14 -0700)
----------------------------------------------------------------
linux-kselftest-kunit-6.3-rc1
This KUnit update for Linux 6.3-rc1 consists of cleanups, new features,
and documentation updates:
-- adds Function Redirection API to isolate the code being tested from
other parts of the kernel. functionredirection.rst has the details.
----------------------------------------------------------------
Alexander Pantyukhin (2):
tools/testing/kunit/kunit.py: remove redundant double check
kunit: kunit.py extract handlers
David Gow (3):
kunit: Add "hooks" to call into KUnit when it's built as a module
kunit: Expose 'static stub' API to redirect functions
kunit: Add printf attribute to fail_current_test_impl
Rae Moar (1):
lib/hashtable_test.c: add test for the hashtable structure
Sadiya Kazi (1):
Documentation: Add Function Redirection API docs
.../dev-tools/kunit/api/functionredirection.rst | 162 +++++++++++
Documentation/dev-tools/kunit/api/index.rst | 13 +-
Documentation/dev-tools/kunit/usage.rst | 15 +-
include/kunit/static_stub.h | 113 ++++++++
include/kunit/test-bug.h | 29 +-
lib/Kconfig.debug | 13 +
lib/Makefile | 9 +
lib/hashtable_test.c | 317 +++++++++++++++++++++
lib/kunit/Makefile | 4 +
lib/kunit/hooks-impl.h | 31 ++
lib/kunit/hooks.c | 21 ++
lib/kunit/kunit-example-test.c | 38 +++
lib/kunit/static_stub.c | 123 ++++++++
lib/kunit/test.c | 15 +-
tools/testing/kunit/kunit.py | 186 ++++++------
15 files changed, 966 insertions(+), 123 deletions(-)
create mode 100644 Documentation/dev-tools/kunit/api/functionredirection.rst
create mode 100644 include/kunit/static_stub.h
create mode 100644 lib/hashtable_test.c
create mode 100644 lib/kunit/hooks-impl.h
create mode 100644 lib/kunit/hooks.c
create mode 100644 lib/kunit/static_stub.c
----------------------------------------------------------------
I'd like to announce the release of kdevops v6.2 [0] [1]. I had already written
about most of the new features on the v6.2-rc1 release in the December 2022
notes [2], but since a new features cannot regress we've seen a few more new
features sneak in since then. I'll re-iterate a few of the newest major
features added since our last release (v5.0.2):
* ZNS
* CXL
* NFS
* Initial Kernel selftests suport: firmware, sysctl, kmod
* OCI cloud support
* libvirt use 9p now for local builds
* PCI-passthrough support including a new dynamic kconfig interface for it
* Building qemu for you
* 12 btrfs profiles to test
* Results for tests are now archived see workflows/fstests/results/
for an example namespace
For more details of release notes you can refer to the v6.2-rc1 [3] and
v6.2 [4] git tags.
Thanks a lot to the developers who have contributed:
Adam Manzanares
Amir Goldstein
Chandan Babu R
Jeff Layton
Joel Granados
Josef Bacik
Luis Chamberlain
Pankaj Raghav
*If* it makes sense, we may set up a stable brach for v6.2.y releases so
which could fixate on the vagrant setup, so that folks using libvirt
can get fixes. If we do that it would make sense to just merge fixes
to the master branch first before the stable branch as well just as we
do in upstream linux / stable branches.
Luis
[0] https://github.com/linux-kdevops/kdevops
[1] https://gitlab.com/linux-kdevops/kdevops
[2] https://people.kernel.org/mcgrof/kdevops-v6-2-rc1-released
[3] https://github.com/linux-kdevops/kdevops/releases/tag/v6.2-rc1
[4] https://github.com/linux-kdevops/kdevops/releases/tag/v6.2
As discussed here is a small series to address the confusing lifetime
scheme for the hwpt. This was some leftover from prior rework that was
never fully cleaned up.
Make it clear that the ioas and ioas->hwpt_list are associated with the
hwpt during creation and never changed until it is destroyed. A hwpt with
a positive reference count is always valid for device attachment.
This is a step toward the nesting and replace series.
I have this on github:
https://github.com/jgunthorpe/linux/commits/iommufd_hwpt
v2:
- Basically completely different
- Add a test for HWPT cases by enhancing the mock iommu driver to be more
complete
- Move the device attachment as well into iommufd_hw_pagetable_alloc()
so destroy is more symmetric
v1: https://lore.kernel.org/r/0-v1-4336b5cb2fe4+1d7-iommufd_hwpt_jgg@nvidia.com
Jason Gunthorpe (7):
iommufd: Assert devices_lock for iommufd_hw_pagetable_has_group()
iommufd: Add iommufd_lock_obj() around the auto-domains hwpts
iommufd: Move ioas related HWPT destruction into
iommufd_hw_pagetable_destroy()
iommufd: Move iommufd_device to iommufd_private.h
iommufd: Make iommufd_hw_pagetable_alloc() do iopt_table_add_domain()
iommufd/selftest: Make selftest create a more complete mock device
iommufd/selftest: Add a selftest for iommufd_device_attach() with a
hwpt argument
drivers/iommu/iommufd/device.c | 150 +++++---------
drivers/iommu/iommufd/hw_pagetable.c | 72 ++++++-
drivers/iommu/iommufd/iommufd_private.h | 35 +++-
drivers/iommu/iommufd/selftest.c | 196 +++++++++++++++---
tools/testing/selftests/iommu/iommufd.c | 15 +-
.../selftests/iommu/iommufd_fail_nth.c | 8 -
6 files changed, 319 insertions(+), 157 deletions(-)
base-commit: 8473685c99683f9e2c7e2a42ef3d3f14a79be274
--
2.39.1
From: Rong Tao <rongtao(a)cestc.cn>
Added bpf_find_vma test in commit f108662b27c9("selftests/bpf: Add tests
for bpf_find_vma") to assign values to variables that declare const in
find_vma_fail1.c programs, which is an error to the compiler and does not
test BPF verifiers. It is better to replace 'const vm_flags_t vm_flags'
with 'unsigned long vm_start' for testing.
$ make -C tools/testing/selftests/bpf/ -j8
...
progs/find_vma_fail1.c:16:16: error: cannot assign to non-static data
member 'vm_flags' with const-qualified type 'const vm_flags_t' (aka
'const unsigned long')
vma->vm_flags |= 0x55;
~~~~~~~~~~~~~ ^
../tools/testing/selftests/bpf/tools/include/vmlinux.h:1898:20:
note: non-static data member 'vm_flags' declared const here
const vm_flags_t vm_flags;
~~~~~~~~~~~`~~~~~~^~~~~~~~
Signed-off-by: Rong Tao <rongtao(a)cestc.cn>
---
tools/testing/selftests/bpf/progs/find_vma_fail1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/progs/find_vma_fail1.c b/tools/testing/selftests/bpf/progs/find_vma_fail1.c
index b3b326b8e2d1..47d5dedff554 100644
--- a/tools/testing/selftests/bpf/progs/find_vma_fail1.c
+++ b/tools/testing/selftests/bpf/progs/find_vma_fail1.c
@@ -13,7 +13,7 @@ static long write_vma(struct task_struct *task, struct vm_area_struct *vma,
struct callback_ctx *data)
{
/* writing to vma, which is illegal */
- vma->vm_flags |= 0x55;
+ vma->vm_start = 0xffffffffff600000;
return 0;
}
--
2.39.2