1 Patches to module-init-tools are welcome. Please note the following
4 1) insmod and rmmod are designed to be as simple as possible.
6 2) modprobe is designed to be a swiss-army-knife, but the config file
7 format is designed to be as simple as possible: let the user create
8 complexity if they wish.
10 3) module-init-tools contains a testsuite. Patches which do not pass
11 the testsuite get a frowny face.
16 The following tests have been recently added:
18 * Binary trie tests (test-modprobe-indexed)
23 The testsuite is under tests/test-*: one directory for each tool. You
24 can run "make check" to run the testsuite: it will use valgrind (much
25 slower, but catches more things) if it is installed.
27 "make check" simply invokes "./tests/runtests".
29 To start the tests at a particular test, use that test name on the
30 command line, eg. "./tests/runtests 26blacklist.sh". To see exactly
31 what the test is doing, use -vv, eg
33 ./tests/runtests -vv 26blacklist.sh
35 To only test a given endianess or bitness, use
37 TEST_ENDIAN=32 TEST_BITS=le ./tests/runtests
39 Each test is a shell script run with "-e": ie. if any command fails,
40 the test will fail. The path is set up with special test versions of
41 the utilities (and possibly valgrind wrappers), so just invoke
42 "modprobe" etc. as normal. Environment variables can be used to
43 control normally hardwired behaviour:
46 The result "uname" is to return. Set to 2.6.27 by default.
48 2) $MODTEST_OVERRIDE<n>, $MODTEST_OVERRIDE_WITH<n>
49 These cause file operations on $MODTEST_OVERRIDE1 to occur on
50 $MODTEST_OVERRIDE_WITH1, etc. The numbers must be consecutive:
51 the code stops searching for a replacement when a number is not
52 found. This is used to stop the utilities looking in
53 /lib/modules/2.6.27/ for example.
55 Other environment variables can be found in testing.h.
57 There are various pre-compiled test modules under tests/data/. Each
58 one has big and little endian and 32 and 64-bit variants: modprobe
59 must handle both 32 and 64 bit (for x86-64, PPC64, Sparc64, IA64), and
60 depmod and modinfo must handle any endianness as well. If you need to
61 add a new module to test something, put the source under tests/src,
62 make sure it passes for the cases you can test, and I'll compile and
65 When writing tests, make sure your test aborts on any unexpected
66 behaviour: eg. compare the result is equal to what you expect, rather
67 than not equal to something.