Commit Graph

717 Commits

Author SHA1 Message Date
Lucas De Marchi
e1b1ab24ab testsuite: re-license under LGPL 2012-07-10 10:31:57 -03:00
Martin Pitt
4281cee076 testsuite: path wrapper: Fix open() with 3 arguments
Properly return the original libc return value in the case that open() is
called with 3 arguments.
2012-07-10 10:31:40 -03:00
Dave Reisner
486f901392 module: support reading coresize from /sys if supported
Linux 3.3 introduced the coresize attribute in /sys/module/*. When
available, use this instead of parsing some portion of /proc/modules.
2012-06-29 13:04:41 -04:00
Dave Reisner
2588e3dff5 Implicitly run 'make rootfs' with 'make check'
Avoid the need for the user to run this manually after a run of the
testsuite by adding it.
2012-06-29 12:58:06 -04:00
Lucas De Marchi
fca5b9bcd4 testsuite: use right offset for module name
We need to cope with the case in which a 32 bits machine is opening a 64
bits kernel module and vice-versa. The offset in `struct module' are
different and do not depend on the architecture we are running, but
rather on the architecture they were created for.

This fixes `make check' in 32 bits machines (since we are shipping 64
bits modules for testing)
2012-06-21 11:30:56 -03:00
Lucas De Marchi
62081c0f68 kmod 9 2012-06-19 19:46:53 -03:00
Lucas De Marchi
7896165922 build-sys: allow compressed modules in testsuite 2012-06-19 13:28:02 -03:00
Lucas De Marchi
33202e84f3 build-sys: Make dirs writable on rootfs creation
Autofoo make the dist dir as readonly. If we copy it, tools needing to
create sysfs entries will not be able to do so, because they can't
create the needed directories/files.

It would be much better if autofoo allowed to let the files as is
instead of converting them to read-only.
2012-06-19 13:27:56 -03:00
Lucas De Marchi
3f376cd877 depmod: use ferror and fclose to check for error
Thanks to hpa for point this out.
2012-06-15 22:14:00 -03:00
Dave Reisner
b7d830bcc8 bootstrap: remove unnecessary echo 2012-06-15 20:35:28 -04:00
Dave Reisner
563befdba6 bootstrap-configure: quote command line arg expansion 2012-06-15 20:35:28 -04:00
Lucas De Marchi
a4fb97a71e depmod: return error when index is truncated due to ENOSPC
Before:
=======
[lucas@vader kmod]$ sudo depmod
[lucas@vader kmod]$ echo $?
0
[lucas@vader kmod]$ ls -l /lib/modules/$(uname -r)
total 12
drwxr-xr-x 8 root root   160 Jun 13 11:05 kernel
-rw-r--r-- 1 root root 12288 Jun 15 21:29 modules.alias
-rw-r--r-- 1 root root     0 Jun 15 21:29 modules.alias.bin
-rw-r--r-- 1 root root     0 Jun 15 21:29 modules.dep
-rw-r--r-- 1 root root     0 Jun 15 21:29 modules.dep.bin
-rw-r--r-- 1 root root     0 Jun 15 21:29 modules.devname
-rw-r--r-- 1 root root     0 Jun 15 21:29 modules.softdep
-rw-r--r-- 1 root root     0 Jun 15 21:29 modules.symbols
-rw-r--r-- 1 root root     0 Jun 15 21:29 modules.symbols.bin

Note that modules.alias is truncated and the other have size == 0

After:
======

[lucas@vader kmod]$ sudo ./tools/depmod
WARNING: could not open /lib/modules/3.5.0-rc2-demarchi-00028-g94fa83c/modules.order: No such file or directory
ERROR: Could not create index: output truncated: No space left on device
[lucas@vader kmod]$ echo $?
1
2012-06-15 21:31:05 -03:00
Lucas De Marchi
015946da0c depmod: fix coding-style issue in array declaration 2012-06-15 03:04:28 -03:00
Lucas De Marchi
80e49ad988 depmod: fail if any index could not be created 2012-06-15 02:42:39 -03:00
Lucas De Marchi
c5db1a3fd2 depmod: don't return error if modules.builtin don't exist 2012-06-15 02:42:25 -03:00
Lucas De Marchi
ccd6afa4f2 Remove ifdef for building tools not bundled
Current build system do not support to build separate tools anymore, so
just remove the ifdefs.
2012-06-15 00:40:14 -03:00
Lucas De Marchi
fd0d806e40 build-sys: add missing header to fix distcheck 2012-06-14 16:58:46 -03:00
Lucas De Marchi
ac78e109c3 tools: rename source files
There's no point anymore in having "kmod-" prefix. This is a historical
thing when we started implementation of these tools.
2012-06-14 16:29:28 -03:00
Lucas De Marchi
e7fc2c868e libkmod-config: refactor functions to get config
It makes more sense to have libkmod-config.c deal with the configuration
directly and the others get the config from ctx. As a bonus point we get
a smaller binary. Following numbers are for x86-64, libkmod + kmod:

Before:
   text	   data	    bss	    dec	    hex	filename
 128840	   1496	    104	 130440	  1fd88	tools/modprobe

After:
   text	   data	    bss	    dec	    hex	filename
 128392	   1496	    104	 129992	  1fbc8	tools/modprobe
2012-06-12 01:43:46 -03:00
Lucas De Marchi
c8c956b199 TODO: update tasks
- Remove dependency loop with install commands, since it's done
 - Add reasoning behind API refactor
2012-06-11 12:01:48 -03:00
Lucas De Marchi
9b01fd2edd testsuite: Fix test description 2012-06-11 11:57:55 -03:00
Lucas De Marchi
5b05c32725 libkmod-index: protect ourselves from corrupted indexes
If index is shorter than 12 bytes, we couldn't even read its header. Go
to error handling in this case.
2012-06-06 09:36:29 -03:00
Lucas De Marchi
01d9ee642d testsuite: add test for install-commands loop
This loop is similar to the one that comes with install rules of
alsa-utils package. It can be easily verified by reverting commit
abd5557 and running the testsuite.
2012-06-06 01:57:33 -03:00
Lucas De Marchi
34db3f2d3e testsuite: allow to export custom env vars 2012-06-06 01:45:30 -03:00
Lucas De Marchi
b8e344a6d2 testsuite: add timeout for each test
Each test must run under 2 seconds. Ideally they should run in much less
than this; just give an arbitrary number so we don't wait forever in
case we reached an infinite loop somewhere.
2012-06-06 01:45:30 -03:00
Lucas De Marchi
ed8e93fd92 testsuite: create additional pipe to monitor child 2012-06-06 01:45:30 -03:00
Lucas De Marchi
535c541e60 libkmod-util: split function for usec conversion 2012-06-06 01:08:56 -03:00
Lucas De Marchi
a6976f8b1d testsuite: add test for softdep loops 2012-06-05 00:57:47 -03:00
Lucas De Marchi
a655370541 testsuite: check if module is in kernel for return code 2012-06-05 00:54:48 -03:00
Lucas De Marchi
ddf1e7a617 testsuite: set default init_module behavior to mimic kernel's 2012-06-05 00:54:48 -03:00
Lucas De Marchi
5a2949cdf3 testsuite: create initstate file upon fake init_module() 2012-06-05 00:54:47 -03:00
Lucas De Marchi
44e5466795 testsuite: add mkdir_p implementation 2012-06-05 00:54:47 -03:00
Lucas De Marchi
113d0084d4 testsuite: trap calls to mkdir 2012-06-05 00:54:47 -03:00
Lucas De Marchi
0de690c96c testsuite: check if rootfs dir is dirty before running
Keep around a stamp-rootfs file that is generated together with the
rootfs. testsuite checks each test directory if its mtime is greater
than stamp's mtime, deciding if rootfs should be re-generated.
2012-06-05 00:54:47 -03:00
Lucas De Marchi
ada9719942 testsuite: separate insert and delete rootfs from modinfo 2012-06-05 00:54:47 -03:00
Lucas De Marchi
e46bca009d libkmod-util: add missing stdbool.h include 2012-06-05 00:54:47 -03:00
Lucas De Marchi
e2ee7d9b7a testsuite: rename rootfs dir 2012-06-05 00:54:47 -03:00
Lucas De Marchi
851ee75c19 build-sys: provide --sysconfdir to make distcheck flags
test-blacklist is accessing the wrong location in make distcheck, making
the test to fail. Fix is by providing --sysconfdir=/etc in configure
flags.
2012-06-05 00:54:46 -03:00
Lucas De Marchi
90fc410b32 testsuite: fix find_module() finding wrong module 2012-06-05 00:54:39 -03:00
Lucas De Marchi
9e2eadb1d7 Silence clang warnings with __unused__ attribute
I hate this kind of READV and WRITEV macros that Gustavo seems to love.
clang-analyzer hates them as well.

I'm not motivated enough to refactor this, but I want a clean clang
report, so just shut it up.
2012-05-23 20:31:18 -03:00
Lucas De Marchi
a70c1e774e Don't use __ for attribute defines
System headers use __, don't mess with them.
2012-05-23 20:27:23 -03:00
Lucas De Marchi
5bbec8cdcb libkmod-index: use generic function for unaligned access 2012-05-23 19:32:58 -03:00
Josh Boyer
7ef9f30c91 doc: Don't reference /etc/modprobe.conf
kmod doesn't read /etc/modprobe.conf at all, so don't mention it in the
modprobe man page.  Point users to modprobe.d(5) instead.
2012-05-23 18:03:35 -03:00
Lucas De Marchi
af9080d9f9 libkmod-hash: use generic function for unaligned access 2012-05-21 20:43:39 -03:00
Lucas De Marchi
a6b67f90c3 libkmod-util: copy macros for unaligned access from BlueZ 2012-05-21 20:22:12 -03:00
Mike Frysinger
d30319e433 libkmod: move function to the only file using it
If we don't have --gc-sections support, linking kmod fails:
libkmod/.libs/libkmod-util.a(libkmod-util.o): In function 'underscores':
libkmod/libkmod-util.c:117: undefined reference to 'kmod_log'

This is because libkmod-util.la uses kmod_log(), that is in libkmod.la.
Move the function so we don't have a dependency loop while building the
libraries and it works with compilers with no support for --gc-sections.
2012-05-15 19:30:05 -03:00
Dan McGee
c88aec70d1 test-conversion: convert test-get-dependencies to new infrastructure
The test uses the ext4 module dependencies as the testcase, checking
both the number and the names of the returned modules.
2012-05-11 08:44:55 -03:00
Dan McGee
bcca1b95d2 test-conversion: convert test-blacklist to new infrastructure
Add a modprobe.conf with some blacklist entries in a test rootfs, and
then ensure our blacklist function actually cuts out the two listed
entries (and doesn't cut out the others).
2012-05-11 08:44:55 -03:00
Lucas De Marchi
452c1dde2f build-sys: copy rootfs to another directory
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'
2012-05-11 02:23:34 -03:00
Lucas De Marchi
9c41596ecc build-sys: distribute testsuite
Fix 'make dist'
2012-05-11 01:21:46 -03:00