Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Mar 2019 01:52:54 +0000
From:      bugzilla-noreply@freebsd.org
To:        testing@freebsd.org
Subject:   [Bug 236841] Check geom_nop.ko module for sys/geom/class/nop/nop_test
Message-ID:  <bug-236841-32464-kphOJAaL9B@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-236841-32464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-236841-32464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236841

--- Comment #3 from Enji Cooper <ngie@FreeBSD.org> ---
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 =3D strtok(paths, ";"); p !=3D NULL; p =3D 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) =3D=3D 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
$

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236841-32464-kphOJAaL9B>