]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools: Use test/kmod instead of kmod-nolib
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 3 Jul 2013 00:03:20 +0000 (21:03 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 3 Jul 2013 00:15:54 +0000 (21:15 -0300)
The reason to have a kmod-nolib binary is that we need to call kmod on
test cases (or a symlink to it) and for testing things in tree. Since
we are using libtool if we are dinamically linking to libkmod what we
end up having is a shell script that (depending on the version *)
changes argv[0] to contain an "lt-" prefix. Since this screws with our
compat stuff, we had a kmod-nolib that links statically.

This all workaround works fine iff we are using one of the compat
commands, i.e. we are using the symlinks insmod, rmmod, modprobe, etc.
However if we are actually trying the kmod binary, this doesn't work
because we can't create a kmod symlink since there's already a kmod
binary.

So, completely give up on libtool fixing their mess. Now we create a
tool/test/ directory and the symlinks and kmod is put there.

* http://lists.gnu.org/archive/html/bug-libtool/2011-12/msg00023.html

Makefile.am
testsuite/test-depmod.c
testsuite/test-modinfo.c
testsuite/test-modprobe.c
tools/.gitignore

index b1bfd5998db1646a960259d592bfc694f91b2e64..f93ed789c6737b2c9b485ed2e04546a7656497b7 100644 (file)
@@ -104,8 +104,8 @@ uninstall-hook:
 if BUILD_TOOLS
 bin_PROGRAMS = tools/kmod
 
-noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \
-                tools/modprobe tools/modinfo tools/depmod
+noinst_SCRIPTS = tools/test/insmod tools/test/rmmod tools/test/lsmod \
+                tools/test/modprobe tools/test/modinfo tools/test/depmod
 
 tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/lsmod.c \
                     tools/rmmod.c tools/insmod.c \
@@ -115,12 +115,12 @@ tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/lsmod.c \
 tools_kmod_LDADD = libkmod/libkmod-util.la \
                   libkmod/libkmod.la
 
-noinst_PROGRAMS = tools/kmod-nolib
-tools_kmod_nolib_SOURCES = $(tools_kmod_SOURCES)
-tools_kmod_nolib_LDADD = libkmod/libkmod-util.la \
+noinst_PROGRAMS = tools/test/kmod
+tools_test_kmod_SOURCES = $(tools_kmod_SOURCES)
+tools_test_kmod_LDADD = libkmod/libkmod-util.la \
                         libkmod/libkmod-private.la
 
-${noinst_SCRIPTS}: tools/kmod-nolib
+${noinst_SCRIPTS}: tools/test/kmod
        $(AM_V_GEN) ($(RM) $@; \
                $(LN_S) $(notdir $<) $@)
 endif
index 0ea89829ca3aa70a8c106de568e4bee668dae79c..64eb0270abef543184948865c9a14072238d38ed 100644 (file)
@@ -31,7 +31,7 @@
 #define MODULES_ORDER_LIB_MODULES MODULES_ORDER_ROOTFS "/lib/modules/" MODULES_ORDER_UNAME
 static __noreturn int depmod_modules_order_for_compressed(const struct test *t)
 {
-       const char *progname = ABS_TOP_BUILDDIR "/tools/depmod";
+       const char *progname = ABS_TOP_BUILDDIR "/tools/test/depmod";
        const char *const args[] = {
                progname,
                NULL,
index c5934ea79ba72312bd0582a493b0acd3d0336e77..430e7ad6b4cd1bf0512e8f71f6c405dfe05cdf53 100644 (file)
@@ -28,7 +28,7 @@
 
 static __noreturn int modinfo_jonsmodules(const struct test *t)
 {
-       const char *progname = ABS_TOP_BUILDDIR "/tools/modinfo";
+       const char *progname = ABS_TOP_BUILDDIR "/tools/test/modinfo";
        const char *const args[] = {
                progname,
                "/ext4-i686.ko", "/ext4-ppc64.ko", "/ext4-s390x.ko",
index cc90dae8b10d2cb7efe0e67a02aaa0833c0b6488..e4a324300a7a39fbe79bb05f04a1a55ed83d4d3b 100644 (file)
@@ -28,7 +28,7 @@
 
 static __noreturn int modprobe_show_depends(const struct test *t)
 {
-       const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+       const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
        const char *const args[] = {
                progname,
                "--show-depends", "btusb",
@@ -50,7 +50,7 @@ static DEFINE_TEST(modprobe_show_depends,
 
 static __noreturn int modprobe_show_depends2(const struct test *t)
 {
-       const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+       const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
        const char *const args[] = {
                progname,
                "--show-depends", "psmouse",
@@ -73,7 +73,7 @@ static DEFINE_TEST(modprobe_show_depends2,
 
 static __noreturn int modprobe_show_alias_to_none(const struct test *t)
 {
-       const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+       const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
        const char *const args[] = {
                progname,
                "--show-depends", "--ignore-install", "--quiet", "psmouse",
@@ -96,7 +96,7 @@ static DEFINE_TEST(modprobe_show_alias_to_none,
 
 static __noreturn int modprobe_builtin(const struct test *t)
 {
-       const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+       const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
        const char *const args[] = {
                progname,
                "unix",
@@ -115,7 +115,7 @@ static DEFINE_TEST(modprobe_builtin,
 
 static __noreturn int modprobe_softdep_loop(const struct test *t)
 {
-       const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+       const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
        const char *const args[] = {
                progname,
                "bluetooth",
@@ -135,7 +135,7 @@ static DEFINE_TEST(modprobe_softdep_loop,
 
 static __noreturn int modprobe_install_cmd_loop(const struct test *t)
 {
-       const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+       const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
        const char *const args[] = {
                progname,
                "snd-pcm",
@@ -153,7 +153,7 @@ static DEFINE_TEST(modprobe_install_cmd_loop,
                [TC_INIT_MODULE_RETCODES] = "",
        },
        .env_vars = (const struct keyval[]) {
-               { "MODPROBE", ABS_TOP_BUILDDIR "/tools/modprobe" },
+               { "MODPROBE", ABS_TOP_BUILDDIR "/tools/test/modprobe" },
                { }
                },
        );
index d77b2dc240c65f193e67f6042d52900221e077d5..3e3416001cc926e7bfce181d73a0cd48bfc72c11 100644 (file)
@@ -7,9 +7,9 @@
 /kmod-lsmod
 /kmod-modinfo
 /kmod-modprobe
-/kmod-nolib
 /kmod-rmmod
 /lsmod
 /modinfo
 /modprobe
 /rmmod
+/test