One of the tests is now failing:
ERROR: smp-locks-section: kpatch replace failed
I suspect the issue is the vmlinux mismatch problem. Fix for that
coming soon.
Add the null symbol to in inventory files. Before the linked-link
change, the null symbol wasn't included in the inventory. However,
it is required to be a valid ELF file and should be inventoried and
check for in the test.
Signed-off-by: Seth Jennings <sjenning@redhat.com>
No need to accumulate errors if the load or unload fails. Leaving the
testprog failure non-fatal so that the test will then call unload to
clean up after itself.
This is a basic integration test framework for kpatch, which tests
building, loading, and unloading patches, as well as any other related
custom tests.
The kpatch-test script looks for test input files in the
tests/integration directory. It expects certain file naming
conventions:
- foo.patch - patch that should build successfully
- bar-FAIL.patch - patch that should fail to build
- foo-LOADED.test - executable which tests whether the foo.patch module
is loaded. It will be used to test that loading/unloading the patch
module works as expected.
Any other *.test files will be executed after all the patch modules have
been built from the *.patch files. They can be used for more custom
tests above and beyond the simple loading and unloading tests.
I just have one test here, but many more to come eventually. I'm
constantly doing manual testing of patches and am planning on automating
them with this framework.
This commit introduces a simple automated testing system
with 3 simple testcase.
For each test case there is a .c, a .patch, and a .inventory
file. The .c is compiled, using the flags from the kflags file,
to create the original object. The .c file is then patched
with the .patch file and rebuilt to create the patched object.
The files are then analyzed by the differencing tool and an
output object is generated with a .inventory file that lists
the sections and symbol included in the output object. That
inventory file is then compared to the .inventory file for
that testcase. If they are the same, the test passes. If
not, the differences in the inventory files are displayed,
and the test fails.
Signed-off-by: Seth Jennings <sjenning@redhat.com>