Commit Graph

160 Commits

Author SHA1 Message Date
Artem Savkov
a3afc831e2 integration/vm-integration-run: explain src manipulations
Add a comment to explain predownloaded kernel sources manipulations in
vm-integration-run.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-14 12:08:45 +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
c39a48a606 integration: temporary disable ubuntu1604
ubuntu1604's kernel is a 4.4 with backported livepatch witch confuses
kpatch-build and livepatch-patch-hook.c. Integration tests currently
fail on load/unload stage. Disabling all ubuntu integration tests until
this is resolved.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:34:13 +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
Artem Savkov
baa1355447 integration/ubuntu1604: 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
Artem Savkov
77304f60ce integration/ubuntu1604: remove shadow-variable patches
The kernel used in ubuntu1604 vagrant image does not have shadow
variable API.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:32:20 +01:00
Artem Savkov
14f7367e45 integration/ubuntu1604: disable module-call-external.patch
Original build includes "kzalloc" in af_netlink.c's symbol list, this
does not happen during kpatch build so create-diff-object fails with
find_local_syms.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:32:04 +01:00
Artem Savkov
9cd7eb224a integration/ubuntu1604: temporary disable -SLOW patch
kpatch-build currently fails with "invalid ancestor" error. This happens
with at least drivers/gpu/drm/i2c/adv7511.o and drivers/hwmon/htu21.o
files. The problem is their .ko counterparts are never built for some
reason, This looks like a kernel bug since in both cases there are files
with same name but in different paths that have .ko module built.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:30:43 +01:00
Artem Savkov
212a3a5a4b integration/ubuntu1604: macro-printk.patch rebase
Rebase macro-printk.patch on top of 4.4.0-133-generic kernel used in
kpatch/ubuntu1604 vagrant image.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:28:10 +01:00
Artem Savkov
36ba4343bb integration/ubuntu1604: replace macro-hooks.patch with macro-callbacks.patch
Macroses used in macro-hoos.patch are deprecated, use updated
macro-callbacs.patch instead.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:28:10 +01:00
Artem Savkov
086f7f6319 integration/ubuntu1604: disable gcc-mangled-3.patch
__flush_cpu_slab() is present in vmlinux.symtab but is optimized out
during kpatch builds.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:27:26 +01:00
Artem Savkov
cef728043e test/integration: don't use generic centos7 image
Use a kpatch-specific snapshot of centos7 image since we are still
running into problems we saw on fedora/ubuntu.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:25:21 +01:00
Artem Savkov
5371253094 test/integration: support in-image kernel sources
Unlike fedora, ubuntu doesn't keep older versions of kernel sources in
their archive so we need to have them predownloaded.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:25:21 +01:00
Artem Savkov
3c2ee0f61f integration: fix prefix in run_custom_test
run_custom_test used global "file" variable instead of local "testprog"
to deduce "prefix", so it would sometimes report wrong name for running
test.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:25:21 +01:00
Artem Savkov
0f54262f7d integration/fedora-27: adjust -LOADED tests module list
multiple.test contains outdated list of modules that have "-LOADED"
tests. Update the list.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:25:21 +01:00
Artem Savkov
519c7b9166 integration/fedora-27: disable meminfo-cmdline-rebuild-SLOW.patch
Temporary disable meminfo-cmdline-rebuild-SLOW.patch, right now it is
hitting https://github.com/dynup/kpatch/issues/767

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-11 10:24:55 +01:00
Artem Savkov
8e53b1dc8b integration/fedora-27/meminfo-cmdline-rebuild-SLOW.patch: rebase
Rebase to kernel-4.17.12-100.fc27 used in kpatch's fedora27 vagrant
image.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-08 12:10:53 +01:00
Artem Savkov
68db050ec5 integration/fedora-27/shadow-newpid.patch: rebase
Rebase to kernel-4.17.12-100.fc27 used in kpatch's fedora27 vagrant
image.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2019-01-08 12:10:49 +01:00
Artem Savkov
c08351ec24 Add vagrant-install target
Add a target to install vagrant, make sure the user is given a warning
and a chance to cancel this operation.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-11-08 09:04:38 +01:00
Artem Savkov
f43b061bb4 Integration tests with vagrant
This commit adds scripts/make targets to run integration tests on
fedora/ubuntu/centos through vagrant.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-10-30 10:56:19 +01:00
Artem Savkov
30e943defd integration/lib.sh: add write_vagrantfile* functions
Add vagrantfile generating functions to lib.sh.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-10-30 10:56:19 +01:00
Artem Savkov
e84fe6b14f integration/lib.sh: vagrant installation
Vagrant installation functions for fedora/centos with libvirt plugin.
This is intended to be used in scripts to provision a new test-machine,
human users of vagrant integration test targets are expected to have
working vagrant installation.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-10-30 10:56:19 +01:00
Artem Savkov
3bc5234ef0 integration/lib.sh: add separate_partition/disk_cache functions
Add functions to prepare a separate partition/disk for cache use
(.ccache and .kpatch dirs). This is useful for vagrant images that are
generally not big enough for kpatch build.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-10-30 10:56:19 +01:00
Artem Savkov
b003955257 Add integration/lib.sh with distro dependency functions
Add test/integration/lib.sh for use in other kpatch related scripts
and or directly by end-users. Initial version contains per-distro
dependency functions, so it can be quickly installed as follows:

