Commit Graph

157 Commits

Author SHA1 Message Date
Lucas De Marchi
33c1185239 testsuite: port tests without finit_module() to module-playground 2015-02-10 22:11:25 -02:00
Lucas De Marchi
a1a1369051 testsuite: port modprobe --force test to module-playground 2015-02-10 22:01:42 -02:00
Lucas De Marchi
1e128242ed testsuite: port softdep-loop test to module-playground 2015-02-10 21:45:09 -02:00
Lucas De Marchi
aac5f4514f shared: add helper function to add and check for overflow
Use _builtin_uaddll_overflow/_builtin_uaddl_overflow when available,
abstracting the type to use it with uint64_t.

Otherwise fallback to the implementation as added in 67466f2 ("Prevent
offset + size overflow.").

This also adds the tests for this new helper in the testsuite.
2015-02-10 10:43:44 -02:00
Lucas De Marchi
eeb627004b testsuite: port show-depends tests to module-playground
Another test, modprobe_show_alias_to_none was wrongly checking the
output in the show-depends namespace so it needed changing as well.
2015-02-10 09:30:49 -02:00
Lucas De Marchi
d9ab7abe1e testsuite: port detect-loop test to module-playground 2015-02-09 14:07:31 -02:00
Lucas De Marchi
1669be85de testsuite: convert test-init function to use mod-simple.ko 2015-02-03 05:19:38 -02:00
Lucas De Marchi
450c1f037b testsuite: port test-dependencies to module-playground 2015-02-03 01:12:13 -02:00
Lucas De Marchi
d2db083ab6 testsuite: make test-dependencies use DEFINE_TEST
It went missing from previous conversions.
2015-02-03 01:09:22 -02:00
Lucas De Marchi
8dddac5999 testsuite: use mod-simple.ko for search-order-same-prefix test 2015-02-03 01:09:22 -02:00
Lucas De Marchi
4002d77aff testsuite: beef up module-playground in the build system
Instead of shipping pre-compiled module, this prepares the build system
to be able to compile the necessary modules from module-playground. This
preparations starts by replacing md5.ko with our own dummy
mod-simple.ko, built from source. It works by copying the modules to
their final location while preparing the rootfs.
2015-02-03 01:09:17 -02:00
Caio Marcelo de Oliveira Filho
2200a448d4 testsuite: add tests for kmod_list
Some tests cover internal API that wasn't used
elsewhere. The choice here was to test and keep the
list implementation complete instead of removing it.
2015-01-26 19:20:51 -02:00
Caio Marcelo de Oliveira Filho
211e3840fc testsuite: add more input cases to freadline_wrapped test 2015-01-21 10:18:07 -02:00
Caio Marcelo de Oliveira Filho
22f602c3c5 testsuite: add test for growing then shrinking a hash 2015-01-21 10:17:27 -02:00
Caio Marcelo de Oliveira Filho
9c2d39c735 testsuite: add test for hash_add_unique 2015-01-21 10:15:40 -02:00
Lucas De Marchi
9c6084d90c testsuite: improve coverage of shared/util.h
Add tests to improve coverage of shared/util.h functions.
2015-01-14 17:26:36 -02:00
Lucas De Marchi
2d1f8bdec0 testsuite: improve assert report 2015-01-14 16:28:16 -02:00
Lucas De Marchi
5c42c5fced testsuite: prefer the use of streq() 2015-01-14 14:32:09 -02:00
Lucas De Marchi
9b51e13b84 testsuite: test kmod_module_remove_module for failure 2015-01-14 14:32:09 -02:00
Lucas De Marchi
af87874f9c testsuite: fix retcodes parsing
It was not saving _modules in modules and thus all check were falling in
the fallback "consider a success if module is not in the list". Also the
name check wasn't right: replace with streq().

The parsing could be better implemented, but this is left for later.
2015-01-14 14:25:02 -02:00
Lucas De Marchi
c78066aef1 testsuite: add test for array_pop() 2015-01-08 17:10:18 -02:00
Lucas De Marchi
8ff7f008cd testsuite: do not overrid paths inside build
If we are accessing a file inside the build directory we should really
not trap the path. Right now this isn't important because we never do
such accesses. However it will be needed when gcov is integrated because
it dumps files to the same place where the binaries are located.
2015-01-07 19:14:20 -02:00
Lucas De Marchi
f357866d97 Fix includes after change to build-sys
Make the includes be libkmod/libkmod.h for code outside of library. This
fixes the broken build after 1315123 ('build-sys: Don't add libkmod
subdirectory to include path').
2015-01-02 12:41:01 -02:00
Lucas De Marchi
dea2dfee9b Remove FSF mailing address
It has changed in the past, and these days, anyone can get a copy of the
LGPL via the web rather than by post.

Like 657a122 (Remove FSF mailing address) in libabc by Josh Tripplet,
but let the FSF website in which the license can be found.
2014-12-25 23:41:34 -02:00
Lucas De Marchi
1315123955 build-sys: Don't add libkmod subdirectory to include path
Like 05437b8 (Makefile.am: Don't add abc subdirectory to include path)
in libabc by Josh Triplett.
2014-12-25 23:41:34 -02:00
Lucas De Marchi
48e4d18191 testsuite: add tests for strbuf 2014-10-13 18:42:01 -03:00
Lucas De Marchi
4328982058 testsuite: remove now unused array of tests
Remove the arrays and let each test with a guaranteed unique name.
2014-10-09 14:29:04 -03:00
Lucas De Marchi
c5798fea93 testsuite: use a section to put tests in instead of array
Intead of having to declare an array of tests, tweak the definition of
DEFINE_TEST and TESTSUITE_MAIN so they know the tests are put in a
particular section of the ELF file.

This avoids the mistake of adding a test and forgetting to add it to the
array. Now once a test is defined, it's ready to run, so one less step
to define new tests.

The removal of the arrays is left for another patch so not to clutter
the diff on this one.
2014-10-09 14:17:24 -03:00
Lucas De Marchi
f1155c1574 Move static keyword to DEFINE_TEST macro 2014-10-09 13:00:30 -03:00
Lucas De Marchi
f4e8c16291 Move remaining functions from libkmod-util to shared 2014-10-09 01:26:39 -03:00
Lucas De Marchi
2b0104fe3c Move alias_normalize() to shared 2014-10-09 01:26:39 -03:00
Lucas De Marchi
fdafa6b655 testsuite: add tests for array implementation 2014-10-09 01:26:39 -03:00
Lucas De Marchi
aafd38359a Rename getline_wrapped() to freadline_wrapped() 2014-10-03 03:25:06 -03:00
Lucas De Marchi
c2e4286bb9 Reorder and reorganize header files
Let the includes in the following order:

< system headers >
< libkmod >
< tool >
< local headers >
2014-10-03 01:43:15 -03:00
Lucas De Marchi
0db718edcf Move hash implementation to shared directory 2014-10-03 00:40:11 -03:00
Lucas De Marchi
96573a0220 Move generic util functions to shared directory 2014-10-03 00:33:25 -03:00
Lucas De Marchi
576dd4393d Move macro.h to shared directory
It's not really related to libkmod, so move it to a directory in which
we keep common stuff.
2014-10-02 22:03:19 -03:00
Lucas De Marchi
a5a41f8dbb testsuite: Fix macro missing format string 2014-06-14 11:14:58 -03:00
Lucas De Marchi
5963c36da3 testsuite: Add basic tests for hash implementation
Far from complete, but already covers all internal APIs.
2014-06-06 02:24:39 -03:00
Lucas De Marchi
30471c80a4 testsuite: Add assert_return
Add assert_return to use in testcases instead of assert. The issues
with assert are:
	1) It's disabled when NDEBUG is defined
	2) Even if it's well supported by testsuite (the parent will
	   report the child died) it can't output any meaningful
	   error message
