All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] lsmod01.sh: Fix failure when CONFIG_MODULE_UNLOAD is not set
@ 2020-12-21 11:51 Radoslav Kolev
  2021-01-05 11:47 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Radoslav Kolev @ 2020-12-21 11:51 UTC (permalink / raw)
  To: ltp

If CONFIG_MODULE_UNLOAD is not set lsmod shows '-2' (-ENOENT) for
the used by column, but /proc/modules has only '-' there.

Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com>
---
 testcases/commands/lsmod/lsmod01.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/commands/lsmod/lsmod01.sh b/testcases/commands/lsmod/lsmod01.sh
index c373b2893..2e044c718 100755
--- a/testcases/commands/lsmod/lsmod01.sh
+++ b/testcases/commands/lsmod/lsmod01.sh
@@ -44,7 +44,9 @@ cleanup()
 
 lsmod_matches_proc_modules()
 {
-	lsmod_output=$(lsmod | awk '!/Module/{print $1, $2, $3}' | sort)
+	lsmod_output=$(lsmod \
+			| awk '!/Module/{print $1, $2, ($3==-2) ? "-" : $3}' \
+			| sort)
 	if [ -z "$lsmod_output" ]; then
 		tst_brk TBROK "Failed to parse the output from lsmod"
 	fi
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [LTP] [PATCH] lsmod01.sh: Fix failure when CONFIG_MODULE_UNLOAD is not set
  2020-12-21 11:51 [LTP] [PATCH] lsmod01.sh: Fix failure when CONFIG_MODULE_UNLOAD is not set Radoslav Kolev
@ 2021-01-05 11:47 ` Petr Vorel
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2021-01-05 11:47 UTC (permalink / raw)
  To: ltp

Hi Radoslav,

> If CONFIG_MODULE_UNLOAD is not set lsmod shows '-2' (-ENOENT) for
> the used by column, but /proc/modules has only '-' there.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Merged, thanks!

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-05 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21 11:51 [LTP] [PATCH] lsmod01.sh: Fix failure when CONFIG_MODULE_UNLOAD is not set Radoslav Kolev
2021-01-05 11:47 ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.