Commit Graph

231 Commits

Author SHA1 Message Date
Artem Savkov e0e41f0943 tests/integration/module.patch: fix ppc64le build
ppc64le build currently fails dues to unused sched_clock variable. Move
it's declaration into ifdef block.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-04-23 14:15:31 +02:00
Julien Thierry c1caee1468 create-diff-object: Ignore kpatch_ignored functions/sections missing ftrace hook
Some theoretically unchanged functions can have undesired changes if the
compiler decides to perform inlining in a different way (e.g. because of
newly added references). In such a case, it can be useful to discard
changes to functions that don't actually need modification.

Sadly, this currently doesn't work for functions missing the ftrace hook
(e.g. notrace code) as presence of the hook is checked before
identifying elements to ignore.

Look for functions/sections to ignore earlier.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2020-04-23 08:22:50 +01:00
Josh Poimboeuf 61ef8238d1 test/unit: Use non-failing jump label tests
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2020-04-14 17:41:17 -05:00
Josh Poimboeuf f24f5cb2ca test/integration: improve module integration test
Replace module-call-external.patch with a more fleshed-out version which
tests multiple things (including jump tables for newer kernels), and
also includes a runtime test.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2020-04-14 16:46:03 -05:00
Yannick Cote e2c66d7fb0
Merge pull request #1054 from julien-thierry/static-local-reworks
Static local reworks
2020-04-04 17:00:35 -04:00
Joe Lawrence 666635d4b0
Merge pull request #1083 from joe-lawrence/integration-rhel-7.8
test/integration: add rhel-7.8 rebased patches
2020-03-31 19:03:01 -04:00
Kamalesh Babulal 2e4309eebb test/integration: rhel-8.1 Add missing *.test files
Add the missing *.test files in test/integration/rhel-8.1

[Artem Savkov: Suggested to disable gcc-static-local-var-4.test]
Suggested-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
2020-03-30 20:21:00 +05:30
Julien Thierry 24fc731ab2 test/integration: Reenable test
Reenable previously failing test gcc-static-local-var-5.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2020-03-30 14:21:40 +01:00
Julien Thierry 2265ce6fc2 test/unit: Add unit test for static local moving sections
Signed-off-by: Julien Thierry <jthierry@redhat.com>
2020-03-30 14:14:17 +01:00
Yannick Cote 421df07ffa
Merge pull request #1086 from kamalesh-babulal/rhel8-1-testcases-rebase
test/intergation: Rebase to RHEL 8.1
2020-03-27 11:47:43 -04:00
Kamalesh Babulal db3c916e7c test/integration: Disable special-static testcase
Disabling the test case, until we find a workaround for functions
with the static key getting inlined. Read the comments from
@joe-lawrence in #1086 for detailed analysis.

Suggested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
2020-03-27 15:46:41 +05:30
Kamalesh Babulal 4423e471d1 test/intergation: Rebase to RHEL 8.1
Rebase the integration testcase on top of RHEL 8.1 kernel
4.18.0-147.el8.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
2020-03-17 17:31:09 +05:30
Joe Lawrence d9a40744aa test/integration: add rhel-7.8 rebased patches
Rebased against the RHEL-7.8 GA kernel-3.10.0-1127.el7.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2020-03-11 10:09:30 -04:00
Joe Lawrence ffe36c7716 testing/integration: update rebase_patches tool
Update the rebase_patches hack^H^H^H tool to make it easier to define
environment variables to drive it, rather than sourcing source
/etc/os-release for everything.  Fix a bunch of shellcheck warnings
along the way.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2020-03-10 10:36:46 -04:00
Artem Savkov f3e6f8e538 tests/integration: fetch pull-request data
Fetch pull-request data before resetting to a specified commit. This
will allow us to run integration tests on pull-request using master
repo, without cloning the original.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-02-25 17:33:24 +01:00
Joe Lawrence 69acfe8a2f
Merge pull request #1071 from joe-lawrence/gcc-static-local-var-4
integration: update gcc-static-local-var-4.test
2020-02-19 09:16:59 -05:00
Josh Poimboeuf 648be4c380
Merge pull request #1053 from julien-thierry/stricter-static-twin
kpatch-build: Make local static twining stricter
2020-02-17 15:15:52 -06: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 272761dd3a integration/Makefile: fix a typo
"vagrant" target's should be 'vagrant-quick', not 'vagrant_quick'.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-01-24 10:37:46 +01:00
Artem Savkov 3280e8e0e9 Add support for specific commits in vagrant
Relay KPATCH_GIT and KPATCH_REV into vagrant so it can checkout
specified repo/commit.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-01-24 10:37:46 +01:00
Artem Savkov f9e4399309 Fix kmod build for fedoras before fc30
We recently disabled building kmod by default, make sure fedora-27 (and
others before fc30) integration tests still build that.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-01-24 10:37:46 +01:00
Artem Savkov a48fb4a6f6 integration: rhel-7.6 and 7.7 module-call-external fix unsupported sibling call
These patches cause the following error on ppc64le on both 7.7 and 7.6:
create-diff-object: ERROR: export.o: kpatch_no_sibling_calls_ppc64le: 3290: Found an unsupported sibling call at e_show()+0x100.  Add __attribute__((optimize("-fno-optimize-sibling-calls"))) to e_show() definition.

