indeed. i don't know _why_ this is happening, but i think that means the
fix (attached) is obvious at least.



On Sat, May 27, 2023 at 9:40 AM Rob Landley <r...@landley.net> wrote:

> On 5/26/23 17:57, enh via Toybox wrote:
> > We're seeing (rare) flake in CI, without enough information to even
> > guess what the problem might be:
> > ```
> > FAIL: modinfo -F filename gets absolute path
> > echo -ne '' | modinfo -F filename
> > --- expected 2023-05-09 07:43:19.487000369 +0000
> > +++ actual 2023-05-09 07:43:19.507000369 +0000
> > @@ -1 +0,0 @@
> > -
> > ```
> >
> > Maybe at least knowing the module name will help?
>
> The "echo -ne" line right after the FAIL: line shows the command line that
> got
> called (and the input sent to it, in this case none). Your change:
>
> -testing "-F filename gets absolute path" "modinfo -F filename $MODULE1" \
> -  "$MODULE_PATH1\n" "" ""
> +testing "-F filename $MODULE1 gets absolute path" \
> +  "modinfo -F filename $MODULE1" "$MODULE_PATH1\n" "" ""
>
> doesn't seem like it's providing more information? The old one had
> $MODULE1 at
> the end of the command line, but your cut and paste failure message ends
> after
> -F filename, so it looks like $MODULE1 was blank?
>
> Rob
>
From d68412576d69949941be39a04c5bc83e27f88874 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <e...@google.com>
Date: Wed, 7 Jun 2023 12:39:10 -0700
Subject: [PATCH] modinfo.test: skip the -F test if we don't have a module.

That's why I was looking at this test initially, but while doing so I
saw the following failure on my Debian host, which is why I've also
added the `| sort -r`s:
```
FAIL: modinfo -F filename gets absolute path
echo -ne '' | modinfo -F filename lru_cache
--- expected	2023-06-07 12:36:49.369455714 -0700
+++ actual	2023-06-07 12:36:49.369455714 -0700
@@ -1 +1 @@
-/lib/modules/6.1.20-2rodete1-amd64/kernel/lib/lru_cache.ko
+/lib/modules/6.1.25-1rodete1-amd64/kernel/lib/lru_cache.ko
```
---
 tests/modinfo.test | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/modinfo.test b/tests/modinfo.test
index b860a3ea..eed5037f 100644
--- a/tests/modinfo.test
+++ b/tests/modinfo.test
@@ -17,9 +17,9 @@ fi
 testcmd "missing" "missing 2>&1" "modinfo: missing: not found\n" "" ""
 
 # Find some modules to work with.
-MODULE_PATH1=$(find $MODULE_ROOT/lib/modules/ -name *.ko | head -1 2>/dev/null)
+MODULE_PATH1=$(find $MODULE_ROOT/lib/modules/ -name *.ko | sort -r | head -1 2>/dev/null)
 MODULE1=$(basename -s .ko $MODULE_PATH1)
-MODULE_PATH2=$(find $MODULE_ROOT/lib/modules/ -name *.ko | head -2 | tail -1 2>/dev/null)
+MODULE_PATH2=$(find $MODULE_ROOT/lib/modules/ -name *.ko | sort -r | head -2 | tail -1 2>/dev/null)
 MODULE2=$(basename -s .ko $MODULE_PATH2)
 DASH_MODULE=$(basename -s .ko \
   $(find $MODULE_ROOT/lib/modules -name *-*.ko | tail -1 2>/dev/null))
@@ -42,6 +42,7 @@ testing "treats _ and - as equivalent" "modinfo $BAR_MODULE > bar-bar &&
 # Output of -F filename should be an absolute path to the module.
 # Otherwise, initrd generating scripts will break.
 
+skipnot [ -n "$MODULE1" ]
 testing "-F filename gets absolute path" "modinfo -F filename $MODULE1" \
   "$MODULE_PATH1\n" "" ""
 
-- 
2.41.0.162.gfafddb0af9-goog

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to