Created attachment 203200 [details] patch to skip sys/geom/class/nop/nop_test if geom_nop.ko not installed On my nanobsd system I didn't have geom_nop.ko module installed, so this test failed. Here is a patch to check for /boot/kernel/geom_nop.ko.
Comment on attachment 203200 [details] patch to skip sys/geom/class/nop/nop_test if geom_nop.ko not installed This patch isn't right. The "load_gnop" function should already skip the test if it can't load the g_nop module. That function must not be working correctly. What error do you get?
This is the error: $ geom nop load geom: Invalid class name. $
Ok, this partly boils down to a change introduced in r274631... $ git diff 2cfe78eed8ed3^..2cfe78eed8ed3 diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 8c15c2143e1e..5d23d933ec94 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -640,6 +640,11 @@ get_class(int *argc, char ***argv) #endif /* !STATIC_GEOM_CLASSES */ set_class_name(); + + /* If we can't load or list, it's not a class. */ + if (!std_available("load") && !std_available("list")) + errx(EXIT_FAILURE, "Invalid class name."); + if (*argc < 1) usage(); } ... and this code: 1318 if (sysctlbyname("kern.module_path", paths, &len, NULL, 0) < 0) 1319 err(EXIT_FAILURE, "sysctl(kern.module_path)"); 1320 for (p = strtok(paths, ";"); p != NULL; p = strtok(NULL, ";")) { 1321 snprintf(name, sizeof(name), "%s/geom_%s.ko", p, class_name); 1322 /* 1323 * If geom_<name>.ko file exists, "load" command is available. 1324 */ 1325 if (stat(name, &sb) == 0) 1326 return (1); 1327 } 1328 return (0); If the module doesn't exist, it will fail with `EXIT_FAILURE`. Why doesn't the test get skipped though? It looks like all of the load_gnop calls are kosher: $ grep -c load_gnop tests/sys/geom/class/nop/nop_test.sh 8 $ grep -c atf_add_test_case tests/sys/geom/class/nop/nop_test.sh 7 $
The code looks ok... getting the actual failure would definitely help for resolving this issue.
So I can close this PR because it's a "normal" (real regression) ?
(In reply to Olivier Cochard from comment #5) I don't think we've resolved the bug quite yet. First off, the message I pointed out in comment # 4 is misleading: it's not that the class name is invalid; it's just not available. Second off, I'd really like to get a log of the output from your test run: both the summary from `kyua test` and the in-depth output from `kyua debug`.
Ouch: I was digging into my Jenkins archives to retrieve the kyua's verbose output, and I didn't found any failed test regarding geom/class/nop :-( It's look like by digging this nop message, I've incorrectly works on the wrong tests cases (nop) but the culprit test was geom/class/mirror. (There is another PR about geom/class/mirror).
(In reply to Olivier Cochard from comment #7) Ah, that's good to hear (and you're tackling that in bug 237051!). I will close this bug, based on the summary/comment #0, but be sure to commit a change to geom to clarity what is actually going on when a class doesn't exist.