Adding -fno-optimize-sibling-calls breaks build on x86_64, so limit it
to ppc64le only.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-01-24 10:37:35 +01:00
Artem Savkov 68c04e8282 integration: disable rhel8/macro-printk
This is supposedly fixed by #1053 and should be re-enabled when it is
merged.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-01-24 10:37:25 +01:00
Artem Savkov 6f570059ec integration: disable rhel8/gcc-static-local-var-5
This is supposedly fixed by #1054 and should be reinabled once that is
merged.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-01-24 10:37:25 +01: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
Artem Savkov c1d5cc47d7 Fix epel ccache installation
ccache version in epel updates from time to time so instead of
using a direct link install epel repo and install ccache without
specifying the version.

Suggested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Artem Savkov <asavkov@redhat.com>
2020-01-24 10:37:21 +01:00
Josh Poimboeuf 34a45ba847
Merge pull request #993 from kamalesh-babulal/r8-test-rebase
test/integration: Rebase to RHEL 8.0
2020-01-15 09:11:45 -06:00
Julien Thierry 68530e4c2b kpatch-build: Make local static twining stricter
The current code to find the twin of a local static variable allows two
variables of the same name to be wrongly matched with the other's twin.

While there isn't a magic formula to avoid this, make stricter
requirements for twining static local from the original object with
a symbol from the patched object. This reduces the risk of erroneous
matches.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-11-22 09:53:16 +00:00
Julien Thierry 54553c0622 test/unit: Update unit test submodule
Include test for mangled symbol modification.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-11-01 07:37:54 +00:00
Julien Thierry 0c96fd0968 test/integration: Fix RHEL-8 test new-function for ppc64le
new-function test fails on ppc64le with the following message:

create-diff-object: ERROR: n_tty.o: kpatch_no_sibling_calls_ppc64le: 3445: Found an unsupported sibling call at n_tty_write()+0x20.  Add __attribute__((optimize("-fno-optimize-sibling-calls"))) to n_tty_write() definition.

Add the suggested attribute, as was done for rhel-7.[5-7] versions of
the test.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-10-31 12:49:24 +00:00
Julien Thierry 6943128ceb test/integration: Disable test affecting jump label on ppcle64
On ppcle64, test gcc-static-local-var-4 impacts a jump label reference
which is currently unsupported.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-10-31 12:49:24 +00:00
Julien Thierry 4710df3c78 test/integration: Disable RHEL-8.0 tests using jump labels
Jump labels are unsupported, so tests modifying functions using them are
expected to fail. So disable them, for now...

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-10-31 12:49:24 +00:00
Kamalesh Babulal f42a4127f5 test/integration: Rebase to RHEL 8.0
Rebase the integration test cases on top of RHEL 8.0 kernel version
4.18.0-80.el8.

Suggested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
[JT: adapt data-new-LOADED to new meminfo format,
     use common template for multiple.test]
Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-10-31 12:49:24 +00:00
Julien Thierry 0f648b8056 test/integration: Skip disabled tests for combined test
Disabled patches won't trigger a build, but the combined load test
will still attempt to run their associated LOADED.test script. The
combined test will fail due to voluntarily disabled tests.

