Commit Graph

18 Commits

Author SHA1 Message Date
Michal Marek
063086e038 testsuite: Do not provide finit_module(2) on older kernels
If the test's uname -r is less that 3.8, return -ENOSYS from
finit_module(), so that the fallback is tested.
2014-03-05 12:22:37 -03:00
Lucas De Marchi
c493b93750 util: Add len arg to mkdir_p() 2013-07-15 12:44:33 -03:00
Lucas De Marchi
85d02ebea3 util: Add mkdir_p implementation from testsuite 2013-07-15 12:44:33 -03:00
Lucas De Marchi
83b855a6ed Use "-internal" suffix instead of "-private" 2013-07-04 16:13:11 -03:00
Lucas De Marchi
8e00db9537 testsuite: Fix checking __sysno
Use an if instead of a case statemente. If __NR_finit_module is not
defined in system headers we define it to -1, causing a "duplicate case
value" error. Yet, we don't want to actually call our finit_module()
function if -1 is passed.

This also fix errno being set with negative value.
2013-04-09 11:54:05 -03:00
Lucas De Marchi
0ae58609dc testsuite: Wrap syscall() to get calls to finit_module()
When we don't have finit_module() in libc (most likely because as of
today glibc didn't add it yet), we end up using
syscall(__NR_finit_module, ...). In this case we would not wrap the
function in the testsuite and thus having some tests failing:

TESTSUITE: ERR: could not insert module: Operation not permitted

This implementation relies on the fact that this is the only caller of
syscall(2), because we can't call libc's syscall(). There's an abort()
in place to be future safe: as soon as we need more calls to syscall(),
we can detect (and decide what to do).

Now we have all tests passing in the testsuite again.
2013-04-09 05:45:44 -03:00
Lucas De Marchi
55112d19f7 libkmod: Move finit_module() definition to missing.h
Check for finit_module() and don't use our own static inline function if
there's such function in libc (or another lib).

In testsuite we need to unconditionally define HAVE_FINIT_MODULE because
we want to override this function, and never use the static inline one
in missing.h
2013-04-09 04:38:27 -03:00
Kees Cook
e87352d289 testsuite: handle finit_module
This adds the finit_module logic to the testsuite.
2013-02-19 19:19:51 -03:00
Lucas De Marchi
e6b0e49b4e Update copyright notices 2013-01-16 11:27:45 -02:00
Lucas De Marchi
e1b1ab24ab testsuite: re-license under LGPL 2012-07-10 10:31:57 -03: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
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
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
90fc410b32 testsuite: fix find_module() finding wrong module 2012-06-05 00:54:39 -03:00
Lucas De Marchi
e701e381fa testsuite: add GPL license 2012-01-26 17:02:05 -02:00
Lucas De Marchi
53646fc56f testsuite: add trap to init_module() including simple test 2012-01-26 16:05:05 -02:00