We can't use the rootfs directory because it breaks out-of-tree build
and in future we want to make modifications to the fake filesystem such
as adding and removing files.
We need to call "chmod -R +w" in the resulting directory because when we
distribute the source with make dist all files will be readonly.
Fix 'make distcheck'
The current configuration is dumb in any number of ways:
1) If the rationale was for space savings, it works the opposite- the
git repo gets more bloated because we are adding binary compressed
blobs that share little in common with their parent, and anyone that
wants to run the test suite has to unzip it anyway.
2) It is a pain in the butt to add new tests, and not accidentally lose
any new rootfs you built in the directory.
3) `git status` won't help you if you are tweaking files in the rootfs
and don't know they have been changed, or if some test did that and
you couldn't detect it.
4) `git log` won't help you find out what is changing in the rootfs test
directory itself when changes are made to the binary blob, such as
new files being added or even existing files being tweaked.
5) The files just aren't that big anyway- 2.7MB unzipped.
Search modules.builtin file before saying the module was not found.
Note: these "modules" should not appear as dependencies of other modules
(in modules.dep) even if they appear in modinfo. This fixes the return
code of modprobe with builtin modules.
Also fixes a small coding style issue in module_is_inkernel().
When user tries to load a module that is builtin in kernel, modprobe
should just return 0. This is not happening right now, so mark test as
expected_fail until it gets fixed.
This allows us to prepend an arbitrary item to the PATH environment
variable, meaning we can favor the binaries we just built, rather than
relying on those in the filesystem.
int isn't big enough to hold a FILE* / DIR* on some systems, this causes
segfaults in calls that try to use the resulting FILE* / DIR*:
TESTSUITE: ERR: 'testsuite_rootfs_fopen' [1176160] terminated by signal 11 (Segmentation fault)
TESTSUITE: ERR: FAILED: testsuite_rootfs_fopen
FAIL: testsuite/test-testsuite
...
TESTSUITE: ERR: 'loaded_1' [1176166] terminated by signal 11 (Segmentation fault)
TESTSUITE: ERR: FAILED: loaded_1
FAIL: testsuite/test-loaded
...
TESTSUITE: ERR: 'from_alias' [1176181] terminated by signal 11 (Segmentation fault)
TESTSUITE: ERR: FAILED: from_alias
FAIL: testsuite/test-new-module
For reference on my system:
sizeof(int) = 4
sizeof(long) = 8
sizeof(FILE*) = 8
sizeof(DIR*) = 8
Functions that always call exit() should be marked with attribute
noreturn. With glibc this is not necessary, but it fails to compile with
uClibc otherwise.
test 1 - check whether modprobe outputs the right thing when
using --show-depends is used with already loaded modules.
test 2 - check whether modprobe outputs the right thing when
using --show-depends with modules not loaded yet
Add kmod-* prefixed tool names, add 'tags' in root directory (for ctags,
matches cscope.out ignore already in there), and prefix tools/ entries
with '/' so they are absolute ignores and don't apply to subdirectories.
Adds a bool to the test struct called 'expected_fail' which can be set
to flip the logic used to determine success and failure. Messaging is
also changed to reflect an unexpected pass or expected fail. This can be
used to write tests which may represent functionality desirable for a
future release.
Alias names may contain dots. However since kmod_module_from_alias()
still calls kmod_module_new_from_name(), the bug is not entirely fixed,
and will be completely corrected in a later patch.
These ext4 modules were sent by Jon Master so we can test the result of
modinfo with modules generated for different architectures.
They are now added to testsuite and their output tested automatically.
Tests may put the correct output in a file and tell testsuite to check
if it matches the output from the test running.
Testsuite compares the outputs while running the test: it creates a pipe
between parent and child; parent reads both stdout and stderr from child
and compares with the correct output.
In order to locate where the shared libs to be preloaded are we need to
reference them using abs_top_buildir. Otherwise we are limited to
running tests from there.
Add trap to stat(): we need to trap other functions too, depending on
stat.h, the function from glibc that is actually called may be stat64 or
__xstat() too.
A certain config can add flags and each flag may be associated with a
lib to LD_PRELOAD. It's now done for uname(2), which requires uname.so
in order to trap the calls.
Other trap will be added in later commits.