Skip to content

Commit 0f9d817

Browse files
committed
lsmod01.sh: Whitelist zcrypt
zcrypt (s390x specific module) has different refcnt: lsmod01 1 TINFO: lsmod output different from /proc/modules 118c118 < zcrypt 131072 9 --- > zcrypt 131072 8 This is probably due libcrypto update to support hardware acceleration of some algorithm that kmod is using, which causes increasing refcnt. Because it's would not be easy to get a generic mechanism to detect affected modules (ATM probably only zcrypt), whitelist parsing it. Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1237399 Link: https://lore.kernel.org/ltp/20250221121344.2778278-1-pvorel@suse.cz/ Suggested-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Cyril Hrubis <chrubis@suse.cz> Signed-off-by: Petr Vorel <pvorel@suse.cz>
1 parent d384076 commit 0f9d817

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

testcases/commands/lsmod/lsmod01.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
# SPDX-License-Identifier: GPL-2.0-or-later
3-
# Copyright (c) Linux Test Project, 2016-2021
3+
# Copyright (c) Linux Test Project, 2016-2025
44
# Copyright (c) 2015 Fujitsu Ltd.
55
# Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
66
#
@@ -14,6 +14,10 @@ TST_NEEDS_CMDS="lsmod"
1414

1515
module_inserted=
1616

17+
# lsmod triggers zcrypt refcount increase if it links against libssl
18+
# which uses hardware acceleration
19+
whitelist_modules='zcrypt'
20+
1721
setup()
1822
{
1923
if [ -z "$(cat /proc/modules)" ]; then
@@ -55,8 +59,8 @@ lsmod_matches_proc_modules()
5559
if [ "$lsmod_output" != "$modules_output" ]; then
5660
tst_res TINFO "lsmod output different from /proc/modules"
5761

58-
echo "$lsmod_output" > temp1
59-
echo "$modules_output" > temp2
62+
echo "$lsmod_output" | grep -v "^$whitelist_modules" > temp1
63+
echo "$modules_output" | grep -v "^$whitelist_modules" > temp2
6064
if tst_cmd_available diff; then
6165
diff temp1 temp2
6266
else

0 commit comments

Comments
 (0)