Do not run tests scripts associated with disabled tests.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-10-31 12:47:01 +00:00
Julien Thierry 4aa909eb8f test/integration: Skip disabled tests in multiple.test
Tests intentionaly disabled should be skipped by multiple.test

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-10-31 12:47:01 +00:00
Julien Thierry c9a4e09b45 test/integration: Fix kpatch-test module unloading
The unload_all() function in kpatch-test script is out dated and
does not unload patches loaded through livepatching.

Luckily, "kpatch unload --all" should support both kpatch unloading
kpatch patches and livepatch patches.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
2019-10-08 08:32:42 +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
Josh Poimboeuf 935f199875 create-diff-object: simplify mangled function correlation
The RHEL powerpc kernel is compiled with -O3, which triggers some
"interesting" new optimizations.  One of them, which seems to be
relatively common, is the replacing of a function with two separate
"constprop" functions.

Previously we only ever saw a single constprop clone, so we just renamed
the patched version of the function to match the original version.  Now
that we can have two such clones, that no longer makes sense.

Instead of renaming functions, just improve the correlation logic such
that they can be correlated despite having slightly different symbol
names.  The first clone in the original object is correlated with the
first clone in the patched object; the second clone is correlated with
the second clone; and so on.

This assumes that the order of the symbols and sections doesn't change,
which seems to be a reasonable assumption based on past experience with
the compiler.  Otherwise it will just unnecessarily mark the cloned
constprop functions as changed, which is annoying but harmless, and
noticeable by a human anyway.

Fixes #935.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2019-10-03 09:38:29 -05:00
Artem Savkov 52d4936e72 integration/rhel-*: fix multiple.test
When these from internal depths of Red Hat upstream paths changed and
now we are one level deeper in directory tree.

The issue probably also exist in rhel8.0 rebase pr #993.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-09-18 12:29:50 +02:00
Artem Savkov f6fd787468 test/integration: add an ability to check specific repo/commit
Add an ability to run vagrant integration tests on specified
repos/commits.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-08-22 15:31:11 +02:00
Joe Lawrence 2e9cfa2fb3
Merge pull request #1027 from jpoimboe/ignore-descriptor-static-key
create-diff-object: allow dynamic debug static keys
2019-08-19 10:50:13 -04:00
Josh Poimboeuf 2975775768 create-diff-object: allow dynamic debug static keys
While static keys (jump labels) are currently broken in livepatch, a
broken dynamic debug static key is harmless since it just disables
dynamically enabled debug printks in the patched code.

Fixes: #1021

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2019-08-15 16:01:55 -05:00
Josh Poimboeuf 2fede60e8f
Merge pull request #1019 from sm00th/integration_7_7
test/integration: add  rhel-7.7 rebased patches
2019-08-14 10:40:24 -05:00
Joe Lawrence b3ea0171ff test: remove testmod/
Remove test/testmod/ as it has been unmaintained for years now.

Fixes: issue #1017

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2019-08-13 11:50:40 -04:00
Artem Savkov 0e0cee369a test/integration: add rhel-7.7 rebased patches
Added integration-test patches rebased against rhel-7.7 GA kernel. No
conflicts, some fuzz.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-08-12 14:36:16 +02:00
Artem Savkov e2fdd33d4f tests/integration: fix dependency ccache on centos 7
Standard centos7 repos don't contain ccache so we have to install it
from epel just like we do on rhel7.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-08-09 16:31:19 +02:00
Josh Poimboeuf c6259d898c
Merge pull request #1006 from sm00th/unit_fail
tests/unit: fix inconsistent FAIL test failures
2019-07-24 09:58:14 -05:00
Josh Poimboeuf cef3360936 test/unit: Add unit test for ppc64le bundle replace_sections_syms()
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2019-07-23 18:11:54 -05:00
Josh Poimboeuf 9101ca99ef test/unit: update ppc64le tests for jump labels and sibling calls 2019-07-23 11:11:29 -05:00
Josh Poimboeuf 0e57bb0236 test/integration: disable sibling calls in failing integration tests
Now that sibling calls aren't supported in ppc64le, change the RHEL 7.5
and 7.6 versions of the new-function tests to disable the sibling call
optimization.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2019-07-23 11:11:29 -05:00