mirror of
https://github.com/dynup/kpatch
synced 2024-12-12 00:14:35 +00:00
0cbb7cf5ee
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>
17 lines
472 B
C
17 lines
472 B
C
#include <stdio.h>
|
|
|
|
void test_func() {
|
|
printf("this is before\n");
|
|
}
|
|
|
|
/*
|
|
* This test case ensures that deep inspection for rela entries
|
|
* that reference strings is taking place. The text and rela sections
|
|
* for test_func() are the same between the original and patched
|
|
* versions. However, the tool should detect that the string referenced
|
|
* by the printf has changed.
|
|
*
|
|
* Verification points: test_func bundle and the rodata.str1.8 section
|
|
* are included.
|
|
*/
|