$ . test/integration/lib.sh
$ kpatch_dependencies

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-10-30 10:56:00 +01:00
Joe Lawrence
ded02df5a1
Merge pull request #901 from sm00th/tint
Integration test improvements
2018-09-21 10:08:24 -04:00
Artem Savkov
b746182847 Unit test submodule update
Bump unit-test-objs submodule head pointer to include latest test:

f82c458 x86_64: added a test for a function that uses _THIS_IP_
4a097d9 ppc64le: Test const var requiring .data.rel relocation

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-09-12 09:50:29 +02:00
Artem Savkov
5371d9f972 kpatch-test: remove -SLOW special cases
Treat -SLOW patches the same way as normal ones, i.e. include them
during "quick" testing. Keeping "-SLOW" suffix in patch names to as a
way to distinguish them manually.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-09-10 10:01:16 +02:00
Artem Savkov
80f78c78bb test/integration: skip -SLOW load tests in combined run
We are not including -SLOW patches into combined module, so there is no
reason to expect their -LOADED tests to succeed with combined module.
Skip them in run_combined_test().

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-08-23 09:23:50 +02:00
Artem Savkov
1a91e256ff test/integration: run -FAIL tests when invoked with --quick
Include -FAIL tests as well as combined in 'quick' target.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-08-23 09:23:30 +02:00
Artem Savkov
6cbf55d77b test/integration: include build log on failures
If a patch build fails copy the build log to <prefix>.log file.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-08-23 09:23:03 +02:00
Artem Savkov
41f025d392 Include mrecord-mcount unit tests
Update objs-repo pointer to include new unit tests.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-26 16:51:28 +02:00
Artem Savkov
7cb5baccde Include gcc8 unit-tests
Update submodule pointer to include new gcc8 unit tests.

This update also includes unit-test for https://github.com/dynup/kpatch/pull/892

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-13 09:39:26 +02:00
Joe Lawrence
37e4ae0c88
Merge pull request #875 from sm00th/unit-clean
unittests: skip clean if objdir is not present
2018-06-04 13:59:59 -04:00
Joe Lawrence
9bc7776b0f
Merge pull request #868 from joe-lawrence/kpatch-test-names
testing: kpatch-build should set all module names
2018-06-04 13:58:32 -04:00
Artem Savkov
b10e0b7d82 unittests: skip clean if objdir is not present
Don't try to call unittest clean if objfile dir is non-existant (e.g.
when objfile submodule wasn't cloned). Another solution would be to make
clean target dependant on objdir but that would mean downloading a lot
of unneeded data for users who don't run unit-tests.

Fixes: #872

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-06-04 13:14:28 +02:00
Joe Lawrence
7646c68b59 testing: kpatch-build should set all module names
Since c0105ea467 ("kpatch-build: set default module prefix
accordingly") kpatch-build has automatically named resulting patch
modules with a "kpatch-" or "livepatch-" prefix (depending on its type).

To avoid naming confusion, have kpatch-test name all of its patch
modules with a "test-" prefix.

Fixes #867.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2018-06-01 16:59:08 -04:00
Josh Poimboeuf
a7c413d4e9
Merge pull request #856 from sm00th/unlikely-cold
create-diff-object: ignore .cold.* suffixes in is_bundleable()
2018-05-31 09:25:28 -05:00
Artem Savkov
6c58f09cc7 test/unit: update objects to include cold testcase
Update unit test objects subrepo to include x86_64 gcc-constprop-cold
testcase.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-05-31 15:29:06 +02:00
Joe Lawrence
ace1e2cbf6
Merge pull request #849 from sm00th/cdo-symtab
create-diff-object symtab
2018-05-30 14:15:43 -04:00
Josh Poimboeuf
5736f18d83 test/unit: run submodule command from base git directory
This fixes the following error with an older version of git
(1.8.3.1):

  make -C test/unit
  make[1]: Entering directory `/root/kpatch/test/unit'
  git submodule update --init --rebase
  You need to run this command from the toplevel of the working tree.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2018-05-30 10:54:24 -05:00
Artem Savkov
3aa5abb807 kpatch-build: use symbol table instead of kobject
create-diff-object doesn't really need the full kernel object file as
input. All it requires is a symbol table. Switch to using "eu-readelf -s"'s
output instead of object files. This will enable us to cover more cases
in unit tests.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-05-18 09:24:40 +02:00
Artem Savkov
5f610fdda2 ppc64le: add WARN detection
ppc64le lacked kpatch_line_macro_change_only() implementation. Add one
based on x86_64 version and available unit tests.

Fixes: #843

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-05-04 16:32:48 +02:00
Artem Savkov
e0acd5f835 unittests: object submodule update
Update submodule to 6774fbc "ppc64le: initial object files"
Remove CDO_ENV since it is moved to per-arch makefiles.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-04-27 20:10:43 +02:00
Artem Savkov
ffc4122efb Add kpatch-unit-objs submodule
Add a submodule containing object files for unittests.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-04-26 18:49:29 +02:00
Artem Savkov
89a8ac740c Disable git-lfs
While convenient git-lfs has too many restrictions for kpatch's needs.
Remove links to the objectfiles and related configs.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-04-26 15:08:24 +02:00
Joe Lawrence
70959ce6ec
Merge pull request #838 from jpoimboe/test-cleanups
Test cleanups
2018-04-23 17:31:35 -04:00