Commit Graph

21 Commits

Author SHA1 Message Date
Artem Savkov
149ff8d1dc integration/centos-7: update tests to current kernel
Since the kernel we were testing against before is no longer available
in centos repos I've updated our test vagrant image bringing the kernel
version to 3.10.0-1127.el7. Since this is basically the rhel-7.8 kernel
and we don't want extra work maintaining extra sets of patches just
symlink centos-7 patch directory to rhel-7.8. If(when) we are in this
situation again we'll just switch the symlink to the appropriate minor
again.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-05-05 20:06:46 +02:00
Joe Lawrence
54268bfb3e integration: update gcc-static-local-var-4.test
The gcc-static-local-var-4.patch and test check that unmodified
functions that contain dynamic debugging printk's aren't incorrectly
included in the resulting livepatch .ko.

Note that on RHEL-7.7 ppc64le, the gcc-static-local-var-4.ko livepatch
module may include klp-relocation references to free_ioctx(), a function
that would match the above criteria.  These klp-relocation symbols are
OK as they are only used for referencing said functions, they are not
copies that the check should FAIL on.

Modify gcc-static-local-var-4.test in a few ways:

  - Use eu-readelf instead of readelf, which some versions have problems
    handling klp-relocations.

  - Set pipefail to catch any errors in the symbol table dump (missing
    elfutils, etc.)

  - Instead of a grep regex, use awk to string compare exact function
    and module names.  This avoids matching on .klp.sym prefixed
    klp-relocation symbols.

Fixes #1069.
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2020-02-14 16:09:37 -05:00
Artem Savkov
94156bed45 integration: disable tests with jump labels
Disabled due to #940. Please re-enable this test once it is fixed.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-01-24 10:37:25 +01:00
Julien Thierry
e59355c2b7 test/integration: Make multiple.test cleanup after itself
If an error occurs while loading a module or one of the tests,
multiple.test will exit leaving the working modules loaded. This leaves
the system in an unwanted state and causes the test that previously pass
to fail (succeeding before being loaded for multiple.test's point of
view).

Cleanup the loaded modules before exiting due to errors.

Also take this opportunity to factorize the test for the different
distros.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-10-08 08:31:39 +01:00
Artem Savkov
5dfe17cb02 Update fixup-section patches
These patches previously would try to dereference a userspace pointer
directly which can cause issue on some systems. Since the aim of these
patches is to check fixup section changes we can don't need to do any
meaningful changes to the function, so change the patches to just add
asm("nop") instead.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-05-15 10:28:45 +02:00
Artem Savkov
56be80720a integration/centos-7: fix shadow-newpid.patch warnings
When quickly loading/unloading this patch multiple times it is possible
to hit "Duplicate shadow variable" warnings since the patch doesn't have
any cleanup hooks on unload.
Switch to klp_shadow_get_or_alloc to ignore these.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-28 17:19:45 +01:00
Artem Savkov
fb11c794f2 integration: blacklists in multiple.test
Hardcode a blacklist of modules in multiple.test so we can deal
with conflicts while only updating the test when those arise.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-17 09:26:35 +01:00
Artem Savkov
70f9221c01 integration: dynamic module list in multiple.test
Dynamically compile module list based on -LOADED.test files in all
multiple.test scripts.
The scripts is now the same across all three directories so it might be
good to deduplicate it somehow along with other common tests.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-14 21:29:32 +01:00
Artem Savkov
992ea01625 integration/centos-7: reverse unload in multiple.test
Livepatch requires modules to be unloaded in reverse order.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 11:46:08 +01:00
Artem Savkov
28a18efa21 integration/centos7: update shadow-newpid.patch
Switch to klp shadow-variable API.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:34:13 +01:00
Artem Savkov
31f6b02279 integration/centos7: update module-shadow.patch
Switch to klp shadow-variable API.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:34:13 +01:00
Artem Savkov
abe04af23a integration/centos7: disable rebuild-SLOW patch
It currently hits CSWTITCH issue from https://github.com/dynup/kpatch/issues/876

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:34:06 +01:00
Artem Savkov
f2b226ad37 integration/centos7: update macro-printk.patch
Rebase macro-printk.patch on top of 3.10.0-957.1.3.el7.x86_64 used in
centos7 vagrant image.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:32:49 +01:00
Artem Savkov
3478a85459 integration/centos7: fix module prefixes
Modules were previously prefixed with either 'kpatch-' or 'livepatch-'
depending on which was used. This is no longer true and all modules are
now prefixed with "test-". Update test scripts accordingly.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:32:49 +01:00
Kamalesh Babulal
4d3363a975 Testcase: Clean up gcc-static-local-var-2
The test case gcc-static-local-var-2 doesn't uses any macros
from kpatch-macros.h, so remove the hunk including it.

Cc: Joe Lawrence <jdl1291@gmail.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
2018-04-06 12:11:05 +05:30
Kamalesh Babulal
bfacf5d15c Testing: Add testcase for correlating static local variable
This patch adds a reproducer testcase for correlating static local
variables added in .rodata* section, ahead of .toc section. This
testcase is for issue seen on PowerPC. For more details on the issue
refer pull request: 793.

It add's the testcase for:
- Fedora-27 Kernel version 4.15.10-300
- Centos-7 Kernel version 3.10.0-693 and
- Ubuntu-16.04 Kernel version 4.13.0-25.29

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
2018-04-05 09:44:45 -05:00
Joe Lawrence
926e4e0c7d kmod: add support for in-kernel livepatch hooks
Upstream 4.15 kernels provide support for pre and post (un)patch
callbacks, inspired by the kpatch load hooks.  Add support for them
in the livepatch-patch-hook.

At the same time, convert the kpatch hooks to use the same API.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2018-03-23 10:32:14 -04:00
Doug Goldstein
ff5c554a40
drop unused rpmdevtools dependency
It appears that since 0dec5136ee nothing
has been used from the rpmdevtools package by kpatch-build.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2018-03-21 15:15:08 -05:00
Joe Lawrence
2f8170e962 testing: rebase patches for CentOS 7.4 kernel-3.10.0-693.el7
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2017-09-22 17:02:33 -04:00
Joe Lawrence
5db4e232ee testing: use common Makefile
Move the integration tests Makefile up a directory level so that it can
be shared.  Update the kpatch-test script to accept a patch-directory
argument and the multiple.test cases to handle this new arrangement.
2016-12-16 16:16:30 -05:00
Joe Lawrence
11ce8102c2 testing: add and rebase integration tests for CentOS 7
Kernel version: 3.10.0-327.36.3.el7.x86_64
2016-12-16 16:06:28 -05:00