2014-06-06 02:19:28 -03:00
Lucas De Marchi
f988e25c68 testsuite: separate testcases on log 2014-06-05 17:54:41 -03:00
Lucas De Marchi
7a2d0e6187 testsuite: check for correct error message in detect-loop 2014-05-30 10:26:17 -03:00
Lucas De Marchi
d7293a1628 testsuite: Fix expected_fail parsing
If a test has expected_fail=true, it means the return code must be
different from 0 *and* the outputs must match. This way it's possible to
check if the error messages are printed as they should.
2014-05-30 10:23:05 -03:00
Lucas De Marchi
f429113a47 testsuite: Add braces 2014-05-30 10:20:19 -03:00
Lucas De Marchi
8183cfa9da testsuite: add test to fail depmod on module loops 2014-05-30 09:36:56 -03:00
Lucas De Marchi
b8b990f47d Add gitignore to module playground 2014-05-09 08:43:32 -03:00
Lucas De Marchi
3f8dd30a76 testsuite: Add module playground dir 2014-05-02 12:57:17 -03:00
Lucas De Marchi
3e68b2c455 testsuite: Remove duplicate test
This partially reverts ad7f175 ("Add test for depmod using search dirs
with same prefix"). Testing it twice in the inverted order doesn't
ensure we get the bug with wrong ordering.

As put by Anssi Hannula <anssi@mageia.org>:

	So the bug is triggered only if the shorter name is higher-prio _and_
	shorter name is traversed first. If the long name is traversed first,
	the bug don't trigger with either "search" directive order (and on my
	"make check" runs this is the case).
2014-04-06 17:46:45 -03:00
Michal Marek
81bf88d6c4 testsuite: Do not run tests with *.ko.gz if zlib is not enabled 2014-04-04 13:05:49 +02:00
Michal Marek
73476ec5cb testsuite: Uncompress most modules
Only keep test-depmod/modules-order-compressed to test compressed module
support.
2014-04-04 12:32:16 +02:00