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 testsuite is under tests/test-*: one directory for each tool. You
17 can run "make check" to run the testsuite: it will use valgrind (much
18 slower, but catches more things) if it is installed.
20 "make check" simply invokes "./tests/runtests".
22 To start the tests at a particular test, use that test name on the
23 command line, eg. "./tests/runtests 26blacklist.sh". To see exactly
24 what the test is doing, use -vv, eg
26 ./tests/runtests -vv 26blacklist.sh
28 Each test is a shell script run with "-e": ie. if any command fails,
29 the test will fail. The path is set up with special test versions of
30 the utilities (and possibly valgrind wrappers), so just invoke
31 "modprobe" etc. as normal. Environment variables can be used to
32 control normally hardwired behaviour:
35 The result "uname" is to return. Set to 2.5.52 by default.
37 2) $MODTEST_OVERRIDE<n>, $MODTEST_OVERRIDE_WITH<n>
38 These cause file operations on $MODTEST_OVERRIDE1 to occur on
39 $MODTEST_OVERRIDE_WITH1, etc. The numbers must be consecutive:
40 the code stops searching for a replacement when a number is not
41 found. This is used to stop the utilities looking in
42 /lib/modules/2.5.52/ for example.
44 Other environment variables can be found in testing.h.
46 There are various pre-compiled test modules under tests/data/. Each
47 one has big and little endian and 32 and 64-bit variants: modprobe
48 must handle both 32 and 64 bit (for x86-64, PPC64, Sparc64, IA64), and
49 depmod and modinfo must handle any endianness as well. If you need to
50 add a new module to test something, put the source under tests/src,
51 make sure it passes for the cases you can test, and I'll compile and
54 When writing tests, make sure your test aborts on any unexpected
55 behaviour: eg. compare the result is equal to what you expect, rather
56 than not equal to something.