diff options
| author | Mingli Yu <mingli.yu@windriver.com> | 2025-07-24 17:28:13 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-19 11:48:50 +0100 |
| commit | 4fd63f7ec3d54ba93cb16050edc6ace55926bad1 (patch) | |
| tree | 5cfdbfbf2fc79cec1d8490a43336d6a313fb1b38 /meta | |
| parent | 975fd7de311f70758fa9970a0452ae35341d23c7 (diff) | |
| download | poky-4fd63f7ec3d54ba93cb16050edc6ace55926bad1.tar.gz | |
lttng-tools: Upgrade 2.13.15 -> 2.14.0
* Remove 3 backported patch.
0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch
0001-compat-Define-off64_t-as-off_t-on-linux.patch
0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch
* Remove 0001-fix-lttng-tools-fails-to-compile-with-libxml2-2.14.0.patch
as the issue has been fixed in another way as [1].
* Rebase 0001-tests-do-not-strip-a-helper-library.patch and disable-tests.patch
to fuzz issue.
* Add babeltrace2 to DEPENDS to fix below configure error.
| configure: error: libbabeltrace2 is required to build tests
* src/common/config/session.xsd is restructured to src/common/session.xsd [2].
* Add 0001-gen-ust-events-constructor-change-rpath-to-libdir-li.patch to fix
the below buildpath QA issue.
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: File /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-c-constructor-so in package lttng-tools-ptest contains reference to TMPDIR [buildpaths]
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: lttng-tools-ptest: /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-c-constructor-so contains bad RPATH /buildarea3/myu2/yocto/builds/ptest-2025-07-09/tmp/work/core2-64-poky-linux/lttng-tools/2.14.0/build/tests/utils/testapp/gen-ust-events-constructor [rpaths]
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: File /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-constructor-so in package lttng-tools-ptest contains reference to TMPDIR [buildpaths]
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: lttng-tools-ptest: /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-constructor-so contains bad RPATH /buildarea3/myu2/yocto/builds/ptest-2025-07-09/tmp/work/core2-64-poky-linux/lttng-tools/2.14.0/build/tests/utils/testapp/gen-ust-events-constructor [rpaths]
* Add the redpends for lttng-tools-ptest to fix the test failure.
ERROR: tools/live/test_early_inactive_app.py
============================================
Traceback (most recent call last):
File "/usr/lib/lttng-tools/ptest/tests/regression/./tools/live/test_early_inactive_app.py", line 21, in <module>
import lttngtest
File "/usr/lib/lttng-tools/ptest/tests/utils/lttngtest/__init__.py", line 9, in <module>
from .environment import *
File "/usr/lib/lttng-tools/ptest/tests/utils/lttngtest/environment.py", line 13, in <module>
import random
ModuleNotFoundError: No module named 'random'
ERROR: tools/live/test_early_inactive_app.py - missing test plan
ModuleNotFoundError: No module named 'random'
ModuleNotFoundError: No module named 'xml'
ModuleNotFoundError: No module named 'tempfile'
ModuleNotFoundError: No module named 'json'
ModuleNotFoundError: No module named 'bt2'
[1] https://github.com/lttng/lttng-tools/commit/2d2e77ddc9e3e63c3c658e824fb754f5a534a6ab
[2] https://github.com/lttng/lttng-tools/commit/4ae042345b4094e98611744d9ba6c92265058fdb
RP: Added install of missing expect scripts
Add new dependency on lttng-ust-dev due to test requirement (and remove QA check warning)
Add missing dependency on python3-asyncio for concurency module
(From OE-Core rev: a09c0fa79cba48c76ed9b582e42becff91f32435)
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
9 files changed, 71 insertions, 1452 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch deleted file mode 100644 index e5c9677073..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch +++ /dev/null | |||
| @@ -1,53 +0,0 @@ | |||
| 1 | From ea47622987d0947af3e8f75d16d52e27ebd60166 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
| 3 | Date: Mon, 25 Mar 2024 18:20:14 +0800 | ||
| 4 | Subject: [PATCH] Fix: rotation-destroy-flush: fix session daemon abort if no | ||
| 5 | kernel module present | ||
| 6 | |||
| 7 | Testing rotation-destroy-flush when no lttng kernel modules present, it would | ||
| 8 | be failed with error message: | ||
| 9 | |||
| 10 | Error: Unable to load required module lttng-ring-buffer-client-discard | ||
| 11 | not ok 1 - Start session daemon | ||
| 12 | Failed test 'Start session daemon' | ||
| 13 | not ok 2 - Create session rotation_destroy_flush in -o /tmp/tmp.test_rot ... | ||
| 14 | ... | ||
| 15 | |||
| 16 | This because test script that sets the LTTNG_ABORT_ON_ERROR environment | ||
| 17 | variable. It's this environment variable that causes the sessiond to handle the | ||
| 18 | kernel module loading failure as an abort rather than a warning. | ||
| 19 | |||
| 20 | Using "check_skip_kernel_test" to detect whether the kernel module fails to | ||
| 21 | load is expected or not. If the failure is expected, the script won't set that | ||
| 22 | environment variable any more. | ||
| 23 | |||
| 24 | Fixes: 3a174400 | ||
| 25 | ("tests:add check_skip_kernel_test to check root user and lttng kernel modules") | ||
| 26 | |||
| 27 | Submitted [https://review.lttng.org/c/lttng-tools/+/12155] | ||
| 28 | Upstream-Status: Backport [https://github.com/lttng/lttng-tools/commit/78f5b22de60c114c5c83410015a08bdd212edc0b] | ||
| 29 | Change-Id: I371e9ba717613e2940186f710cf3cccd35baed6c | ||
| 30 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
| 31 | --- | ||
| 32 | .../ust/rotation-destroy-flush/test_rotation_destroy_flush | 6 +++--- | ||
| 33 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
| 34 | |||
| 35 | diff --git a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush | ||
| 36 | index 8ef4f0d..e506b53 100755 | ||
| 37 | --- a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush | ||
| 38 | +++ b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush | ||
| 39 | @@ -23,11 +23,11 @@ SIZE_LIMIT=$PAGE_SIZE | ||
| 40 | NR_ITER=10 | ||
| 41 | NUM_TESTS=$((15*$NR_ITER)) | ||
| 42 | |||
| 43 | -# Ensure the daemons invoke abort on error. | ||
| 44 | -export LTTNG_ABORT_ON_ERROR=1 | ||
| 45 | - | ||
| 46 | source $TESTDIR/utils/utils.sh | ||
| 47 | |||
| 48 | +# Ensure the daemons invoke abort on error. | ||
| 49 | +check_skip_kernel_test || export LTTNG_ABORT_ON_ERROR=1 | ||
| 50 | + | ||
| 51 | # MUST set TESTDIR before calling those functions | ||
| 52 | function run_app() | ||
| 53 | { | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch deleted file mode 100644 index e68feb2753..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch +++ /dev/null | |||
| @@ -1,86 +0,0 @@ | |||
| 1 | From e5b2615aaad44a1c0d52da1469b28f99cfb12b5f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?= | ||
| 3 | <jeremie.galarneau@efficios.com> | ||
| 4 | Date: Tue, 17 Jan 2023 16:57:35 -0500 | ||
| 5 | Subject: [PATCH] compat: off64_t is not defined by musl | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | This helps compile with latest musl, where off64_t is not defined unless | ||
| 11 | _LARGEFILE64_SOURCE is defined. On glibc, _LARGEFILE64_SOURCE is defined | ||
| 12 | if _GNU_SOURCE is defined, so the problem is only seen with musl. | ||
| 13 | |||
| 14 | Since the project uses AC_SYS_LARGEFILE, which from the autoconf doc: | ||
| 15 | "arrange for 64-bit file offsets, known as large-file support." | ||
| 16 | |||
| 17 | As such, it is safe to assume off_t is 64-bit wide. This is checked by a | ||
| 18 | static_assert to catch any platform where autoconf would let a 32-bit | ||
| 19 | off_t slip. | ||
| 20 | |||
| 21 | Submitted [https://review.lttng.org/c/lttng-tools/+/9268] | ||
| 22 | Upstream-Status: Backport [https://github.com/lttng/lttng-tools/commit/57fd993799a2b081c826f6fc8def32d28d526bfb] | ||
| 23 | Reported-by: Khem Raj <raj.khem@gmail.com> | ||
| 24 | Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> | ||
| 25 | Change-Id: If2c6007a8c85bc3f3065002af8a7538b882fb4a8 | ||
| 26 | --- | ||
| 27 | src/common/compat/compat-fcntl.c | 5 ++++- | ||
| 28 | src/common/compat/fcntl.h | 10 +++------- | ||
| 29 | 2 files changed, 7 insertions(+), 8 deletions(-) | ||
| 30 | |||
| 31 | diff --git a/src/common/compat/compat-fcntl.c b/src/common/compat/compat-fcntl.c | ||
| 32 | index 5c0bdc9..18bab0a 100644 | ||
| 33 | --- a/src/common/compat/compat-fcntl.c | ||
| 34 | +++ b/src/common/compat/compat-fcntl.c | ||
| 35 | @@ -8,14 +8,17 @@ | ||
| 36 | #define _LGPL_SOURCE | ||
| 37 | #include <common/compat/fcntl.h> | ||
| 38 | #include <common/macros.h> | ||
| 39 | +#include <common/bug.h> | ||
| 40 | +#include <stdint.h> | ||
| 41 | #include <unistd.h> | ||
| 42 | |||
| 43 | #ifdef __linux__ | ||
| 44 | |||
| 45 | LTTNG_HIDDEN | ||
| 46 | -int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, | ||
| 47 | +int compat_sync_file_range(int fd, off_t offset, off_t nbytes, | ||
| 48 | unsigned int flags) | ||
| 49 | { | ||
| 50 | + LTTNG_BUILD_BUG_ON(sizeof(off_t) != sizeof(int64_t)); | ||
| 51 | #ifdef HAVE_SYNC_FILE_RANGE | ||
| 52 | return sync_file_range(fd, offset, nbytes, flags); | ||
| 53 | #else | ||
| 54 | diff --git a/src/common/compat/fcntl.h b/src/common/compat/fcntl.h | ||
| 55 | index 5e566e5..93b22b7 100644 | ||
| 56 | --- a/src/common/compat/fcntl.h | ||
| 57 | +++ b/src/common/compat/fcntl.h | ||
| 58 | @@ -13,16 +13,12 @@ | ||
| 59 | |||
| 60 | #include <common/compat/errno.h> | ||
| 61 | |||
| 62 | -#if (defined(__CYGWIN__)) | ||
| 63 | -typedef long long off64_t; | ||
| 64 | -#endif | ||
| 65 | - | ||
| 66 | #if (defined(__FreeBSD__) || defined(__sun__)) | ||
| 67 | typedef off64_t loff_t; | ||
| 68 | #endif | ||
| 69 | |||
| 70 | #ifdef __linux__ | ||
| 71 | -extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, | ||
| 72 | +extern int compat_sync_file_range(int fd, off_t offset, off_t nbytes, | ||
| 73 | unsigned int flags); | ||
| 74 | #define lttng_sync_file_range(fd, offset, nbytes, flags) \ | ||
| 75 | compat_sync_file_range(fd, offset, nbytes, flags) | ||
| 76 | @@ -37,8 +33,8 @@ extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, | ||
| 77 | #define SYNC_FILE_RANGE_WAIT_BEFORE 0 | ||
| 78 | #define SYNC_FILE_RANGE_WRITE 0 | ||
| 79 | |||
| 80 | -static inline int lttng_sync_file_range(int fd, off64_t offset, | ||
| 81 | - off64_t nbytes, unsigned int flags) | ||
| 82 | +static inline int lttng_sync_file_range(int fd, off_t offset, | ||
| 83 | + off_t nbytes, unsigned int flags) | ||
| 84 | { | ||
| 85 | return -ENOSYS; | ||
| 86 | } | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-fix-lttng-tools-fails-to-compile-with-libxml2-2.14.0.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-fix-lttng-tools-fails-to-compile-with-libxml2-2.14.0.patch deleted file mode 100644 index 7c2b893731..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-fix-lttng-tools-fails-to-compile-with-libxml2-2.14.0.patch +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | From 0b19e10a8a52fab0bfadbac5ce70f1b2d185a1d1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Wed, 21 May 2025 13:09:25 +0800 | ||
| 4 | Subject: [PATCH] fix lttng-tools fails to compile with libxml2 2.14.0+ | ||
| 5 | |||
| 6 | Description: | ||
| 7 | | In file included from /srv/pokybuild/yocto-worker/qemux86-alt/build/build/tmp/work/core2-32-poky-linux/lttng-tools/2.13.15/recipe-sysroot/usr/include/libxml2/libxml/parser.h:25, | ||
| 8 | | from ../../../../lttng-tools-2.13.15/src/common/config/session-config.c:29: | ||
| 9 | | /srv/pokybuild/yocto-worker/qemux86-alt/build/build/tmp/work/core2-32-poky-linux/lttng-tools/2.13.15/recipe-sysroot/usr/include/libxml2/libxml/encoding.h:173:7: note: declared here | ||
| 10 | | 173 | } input XML_DEPRECATED_MEMBER; | ||
| 11 | | | ^~~~~ | ||
| 12 | | ../../../../lttng-tools-2.13.15/src/common/config/session-config.c:432:15: error: called object is not a function or function pointer | ||
| 13 | | 432 | ret = handler->input(out_str, &out_len, (const xmlChar *) in_str, &in_len); | ||
| 14 | | | ^~~~~~~ | ||
| 15 | | At top level: | ||
| 16 | | cc1: note: unrecognized command-line option '-Wno-incomplete-setjmp-declaration' may have been intended to silence earlier diagnostics | ||
| 17 | |||
| 18 | |||
| 19 | According to [1][2], the UTF-8 handler is | ||
| 20 | ``` | ||
| 21 | static xmlCharEncError | ||
| 22 | UTF8ToUTF8(void *vctxt ATTRIBUTE_UNUSED, | ||
| 23 | unsigned char* out, int *outlen, | ||
| 24 | const unsigned char* in, int *inlen, | ||
| 25 | int flush ATTRIBUTE_UNUSED) | ||
| 26 | ``` | ||
| 27 | |||
| 28 | Update input.func with setting ATTRIBUTE_UNUSED params with NULL and 0 | ||
| 29 | |||
| 30 | [1] https://gitlab.gnome.org/GNOME/libxml2/-/commit/38f475072aefe032fff1dc058df3e56c1e7062fa | ||
| 31 | [2] https://gitlab.gnome.org/GNOME/libxml2/-/commit/69b83bb68e2a8ed0013f80c51b9a358714b00c9a#478024cc18a2cc8dbaed34076e9775f6827f413d_2188_2201 | ||
| 32 | |||
| 33 | Upstream-Status: Submitted [https://github.com/lttng/lttng-tools/pull/170] | ||
| 34 | Signed-off-by: Marko, Peter <Peter.Marko@siemens.com> | ||
| 35 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 36 | --- | ||
| 37 | src/common/config/session-config.c | 2 +- | ||
| 38 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 39 | |||
| 40 | diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c | ||
| 41 | index bb4e9fe..4042d34 100644 | ||
| 42 | --- a/src/common/config/session-config.c | ||
| 43 | +++ b/src/common/config/session-config.c | ||
| 44 | @@ -429,7 +429,7 @@ static xmlChar *encode_string(const char *in_str) | ||
| 45 | goto end; | ||
| 46 | } | ||
| 47 | |||
| 48 | - ret = handler->input(out_str, &out_len, (const xmlChar *) in_str, &in_len); | ||
| 49 | + ret = handler->input.func(NULL, out_str, &out_len, (const xmlChar *) in_str, &in_len, 0); | ||
| 50 | if (ret < 0) { | ||
| 51 | xmlFree(out_str); | ||
| 52 | out_str = NULL; | ||
| 53 | -- | ||
| 54 | 2.34.1 | ||
| 55 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-gen-ust-events-constructor-change-rpath-to-libdir-li.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-gen-ust-events-constructor-change-rpath-to-libdir-li.patch new file mode 100644 index 0000000000..562381b5fd --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/0001-gen-ust-events-constructor-change-rpath-to-libdir-li.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 673e8ef4763ea9a9c67248e6a1a7eadfc4bc278d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Liu Yiding <liuyd.fnst@fujitsu.com> | ||
| 3 | Date: Thu, 3 Jul 2025 19:00:25 +0800 | ||
| 4 | Subject: [PATCH] gen-ust-events-constructor: change rpath to $libdir like | ||
| 5 | others do | ||
| 6 | |||
| 7 | set rpath to abs_builddir will cause issue like: | ||
| 8 | ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: File /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-c-constructor-so in package lttng-tools-ptest contains reference to TMPDIR [buildpaths] | ||
| 9 | ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: File /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-constructor-so in package lttng-tools-ptest contains reference to TMPDIR [buildpaths] | ||
| 10 | |||
| 11 | userspace-probe-elf-binary and userspace-probe-sdt-binary set rpath to libdir | ||
| 12 | |$ grep -nr "rpath" */Makefile.am | ||
| 13 | |gen-ust-events-constructor/Makefile.am:29: -rpath $(abs_builddir) | ||
| 14 | |userspace-probe-elf-binary/Makefile.am:8:libfoo_la_LDFLAGS = -shared -module -avoid-version -rpath $(libdir) | ||
| 15 | |userspace-probe-sdt-binary/Makefile.am:25:libfoo_la_LDFLAGS = -module -shared -avoid-version -rpath $(libdir) | ||
| 16 | |userspace-probe-sdt-binary/Makefile.am:31:libbar_la_LDFLAGS = -module -shared -avoid-version -rpath $(libdir) | ||
| 17 | |userspace-probe-sdt-binary/Makefile.am:37:libzzz_la_LDFLAGS = -module -shared -avoid-version -rpath $(libdir) | ||
| 18 | |||
| 19 | Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com> | ||
| 20 | |||
| 21 | Upstream-Status: Submitted [https://github.com/lttng/lttng-tools/pull/171] | ||
| 22 | |||
| 23 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
| 24 | --- | ||
| 25 | tests/utils/testapp/gen-ust-events-constructor/Makefile.am | 2 +- | ||
| 26 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 27 | |||
| 28 | diff --git a/tests/utils/testapp/gen-ust-events-constructor/Makefile.am b/tests/utils/testapp/gen-ust-events-constructor/Makefile.am | ||
| 29 | index 6c09cf585..3eb26fba2 100644 | ||
| 30 | --- a/tests/utils/testapp/gen-ust-events-constructor/Makefile.am | ||
| 31 | +++ b/tests/utils/testapp/gen-ust-events-constructor/Makefile.am | ||
| 32 | @@ -26,7 +26,7 @@ else | ||
| 33 | # Force the shared flag on the noinst libraries since they are | ||
| 34 | # only built static by default | ||
| 35 | FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \ | ||
| 36 | - -rpath $(abs_builddir) | ||
| 37 | + -rpath $(libdir) | ||
| 38 | |||
| 39 | noinst_LTLIBRARIES += libtp-so-provider.la libtp-so-define.la \ | ||
| 40 | libtp-so_c-provider.la libtp-so_c-define.la | ||
| 41 | -- | ||
| 42 | 2.34.1 | ||
| 43 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch deleted file mode 100644 index cb2c763b51..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch +++ /dev/null | |||
| @@ -1,1243 +0,0 @@ | |||
| 1 | From 76976da4e01ce90923f61ba734e066faefb76beb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
| 3 | Date: Mon, 12 Feb 2024 09:23:54 -0500 | ||
| 4 | Subject: [PATCH] tests: add check_skip_kernel_test to check root user and | ||
| 5 | lttng kernel modules | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | The current tests will run both userspace and kernel testing. Some of | ||
| 11 | use cases only use lttng for one kind of tracing on an embedded | ||
| 12 | device (e.g. userspace), so in this scenario, the kernel modules might | ||
| 13 | not install to target rootfs, the test cases would be fail and exit. | ||
| 14 | |||
| 15 | Add LTTNG_TOOLS_DISABLE_KERNEL_TESTS to skip the lttng kernel features | ||
| 16 | test, this flag can be set via "make": | ||
| 17 | |||
| 18 | make check LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1 | ||
| 19 | |||
| 20 | When this flag was set, all kernel related testcases would be marked as | ||
| 21 | SKIP in result. | ||
| 22 | |||
| 23 | Since the the LTTNG_TOOLS_DISABLE_KERNEL_TESTS was checked in function | ||
| 24 | check_skip_kernel_test, lots of testcases also need to check root | ||
| 25 | permission, so merging the root permission checking into | ||
| 26 | check_skip_kernel_test. | ||
| 27 | |||
| 28 | Upstream-Status: Backport from | ||
| 29 | [https://git.lttng.org/?p=lttng-tools.git;a=commit;h=3a1744008331a0604479d3d7461f77056fad3a64] | ||
| 30 | |||
| 31 | Change-Id: I49a1f642a9869c21a69e0186c296fd917bd7b525 | ||
| 32 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
| 33 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
| 34 | Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> | ||
| 35 | --- | ||
| 36 | tests/destructive/metadata-regeneration | 8 +---- | ||
| 37 | tests/perf/test_perf_raw.in | 8 +---- | ||
| 38 | tests/regression/kernel/test_all_events | 8 +---- | ||
| 39 | tests/regression/kernel/test_callstack | 8 +---- | ||
| 40 | tests/regression/kernel/test_channel | 8 +---- | ||
| 41 | tests/regression/kernel/test_clock_override | 8 +---- | ||
| 42 | tests/regression/kernel/test_event_basic | 8 +---- | ||
| 43 | tests/regression/kernel/test_kernel_function | 8 +---- | ||
| 44 | tests/regression/kernel/test_lttng_logger | 8 +---- | ||
| 45 | tests/regression/kernel/test_ns_contexts | 8 +---- | ||
| 46 | .../regression/kernel/test_ns_contexts_change | 9 +---- | ||
| 47 | .../kernel/test_rotation_destroy_flush | 8 +---- | ||
| 48 | .../regression/kernel/test_select_poll_epoll | 8 +---- | ||
| 49 | tests/regression/kernel/test_syscall | 8 +---- | ||
| 50 | tests/regression/kernel/test_userspace_probe | 8 +---- | ||
| 51 | tests/regression/tools/clear/test_kernel | 8 +---- | ||
| 52 | .../tools/filtering/test_invalid_filter | 8 +---- | ||
| 53 | .../tools/filtering/test_unsupported_op | 8 +---- | ||
| 54 | .../tools/filtering/test_valid_filter | 8 +---- | ||
| 55 | tests/regression/tools/health/test_health.sh | 10 ++---- | ||
| 56 | tests/regression/tools/health/test_thread_ok | 9 +---- | ||
| 57 | tests/regression/tools/live/test_kernel | 10 +++--- | ||
| 58 | tests/regression/tools/live/test_lttng_kernel | 8 +---- | ||
| 59 | tests/regression/tools/metadata/test_kernel | 8 +---- | ||
| 60 | .../test_notification_kernel_buffer_usage | 36 +++++++++---------- | ||
| 61 | .../test_notification_kernel_capture | 23 ++++++------ | ||
| 62 | .../test_notification_kernel_error | 23 ++++++------ | ||
| 63 | .../test_notification_kernel_instrumentation | 23 ++++++------ | ||
| 64 | .../test_notification_kernel_syscall | 19 +++++----- | ||
| 65 | .../test_notification_kernel_userspace_probe | 20 +++++------ | ||
| 66 | .../notification/test_notification_multi_app | 14 +++----- | ||
| 67 | ...test_notification_notifier_discarded_count | 9 +++-- | ||
| 68 | .../tools/regen-metadata/test_kernel | 8 +---- | ||
| 69 | .../tools/regen-statedump/test_kernel | 8 +---- | ||
| 70 | tests/regression/tools/rotation/test_kernel | 8 +---- | ||
| 71 | tests/regression/tools/snapshots/test_kernel | 8 +---- | ||
| 72 | .../tools/snapshots/test_kernel_streaming | 8 +---- | ||
| 73 | .../streaming/test_high_throughput_limits | 8 +---- | ||
| 74 | tests/regression/tools/streaming/test_kernel | 8 +---- | ||
| 75 | .../tools/tracker/test_event_tracker | 8 +---- | ||
| 76 | .../tools/trigger/test_add_trigger_cli | 12 ++----- | ||
| 77 | .../tools/trigger/test_list_triggers_cli | 26 +++++--------- | ||
| 78 | .../tools/wildcard/test_event_wildcard | 8 +---- | ||
| 79 | .../test_relayd_working_directory | 4 +-- | ||
| 80 | .../ust/namespaces/test_ns_contexts_change | 7 +--- | ||
| 81 | tests/regression/ust/test_event_perf | 8 +---- | ||
| 82 | tests/utils/utils.sh | 35 ++++++++++++++++++ | ||
| 83 | 47 files changed, 166 insertions(+), 363 deletions(-) | ||
| 84 | |||
| 85 | diff --git a/tests/destructive/metadata-regeneration b/tests/destructive/metadata-regeneration | ||
| 86 | index b81e7af..36b130d 100755 | ||
| 87 | --- a/tests/destructive/metadata-regeneration | ||
| 88 | +++ b/tests/destructive/metadata-regeneration | ||
| 89 | @@ -185,19 +185,13 @@ function test_ust_streaming () | ||
| 90 | rm -f ${file_sync_before_last} | ||
| 91 | } | ||
| 92 | |||
| 93 | -if [ "$(id -u)" == "0" ]; then | ||
| 94 | - isroot=1 | ||
| 95 | -else | ||
| 96 | - isroot=0 | ||
| 97 | -fi | ||
| 98 | - | ||
| 99 | if ! destructive_tests_enabled ; then | ||
| 100 | echo 'You need to set the LTTNG_ENABLE_DESTRUCTIVE_TESTS to "will-break-my-system" as argument to run this test' | ||
| 101 | echo 'Moreover, please make sure that ntp is not running while executing this test' | ||
| 102 | exit 0 | ||
| 103 | fi | ||
| 104 | |||
| 105 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 106 | +check_skip_kernel_test $NUM_TESTS "Skipping all tests." || | ||
| 107 | { | ||
| 108 | start_lttng_relayd "-o $TRACE_PATH" | ||
| 109 | start_lttng_sessiond | ||
| 110 | diff --git a/tests/perf/test_perf_raw.in b/tests/perf/test_perf_raw.in | ||
| 111 | index f293ccd..d35529a 100644 | ||
| 112 | --- a/tests/perf/test_perf_raw.in | ||
| 113 | +++ b/tests/perf/test_perf_raw.in | ||
| 114 | @@ -137,12 +137,6 @@ function test_kernel_raw() | ||
| 115 | rm -rf $TRACE_PATH | ||
| 116 | } | ||
| 117 | |||
| 118 | -if [ "$(id -u)" == "0" ]; then | ||
| 119 | - isroot=1 | ||
| 120 | -else | ||
| 121 | - isroot=0 | ||
| 122 | -fi | ||
| 123 | - | ||
| 124 | # MUST set TESTDIR before calling those functions | ||
| 125 | plan_tests $NUM_TESTS | ||
| 126 | |||
| 127 | @@ -154,7 +148,7 @@ have_libpfm | ||
| 128 | |||
| 129 | test_ust_raw | ||
| 130 | |||
| 131 | -skip $isroot "Root access is needed for kernel testing, skipping." 9 || | ||
| 132 | +check_skip_kernel_test 9 || | ||
| 133 | { | ||
| 134 | modprobe lttng-test | ||
| 135 | test_kernel_raw | ||
| 136 | diff --git a/tests/regression/kernel/test_all_events b/tests/regression/kernel/test_all_events | ||
| 137 | index 2e20888..044f9b6 100755 | ||
| 138 | --- a/tests/regression/kernel/test_all_events | ||
| 139 | +++ b/tests/regression/kernel/test_all_events | ||
| 140 | @@ -43,13 +43,7 @@ plan_tests $NUM_TESTS | ||
| 141 | |||
| 142 | print_test_banner "$TEST_DESC" | ||
| 143 | |||
| 144 | -if [ "$(id -u)" == "0" ]; then | ||
| 145 | - isroot=1 | ||
| 146 | -else | ||
| 147 | - isroot=0 | ||
| 148 | -fi | ||
| 149 | - | ||
| 150 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 151 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 152 | { | ||
| 153 | validate_lttng_modules_present | ||
| 154 | start_lttng_sessiond | ||
| 155 | diff --git a/tests/regression/kernel/test_callstack b/tests/regression/kernel/test_callstack | ||
| 156 | index a4477fd..d8d6b5e 100755 | ||
| 157 | --- a/tests/regression/kernel/test_callstack | ||
| 158 | +++ b/tests/regression/kernel/test_callstack | ||
| 159 | @@ -134,13 +134,7 @@ plan_tests $NUM_TESTS | ||
| 160 | |||
| 161 | print_test_banner "$TEST_DESC" | ||
| 162 | |||
| 163 | -if [ "$(id -u)" == "0" ]; then | ||
| 164 | - isroot=1 | ||
| 165 | -else | ||
| 166 | - isroot=0 | ||
| 167 | -fi | ||
| 168 | - | ||
| 169 | -skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" || | ||
| 170 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 171 | { | ||
| 172 | validate_lttng_modules_present | ||
| 173 | start_lttng_sessiond | ||
| 174 | diff --git a/tests/regression/kernel/test_channel b/tests/regression/kernel/test_channel | ||
| 175 | index 9cc74c4..4c377bd 100755 | ||
| 176 | --- a/tests/regression/kernel/test_channel | ||
| 177 | +++ b/tests/regression/kernel/test_channel | ||
| 178 | @@ -47,13 +47,7 @@ function test_channel_buffer_too_large() | ||
| 179 | plan_tests $NUM_TESTS | ||
| 180 | print_test_banner "$TEST_DESC" | ||
| 181 | |||
| 182 | -if [ "$(id -u)" == "0" ]; then | ||
| 183 | - isroot=1 | ||
| 184 | -else | ||
| 185 | - isroot=0 | ||
| 186 | -fi | ||
| 187 | - | ||
| 188 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 189 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 190 | { | ||
| 191 | start_lttng_sessiond | ||
| 192 | |||
| 193 | diff --git a/tests/regression/kernel/test_clock_override b/tests/regression/kernel/test_clock_override | ||
| 194 | index 7289289..48a3f92 100755 | ||
| 195 | --- a/tests/regression/kernel/test_clock_override | ||
| 196 | +++ b/tests/regression/kernel/test_clock_override | ||
| 197 | @@ -172,13 +172,7 @@ TESTS=( | ||
| 198 | TEST_COUNT=${#TESTS[@]} | ||
| 199 | i=0 | ||
| 200 | |||
| 201 | -if [ "$(id -u)" == "0" ]; then | ||
| 202 | - isroot=1 | ||
| 203 | -else | ||
| 204 | - isroot=0 | ||
| 205 | -fi | ||
| 206 | - | ||
| 207 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 208 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 209 | { | ||
| 210 | validate_lttng_modules_present | ||
| 211 | trap signal_cleanup SIGTERM SIGINT | ||
| 212 | diff --git a/tests/regression/kernel/test_event_basic b/tests/regression/kernel/test_event_basic | ||
| 213 | index ac9ec05..387e2f7 100755 | ||
| 214 | --- a/tests/regression/kernel/test_event_basic | ||
| 215 | +++ b/tests/regression/kernel/test_event_basic | ||
| 216 | @@ -73,13 +73,7 @@ plan_tests $NUM_TESTS | ||
| 217 | |||
| 218 | print_test_banner "$TEST_DESC" | ||
| 219 | |||
| 220 | -if [ "$(id -u)" == "0" ]; then | ||
| 221 | - isroot=1 | ||
| 222 | -else | ||
| 223 | - isroot=0 | ||
| 224 | -fi | ||
| 225 | - | ||
| 226 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 227 | +check_skip_kernel_test $NUM_TESTS "Skipping all tests." || | ||
| 228 | { | ||
| 229 | validate_lttng_modules_present | ||
| 230 | start_lttng_sessiond | ||
| 231 | diff --git a/tests/regression/kernel/test_kernel_function b/tests/regression/kernel/test_kernel_function | ||
| 232 | index b1d5491..ea16cde 100755 | ||
| 233 | --- a/tests/regression/kernel/test_kernel_function | ||
| 234 | +++ b/tests/regression/kernel/test_kernel_function | ||
| 235 | @@ -43,13 +43,7 @@ plan_tests $NUM_TESTS | ||
| 236 | |||
| 237 | print_test_banner "$TEST_DESC" | ||
| 238 | |||
| 239 | -if [ "$(id -u)" == "0" ]; then | ||
| 240 | - isroot=1 | ||
| 241 | -else | ||
| 242 | - isroot=0 | ||
| 243 | -fi | ||
| 244 | - | ||
| 245 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 246 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 247 | { | ||
| 248 | start_lttng_sessiond_notap | ||
| 249 | validate_lttng_modules_present | ||
| 250 | diff --git a/tests/regression/kernel/test_lttng_logger b/tests/regression/kernel/test_lttng_logger | ||
| 251 | index b8f7ded..00eaae8 100755 | ||
| 252 | --- a/tests/regression/kernel/test_lttng_logger | ||
| 253 | +++ b/tests/regression/kernel/test_lttng_logger | ||
| 254 | @@ -110,13 +110,7 @@ plan_tests $NUM_TESTS | ||
| 255 | |||
| 256 | print_test_banner "$TEST_DESC" | ||
| 257 | |||
| 258 | -if [ "$(id -u)" == "0" ]; then | ||
| 259 | - isroot=1 | ||
| 260 | -else | ||
| 261 | - isroot=0 | ||
| 262 | -fi | ||
| 263 | - | ||
| 264 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 265 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 266 | { | ||
| 267 | validate_lttng_modules_present | ||
| 268 | start_lttng_sessiond | ||
| 269 | diff --git a/tests/regression/kernel/test_ns_contexts b/tests/regression/kernel/test_ns_contexts | ||
| 270 | index 7d447bc..1c71ea5 100755 | ||
| 271 | --- a/tests/regression/kernel/test_ns_contexts | ||
| 272 | +++ b/tests/regression/kernel/test_ns_contexts | ||
| 273 | @@ -108,13 +108,7 @@ plan_tests $NUM_TESTS | ||
| 274 | print_test_banner "$TEST_DESC" | ||
| 275 | |||
| 276 | |||
| 277 | -isroot=0 | ||
| 278 | -if [ "$(id -u)" == "0" ]; then | ||
| 279 | - isroot=1 | ||
| 280 | -fi | ||
| 281 | - | ||
| 282 | -skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" && exit 0 | ||
| 283 | - | ||
| 284 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." && exit 0 | ||
| 285 | |||
| 286 | system_has_ns=0 | ||
| 287 | if [ -d "/proc/$$/ns" ]; then | ||
| 288 | diff --git a/tests/regression/kernel/test_ns_contexts_change b/tests/regression/kernel/test_ns_contexts_change | ||
| 289 | index 42a6127..3f5e4ee 100755 | ||
| 290 | --- a/tests/regression/kernel/test_ns_contexts_change | ||
| 291 | +++ b/tests/regression/kernel/test_ns_contexts_change | ||
| 292 | @@ -162,14 +162,7 @@ plan_tests $NUM_TESTS | ||
| 293 | |||
| 294 | print_test_banner "$TEST_DESC" | ||
| 295 | |||
| 296 | - | ||
| 297 | -isroot=0 | ||
| 298 | -if [ "$(id -u)" == "0" ]; then | ||
| 299 | - isroot=1 | ||
| 300 | -fi | ||
| 301 | - | ||
| 302 | -skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" && exit 0 | ||
| 303 | - | ||
| 304 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." && exit 0 | ||
| 305 | |||
| 306 | system_has_ns=0 | ||
| 307 | if [ -d "/proc/$$/ns" ]; then | ||
| 308 | diff --git a/tests/regression/kernel/test_rotation_destroy_flush b/tests/regression/kernel/test_rotation_destroy_flush | ||
| 309 | index cb773d7..0af514b 100755 | ||
| 310 | --- a/tests/regression/kernel/test_rotation_destroy_flush | ||
| 311 | +++ b/tests/regression/kernel/test_rotation_destroy_flush | ||
| 312 | @@ -120,13 +120,7 @@ TESTS=( | ||
| 313 | TEST_COUNT=${#TESTS[@]} | ||
| 314 | i=0 | ||
| 315 | |||
| 316 | -if [ "$(id -u)" == "0" ]; then | ||
| 317 | - isroot=1 | ||
| 318 | -else | ||
| 319 | - isroot=0 | ||
| 320 | -fi | ||
| 321 | - | ||
| 322 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 323 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 324 | { | ||
| 325 | validate_lttng_modules_present | ||
| 326 | trap signal_cleanup SIGTERM SIGINT | ||
| 327 | diff --git a/tests/regression/kernel/test_select_poll_epoll b/tests/regression/kernel/test_select_poll_epoll | ||
| 328 | index d8245a0..20f0ef0 100755 | ||
| 329 | --- a/tests/regression/kernel/test_select_poll_epoll | ||
| 330 | +++ b/tests/regression/kernel/test_select_poll_epoll | ||
| 331 | @@ -374,13 +374,7 @@ if test $? != 0; then | ||
| 332 | exit 0 | ||
| 333 | fi | ||
| 334 | |||
| 335 | -if [ "$(id -u)" == "0" ]; then | ||
| 336 | - isroot=1 | ||
| 337 | -else | ||
| 338 | - isroot=0 | ||
| 339 | -fi | ||
| 340 | - | ||
| 341 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 342 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 343 | { | ||
| 344 | validate_lttng_modules_present | ||
| 345 | |||
| 346 | diff --git a/tests/regression/kernel/test_syscall b/tests/regression/kernel/test_syscall | ||
| 347 | index 401a18a..219d947 100755 | ||
| 348 | --- a/tests/regression/kernel/test_syscall | ||
| 349 | +++ b/tests/regression/kernel/test_syscall | ||
| 350 | @@ -664,13 +664,7 @@ plan_tests $NUM_TESTS | ||
| 351 | |||
| 352 | print_test_banner "$TEST_DESC" | ||
| 353 | |||
| 354 | -if [ "$(id -u)" == "0" ]; then | ||
| 355 | - isroot=1 | ||
| 356 | -else | ||
| 357 | - isroot=0 | ||
| 358 | -fi | ||
| 359 | - | ||
| 360 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 361 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 362 | { | ||
| 363 | validate_lttng_modules_present | ||
| 364 | start_lttng_sessiond | ||
| 365 | diff --git a/tests/regression/kernel/test_userspace_probe b/tests/regression/kernel/test_userspace_probe | ||
| 366 | index 1091ee6..5d984d6 100755 | ||
| 367 | --- a/tests/regression/kernel/test_userspace_probe | ||
| 368 | +++ b/tests/regression/kernel/test_userspace_probe | ||
| 369 | @@ -815,13 +815,7 @@ fi | ||
| 370 | plan_tests $NUM_TESTS | ||
| 371 | print_test_banner "$TEST_DESC" | ||
| 372 | |||
| 373 | -if [ "$(id -u)" == "0" ]; then | ||
| 374 | - isroot=1 | ||
| 375 | -else | ||
| 376 | - isroot=0 | ||
| 377 | -fi | ||
| 378 | - | ||
| 379 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 380 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 381 | { | ||
| 382 | validate_lttng_modules_present | ||
| 383 | start_lttng_sessiond | ||
| 384 | diff --git a/tests/regression/tools/clear/test_kernel b/tests/regression/tools/clear/test_kernel | ||
| 385 | index 06fb1c3..48250a7 100755 | ||
| 386 | --- a/tests/regression/tools/clear/test_kernel | ||
| 387 | +++ b/tests/regression/tools/clear/test_kernel | ||
| 388 | @@ -536,12 +536,6 @@ plan_tests $NUM_TESTS | ||
| 389 | |||
| 390 | print_test_banner "$TEST_DESC" | ||
| 391 | |||
| 392 | -if [ "$(id -u)" == "0" ]; then | ||
| 393 | - isroot=1 | ||
| 394 | -else | ||
| 395 | - isroot=0 | ||
| 396 | -fi | ||
| 397 | - | ||
| 398 | streaming_tests=(test_kernel_streaming | ||
| 399 | test_kernel_streaming_rotate_clear | ||
| 400 | test_kernel_streaming_clear_rotate | ||
| 401 | @@ -563,7 +557,7 @@ snapshot_tests=(test_kernel_streaming_snapshot | ||
| 402 | test_kernel_local_snapshot | ||
| 403 | ) | ||
| 404 | |||
| 405 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
| 406 | +check_skip_kernel_test "$NUM_TESTS" "Skipping kernel streaming tests." || | ||
| 407 | { | ||
| 408 | trap signal_cleanup SIGTERM SIGINT | ||
| 409 | |||
| 410 | diff --git a/tests/regression/tools/filtering/test_invalid_filter b/tests/regression/tools/filtering/test_invalid_filter | ||
| 411 | index 7d9e524..8435e55 100755 | ||
| 412 | --- a/tests/regression/tools/filtering/test_invalid_filter | ||
| 413 | +++ b/tests/regression/tools/filtering/test_invalid_filter | ||
| 414 | @@ -168,13 +168,7 @@ done | ||
| 415 | |||
| 416 | test_bytecode_limit -u | ||
| 417 | |||
| 418 | -if [ "$(id -u)" == "0" ]; then | ||
| 419 | - isroot=1 | ||
| 420 | -else | ||
| 421 | - isroot=0 | ||
| 422 | -fi | ||
| 423 | - | ||
| 424 | -skip $isroot "Root access is needed. Skipping all kernel invalid filter tests." $NUM_KERNEL_TESTS || | ||
| 425 | +check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel invalid filter tests." || | ||
| 426 | { | ||
| 427 | diag "Test kernel filters" | ||
| 428 | i=0 | ||
| 429 | diff --git a/tests/regression/tools/filtering/test_unsupported_op b/tests/regression/tools/filtering/test_unsupported_op | ||
| 430 | index 299247a..91eb86d 100755 | ||
| 431 | --- a/tests/regression/tools/filtering/test_unsupported_op | ||
| 432 | +++ b/tests/regression/tools/filtering/test_unsupported_op | ||
| 433 | @@ -103,13 +103,7 @@ while [ "$i" -lt "$OP_COUNT" ]; do | ||
| 434 | let "i++" | ||
| 435 | done | ||
| 436 | |||
| 437 | -if [ "$(id -u)" == "0" ]; then | ||
| 438 | - isroot=1 | ||
| 439 | -else | ||
| 440 | - isroot=0 | ||
| 441 | -fi | ||
| 442 | - | ||
| 443 | -skip $isroot "Root access is needed. Skipping all kernel unsupported filter operations tests." $NUM_KERNEL_TESTS || | ||
| 444 | +check_skip_kernel_test $NUM_KERNEL_TESTS "Skipping kernel unsupported filter operations tests." || | ||
| 445 | { | ||
| 446 | diag "Test kernel unsupported filter operations" | ||
| 447 | |||
| 448 | diff --git a/tests/regression/tools/filtering/test_valid_filter b/tests/regression/tools/filtering/test_valid_filter | ||
| 449 | index e76ffa2..1ba7c79 100755 | ||
| 450 | --- a/tests/regression/tools/filtering/test_valid_filter | ||
| 451 | +++ b/tests/regression/tools/filtering/test_valid_filter | ||
| 452 | @@ -1452,13 +1452,7 @@ KERNEL_FILTERS=( | ||
| 453 | |||
| 454 | IFS=$OLDIFS | ||
| 455 | |||
| 456 | -if [ "$(id -u)" == "0" ]; then | ||
| 457 | - isroot=1 | ||
| 458 | -else | ||
| 459 | - isroot=0 | ||
| 460 | -fi | ||
| 461 | - | ||
| 462 | -skip $isroot "Root access is needed. Skipping all kernel valid filter tests." $NUM_KERNEL_TESTS || | ||
| 463 | +check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel valid filter tests." || | ||
| 464 | { | ||
| 465 | diag "Test kernel valid filters" | ||
| 466 | |||
| 467 | diff --git a/tests/regression/tools/health/test_health.sh b/tests/regression/tools/health/test_health.sh | ||
| 468 | index b3d6419..68716e6 100644 | ||
| 469 | --- a/tests/regression/tools/health/test_health.sh | ||
| 470 | +++ b/tests/regression/tools/health/test_health.sh | ||
| 471 | @@ -82,7 +82,7 @@ function test_health | ||
| 472 | diag "With UST consumer daemons" | ||
| 473 | enable_ust_lttng_event_ok $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME | ||
| 474 | |||
| 475 | - skip $isroot "Root access is needed. Skipping kernel consumer health check test." "1" || | ||
| 476 | + check_skip_kernel_test "1" "Skipping kernel consumer health check test." || | ||
| 477 | { | ||
| 478 | diag "With kernel consumer daemon" | ||
| 479 | lttng_enable_kernel_event $SESSION_NAME $KERNEL_EVENT_NAME $CHANNEL_NAME | ||
| 480 | @@ -113,7 +113,7 @@ function test_health | ||
| 481 | |||
| 482 | |||
| 483 | if [ ${test_needs_root} -eq 1 ]; then | ||
| 484 | - skip ${isroot} "Root access needed for test \"${test_thread_name}\"." "1" || | ||
| 485 | + check_skip_kernel_test "1" "Skipping \"${test_thread_name}\"." || | ||
| 486 | { | ||
| 487 | report_errors "${test_thread_error_string}" "${test_relayd}" | ||
| 488 | } | ||
| 489 | @@ -276,12 +276,6 @@ STDERR_PATH=$(mktemp --tmpdir tmp.test_health_stderr_path.XXXXXX) | ||
| 490 | TRACE_PATH=$(mktemp --tmpdir -d tmp.test_health_trace_path.XXXXXX) | ||
| 491 | HEALTH_PATH=$(mktemp --tmpdir -d tmp.test_health_trace_path.XXXXXX) | ||
| 492 | |||
| 493 | -if [ "$(id -u)" == "0" ]; then | ||
| 494 | - isroot=1 | ||
| 495 | -else | ||
| 496 | - isroot=0 | ||
| 497 | -fi | ||
| 498 | - | ||
| 499 | THREAD_COUNT=${#THREAD[@]} | ||
| 500 | i=0 | ||
| 501 | while [ "$i" -lt "$THREAD_COUNT" ]; do | ||
| 502 | diff --git a/tests/regression/tools/health/test_thread_ok b/tests/regression/tools/health/test_thread_ok | ||
| 503 | index e84adb6..e5e2354 100755 | ||
| 504 | --- a/tests/regression/tools/health/test_thread_ok | ||
| 505 | +++ b/tests/regression/tools/health/test_thread_ok | ||
| 506 | @@ -67,7 +67,7 @@ function test_thread_ok | ||
| 507 | $CURDIR/$HEALTH_CHECK_BIN > ${STDOUT_PATH} 2> ${STDERR_PATH} | ||
| 508 | report_errors | ||
| 509 | |||
| 510 | - skip $isroot "Root access is needed. Skipping kernel consumer health check test." "5" || | ||
| 511 | + check_skip_kernel_test "5" "Skipping kernel consumer health check test." || | ||
| 512 | { | ||
| 513 | diag "With kernel consumer daemon" | ||
| 514 | create_lttng_session_no_output $SESSION_NAME | ||
| 515 | @@ -115,13 +115,6 @@ STDERR_PATH=$(mktemp --tmpdir tmp.test_thread_ok_stderr_path.XXXXXX) | ||
| 516 | TRACE_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX) | ||
| 517 | HEALTH_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX) | ||
| 518 | |||
| 519 | -# The manage kernel thread is only spawned if we are root | ||
| 520 | -if [ "$(id -u)" == "0" ]; then | ||
| 521 | - isroot=1 | ||
| 522 | -else | ||
| 523 | - isroot=0 | ||
| 524 | -fi | ||
| 525 | - | ||
| 526 | test_thread_ok | ||
| 527 | |||
| 528 | rm -rf ${HEALTH_PATH} | ||
| 529 | diff --git a/tests/regression/tools/live/test_kernel b/tests/regression/tools/live/test_kernel | ||
| 530 | index b622b52..fdaa09f 100755 | ||
| 531 | --- a/tests/regression/tools/live/test_kernel | ||
| 532 | +++ b/tests/regression/tools/live/test_kernel | ||
| 533 | @@ -39,13 +39,11 @@ function clean_live_tracing() | ||
| 534 | rm -rf $TRACE_PATH | ||
| 535 | } | ||
| 536 | |||
| 537 | -# Need root access for kernel tracing. | ||
| 538 | -if [ "$(id -u)" == "0" ]; then | ||
| 539 | - isroot=1 | ||
| 540 | -else | ||
| 541 | - plan_skip_all "Root access is needed. Skipping all tests." | ||
| 542 | +check_skip_kernel_test && | ||
| 543 | +{ | ||
| 544 | + plan_skip_all "Skipping all tests." | ||
| 545 | exit 0 | ||
| 546 | -fi | ||
| 547 | +} | ||
| 548 | |||
| 549 | modprobe lttng-test | ||
| 550 | |||
| 551 | diff --git a/tests/regression/tools/live/test_lttng_kernel b/tests/regression/tools/live/test_lttng_kernel | ||
| 552 | index a23d937..1b93364 100755 | ||
| 553 | --- a/tests/regression/tools/live/test_lttng_kernel | ||
| 554 | +++ b/tests/regression/tools/live/test_lttng_kernel | ||
| 555 | @@ -45,13 +45,7 @@ function clean_live_tracing() | ||
| 556 | } | ||
| 557 | |||
| 558 | # Need root access for kernel tracing. | ||
| 559 | -if [ "$(id -u)" == "0" ]; then | ||
| 560 | - isroot=1 | ||
| 561 | -else | ||
| 562 | - isroot=0 | ||
| 563 | -fi | ||
| 564 | - | ||
| 565 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
| 566 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 567 | { | ||
| 568 | modprobe lttng-test | ||
| 569 | |||
| 570 | diff --git a/tests/regression/tools/metadata/test_kernel b/tests/regression/tools/metadata/test_kernel | ||
| 571 | index 57cace6..26e95d9 100755 | ||
| 572 | --- a/tests/regression/tools/metadata/test_kernel | ||
| 573 | +++ b/tests/regression/tools/metadata/test_kernel | ||
| 574 | @@ -91,13 +91,7 @@ plan_tests $NUM_TESTS | ||
| 575 | print_test_banner "$TEST_DESC" | ||
| 576 | |||
| 577 | |||
| 578 | -if [ "$(id -u)" == "0" ]; then | ||
| 579 | - isroot=1 | ||
| 580 | -else | ||
| 581 | - isroot=0 | ||
| 582 | -fi | ||
| 583 | - | ||
| 584 | -skip $isroot "Root access is needed. Skipping all kernel metadata tests." $NUM_TESTS || | ||
| 585 | +check_skip_kernel_test "$NUM_TESTS" "Skipping kernel metadata tests." || | ||
| 586 | { | ||
| 587 | validate_lttng_modules_present | ||
| 588 | modprobe lttng-test | ||
| 589 | diff --git a/tests/regression/tools/notification/test_notification_kernel_buffer_usage b/tests/regression/tools/notification/test_notification_kernel_buffer_usage | ||
| 590 | index 76e69a7..8fdaabb 100755 | ||
| 591 | --- a/tests/regression/tools/notification/test_notification_kernel_buffer_usage | ||
| 592 | +++ b/tests/regression/tools/notification/test_notification_kernel_buffer_usage | ||
| 593 | @@ -60,29 +60,27 @@ function test_buffer_usage_notification | ||
| 594 | wait $APP_PID 2> /dev/null | ||
| 595 | } | ||
| 596 | |||
| 597 | -if [ "$(id -u)" == "0" ]; then | ||
| 598 | - | ||
| 599 | - validate_lttng_modules_present | ||
| 600 | - | ||
| 601 | +check_skip_kernel_test && | ||
| 602 | +{ | ||
| 603 | + plan_skip_all "Skipping all tests." | ||
| 604 | + rm -rf "$TEST_TMPDIR" | ||
| 605 | + exit 0 | ||
| 606 | +} | ||
| 607 | |||
| 608 | - modprobe lttng-test | ||
| 609 | +validate_lttng_modules_present | ||
| 610 | |||
| 611 | - # Used on sessiond launch. | ||
| 612 | - LTTNG_SESSIOND_ENV_VARS="LTTNG_TESTPOINT_ENABLE=1 \ | ||
| 613 | - CONSUMER_PAUSE_PIPE_PATH=${TESTPOINT_PIPE_PATH} \ | ||
| 614 | - LD_PRELOAD=${TESTPOINT}" | ||
| 615 | - start_lttng_sessiond_notap | ||
| 616 | +modprobe lttng-test | ||
| 617 | |||
| 618 | - test_buffer_usage_notification | ||
| 619 | +# Used on sessiond launch. | ||
| 620 | +LTTNG_SESSIOND_ENV_VARS="LTTNG_TESTPOINT_ENABLE=1 \ | ||
| 621 | + CONSUMER_PAUSE_PIPE_PATH=${TESTPOINT_PIPE_PATH} \ | ||
| 622 | + LD_PRELOAD=${TESTPOINT}" | ||
| 623 | +start_lttng_sessiond_notap | ||
| 624 | |||
| 625 | - stop_lttng_sessiond_notap | ||
| 626 | - rmmod lttng-test | ||
| 627 | +test_buffer_usage_notification | ||
| 628 | |||
| 629 | - rm -rf "${consumerd_pipe[@]}" 2> /dev/null | ||
| 630 | -else | ||
| 631 | - # Kernel tests are skipped. | ||
| 632 | - plan_tests $NUM_TESTS | ||
| 633 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
| 634 | -fi | ||
| 635 | +stop_lttng_sessiond_notap | ||
| 636 | +rmmod lttng-test | ||
| 637 | |||
| 638 | +rm -rf "${consumerd_pipe[@]}" 2> /dev/null | ||
| 639 | rm -rf "$TEST_TMPDIR" | ||
| 640 | diff --git a/tests/regression/tools/notification/test_notification_kernel_capture b/tests/regression/tools/notification/test_notification_kernel_capture | ||
| 641 | index 88f123d..0f8a2bc 100755 | ||
| 642 | --- a/tests/regression/tools/notification/test_notification_kernel_capture | ||
| 643 | +++ b/tests/regression/tools/notification/test_notification_kernel_capture | ||
| 644 | @@ -31,22 +31,21 @@ function test_basic_error_path | ||
| 645 | } | ||
| 646 | |||
| 647 | |||
| 648 | -if [ "$(id -u)" == "0" ]; then | ||
| 649 | - validate_lttng_modules_present | ||
| 650 | +check_skip_kernel_test && | ||
| 651 | +{ | ||
| 652 | + plan_skip_all "Skipping all tests." | ||
| 653 | + exit 0 | ||
| 654 | +} | ||
| 655 | |||
| 656 | - modprobe lttng-test | ||
| 657 | +validate_lttng_modules_present | ||
| 658 | |||
| 659 | - start_lttng_sessiond_notap | ||
| 660 | +modprobe lttng-test | ||
| 661 | |||
| 662 | - test_basic_error_path | ||
| 663 | +start_lttng_sessiond_notap | ||
| 664 | |||
| 665 | - stop_lttng_sessiond_notap | ||
| 666 | - rmmod lttng-test | ||
| 667 | +test_basic_error_path | ||
| 668 | |||
| 669 | -else | ||
| 670 | - # Kernel tests are skipped. | ||
| 671 | - plan_tests $NUM_TESTS | ||
| 672 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
| 673 | -fi | ||
| 674 | +stop_lttng_sessiond_notap | ||
| 675 | +rmmod lttng-test | ||
| 676 | |||
| 677 | rm -f "$TESTAPP_STATE_PATH" | ||
| 678 | diff --git a/tests/regression/tools/notification/test_notification_kernel_error b/tests/regression/tools/notification/test_notification_kernel_error | ||
| 679 | index 80fe6e5..b757ec2 100755 | ||
| 680 | --- a/tests/regression/tools/notification/test_notification_kernel_error | ||
| 681 | +++ b/tests/regression/tools/notification/test_notification_kernel_error | ||
| 682 | @@ -30,23 +30,22 @@ function test_basic_error_path | ||
| 683 | wait $APP_PID 2> /dev/null | ||
| 684 | } | ||
| 685 | |||
| 686 | +check_skip_kernel_test && | ||
| 687 | +{ | ||
| 688 | + plan_skip_all "Skipping all tests." | ||
| 689 | + exit 0 | ||
| 690 | +} | ||
| 691 | |||
| 692 | -if [ "$(id -u)" == "0" ]; then | ||
| 693 | - validate_lttng_modules_present | ||
| 694 | +validate_lttng_modules_present | ||
| 695 | |||
| 696 | - modprobe lttng-test | ||
| 697 | +modprobe lttng-test | ||
| 698 | |||
| 699 | - start_lttng_sessiond_notap | ||
| 700 | +start_lttng_sessiond_notap | ||
| 701 | |||
| 702 | - test_basic_error_path | ||
| 703 | +test_basic_error_path | ||
| 704 | |||
| 705 | - stop_lttng_sessiond_notap | ||
| 706 | - rmmod lttng-test | ||
| 707 | +stop_lttng_sessiond_notap | ||
| 708 | +rmmod lttng-test | ||
| 709 | |||
| 710 | -else | ||
| 711 | - # Kernel tests are skipped. | ||
| 712 | - plan_tests $NUM_TESTS | ||
| 713 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
| 714 | -fi | ||
| 715 | |||
| 716 | rm -f "$TESTAPP_STATE_PATH" | ||
| 717 | diff --git a/tests/regression/tools/notification/test_notification_kernel_instrumentation b/tests/regression/tools/notification/test_notification_kernel_instrumentation | ||
| 718 | index 90545a5..705f770 100755 | ||
| 719 | --- a/tests/regression/tools/notification/test_notification_kernel_instrumentation | ||
| 720 | +++ b/tests/regression/tools/notification/test_notification_kernel_instrumentation | ||
| 721 | @@ -28,22 +28,21 @@ function test_kernel_instrumentation_notification | ||
| 722 | wait $APP_PID 2> /dev/null | ||
| 723 | } | ||
| 724 | |||
| 725 | -if [ "$(id -u)" == "0" ]; then | ||
| 726 | - validate_lttng_modules_present | ||
| 727 | +check_skip_kernel_test && | ||
| 728 | +{ | ||
| 729 | + plan_skip_all "Skipping all tests." | ||
| 730 | + exit 0 | ||
| 731 | +} | ||
| 732 | |||
| 733 | - modprobe lttng-test | ||
| 734 | +validate_lttng_modules_present | ||
| 735 | |||
| 736 | - start_lttng_sessiond_notap | ||
| 737 | +modprobe lttng-test | ||
| 738 | |||
| 739 | - test_kernel_instrumentation_notification | ||
| 740 | +start_lttng_sessiond_notap | ||
| 741 | |||
| 742 | - stop_lttng_sessiond_notap | ||
| 743 | - rmmod lttng-test | ||
| 744 | +test_kernel_instrumentation_notification | ||
| 745 | |||
| 746 | -else | ||
| 747 | - # Kernel tests are skipped. | ||
| 748 | - plan_tests $NUM_TESTS | ||
| 749 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
| 750 | -fi | ||
| 751 | +stop_lttng_sessiond_notap | ||
| 752 | +rmmod lttng-test | ||
| 753 | |||
| 754 | rm -f "$TESTAPP_STATE_PATH" | ||
| 755 | diff --git a/tests/regression/tools/notification/test_notification_kernel_syscall b/tests/regression/tools/notification/test_notification_kernel_syscall | ||
| 756 | index d273cb5..7fa2353 100755 | ||
| 757 | --- a/tests/regression/tools/notification/test_notification_kernel_syscall | ||
| 758 | +++ b/tests/regression/tools/notification/test_notification_kernel_syscall | ||
| 759 | @@ -31,19 +31,18 @@ function test_kernel_syscall_notification | ||
| 760 | wait $APP_PID 2> /dev/null | ||
| 761 | } | ||
| 762 | |||
| 763 | -if [ "$(id -u)" == "0" ]; then | ||
| 764 | - validate_lttng_modules_present | ||
| 765 | +check_skip_kernel_test && | ||
| 766 | +{ | ||
| 767 | + plan_skip_all "Skipping all tests." | ||
| 768 | + exit 0 | ||
| 769 | +} | ||
| 770 | |||
| 771 | - start_lttng_sessiond_notap | ||
| 772 | +validate_lttng_modules_present | ||
| 773 | |||
| 774 | - test_kernel_syscall_notification | ||
| 775 | +start_lttng_sessiond_notap | ||
| 776 | |||
| 777 | - stop_lttng_sessiond_notap | ||
| 778 | +test_kernel_syscall_notification | ||
| 779 | |||
| 780 | -else | ||
| 781 | - # Kernel tests are skipped. | ||
| 782 | - plan_tests $NUM_TESTS | ||
| 783 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
| 784 | -fi | ||
| 785 | +stop_lttng_sessiond_notap | ||
| 786 | |||
| 787 | rm -f "$TESTAPP_STATE_PATH" | ||
| 788 | diff --git a/tests/regression/tools/notification/test_notification_kernel_userspace_probe b/tests/regression/tools/notification/test_notification_kernel_userspace_probe | ||
| 789 | index 8ef8d70..abddd9b 100755 | ||
| 790 | --- a/tests/regression/tools/notification/test_notification_kernel_userspace_probe | ||
| 791 | +++ b/tests/regression/tools/notification/test_notification_kernel_userspace_probe | ||
| 792 | @@ -29,18 +29,18 @@ function test_kernel_userspace_probe_notification | ||
| 793 | wait $APP_PID 2> /dev/null | ||
| 794 | } | ||
| 795 | |||
| 796 | -if [ "$(id -u)" == "0" ]; then | ||
| 797 | - validate_lttng_modules_present | ||
| 798 | +check_skip_kernel_test && | ||
| 799 | +{ | ||
| 800 | + plan_skip_all "Skipping all tests." | ||
| 801 | + exit 0 | ||
| 802 | +} | ||
| 803 | + | ||
| 804 | +validate_lttng_modules_present | ||
| 805 | |||
| 806 | - start_lttng_sessiond_notap | ||
| 807 | +start_lttng_sessiond_notap | ||
| 808 | |||
| 809 | - test_kernel_userspace_probe_notification | ||
| 810 | +test_kernel_userspace_probe_notification | ||
| 811 | |||
| 812 | - stop_lttng_sessiond_notap | ||
| 813 | -else | ||
| 814 | - # Kernel tests are skipped. | ||
| 815 | - plan_tests $NUM_TESTS | ||
| 816 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
| 817 | -fi | ||
| 818 | +stop_lttng_sessiond_notap | ||
| 819 | |||
| 820 | rm -f "$TESTAPP_STATE_PATH" | ||
| 821 | diff --git a/tests/regression/tools/notification/test_notification_multi_app b/tests/regression/tools/notification/test_notification_multi_app | ||
| 822 | index d8b6392..61891b5 100755 | ||
| 823 | --- a/tests/regression/tools/notification/test_notification_multi_app | ||
| 824 | +++ b/tests/regression/tools/notification/test_notification_multi_app | ||
| 825 | @@ -411,22 +411,18 @@ function test_on_register_evaluation () | ||
| 826 | rm -rf "$output_dir" | ||
| 827 | } | ||
| 828 | |||
| 829 | - | ||
| 830 | TESTS=( | ||
| 831 | test_multi_app_ust | ||
| 832 | test_on_register_evaluation_ust | ||
| 833 | ) | ||
| 834 | |||
| 835 | -if [ "$(id -u)" == "0" ]; then | ||
| 836 | +check_skip_kernel_test "$NUM_TEST_KERNEL" "Skipping kernel multi-app notification tests." || { | ||
| 837 | validate_lttng_modules_present | ||
| 838 | TESTS+=( | ||
| 839 | - test_multi_app_kernel | ||
| 840 | - test_on_register_evaluation_kernel | ||
| 841 | -) | ||
| 842 | -else | ||
| 843 | - skip 0 "Root access is needed. Skipping all kernel multi-app notification tests." $NUM_TEST_KERNEL | ||
| 844 | -fi | ||
| 845 | - | ||
| 846 | + test_multi_app_kernel | ||
| 847 | + test_on_register_evaluation_kernel | ||
| 848 | + ) | ||
| 849 | +} | ||
| 850 | |||
| 851 | for fct_test in ${TESTS[@]}; | ||
| 852 | do | ||
| 853 | diff --git a/tests/regression/tools/notification/test_notification_notifier_discarded_count b/tests/regression/tools/notification/test_notification_notifier_discarded_count | ||
| 854 | index 9850b49..778d37d 100755 | ||
| 855 | --- a/tests/regression/tools/notification/test_notification_notifier_discarded_count | ||
| 856 | +++ b/tests/regression/tools/notification/test_notification_notifier_discarded_count | ||
| 857 | @@ -376,7 +376,8 @@ function test_ust_notifier_discarded_regardless_trigger_owner | ||
| 858 | test_ust_notifier_discarded_count | ||
| 859 | test_ust_notifier_discarded_count_max_bucket | ||
| 860 | |||
| 861 | -if [ "$(id -u)" == "0" ]; then | ||
| 862 | +check_skip_kernel_test "$KERNEL_NUM_TESTS" "Skipping kernel notification tests." || | ||
| 863 | +{ | ||
| 864 | |||
| 865 | validate_lttng_modules_present | ||
| 866 | |||
| 867 | @@ -398,9 +399,7 @@ if [ "$(id -u)" == "0" ]; then | ||
| 868 | modprobe --remove lttng-test | ||
| 869 | |||
| 870 | rm -rf "${sessiond_pipe[@]}" 2> /dev/null | ||
| 871 | -else | ||
| 872 | - # Kernel tests are skipped. | ||
| 873 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $KERNEL_NUM_TESTS | ||
| 874 | -fi | ||
| 875 | + | ||
| 876 | +} | ||
| 877 | |||
| 878 | rm -rf "$TEST_TMPDIR" | ||
| 879 | diff --git a/tests/regression/tools/regen-metadata/test_kernel b/tests/regression/tools/regen-metadata/test_kernel | ||
| 880 | index 49eea32..555a4e2 100755 | ||
| 881 | --- a/tests/regression/tools/regen-metadata/test_kernel | ||
| 882 | +++ b/tests/regression/tools/regen-metadata/test_kernel | ||
| 883 | @@ -99,13 +99,7 @@ plan_tests $NUM_TESTS | ||
| 884 | |||
| 885 | print_test_banner "$TEST_DESC" | ||
| 886 | |||
| 887 | -if [ "$(id -u)" == "0" ]; then | ||
| 888 | - isroot=1 | ||
| 889 | -else | ||
| 890 | - isroot=0 | ||
| 891 | -fi | ||
| 892 | - | ||
| 893 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
| 894 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 895 | { | ||
| 896 | validate_lttng_modules_present | ||
| 897 | |||
| 898 | diff --git a/tests/regression/tools/regen-statedump/test_kernel b/tests/regression/tools/regen-statedump/test_kernel | ||
| 899 | index 8a26135..bbbac39 100755 | ||
| 900 | --- a/tests/regression/tools/regen-statedump/test_kernel | ||
| 901 | +++ b/tests/regression/tools/regen-statedump/test_kernel | ||
| 902 | @@ -39,13 +39,7 @@ plan_tests $NUM_TESTS | ||
| 903 | |||
| 904 | print_test_banner "$TEST_DESC" | ||
| 905 | |||
| 906 | -if [ "$(id -u)" == "0" ]; then | ||
| 907 | - isroot=1 | ||
| 908 | -else | ||
| 909 | - isroot=0 | ||
| 910 | -fi | ||
| 911 | - | ||
| 912 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
| 913 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 914 | { | ||
| 915 | validate_lttng_modules_present | ||
| 916 | start_lttng_sessiond | ||
| 917 | diff --git a/tests/regression/tools/rotation/test_kernel b/tests/regression/tools/rotation/test_kernel | ||
| 918 | index f5f1f55..efe3fd3 100755 | ||
| 919 | --- a/tests/regression/tools/rotation/test_kernel | ||
| 920 | +++ b/tests/regression/tools/rotation/test_kernel | ||
| 921 | @@ -82,13 +82,7 @@ plan_tests $NUM_TESTS | ||
| 922 | |||
| 923 | print_test_banner "$TEST_DESC" | ||
| 924 | |||
| 925 | -if [ "$(id -u)" == "0" ]; then | ||
| 926 | - isroot=1 | ||
| 927 | -else | ||
| 928 | - isroot=0 | ||
| 929 | -fi | ||
| 930 | - | ||
| 931 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
| 932 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 933 | { | ||
| 934 | validate_lttng_modules_present | ||
| 935 | |||
| 936 | diff --git a/tests/regression/tools/snapshots/test_kernel b/tests/regression/tools/snapshots/test_kernel | ||
| 937 | index abb2435..d918768 100755 | ||
| 938 | --- a/tests/regression/tools/snapshots/test_kernel | ||
| 939 | +++ b/tests/regression/tools/snapshots/test_kernel | ||
| 940 | @@ -217,13 +217,7 @@ plan_tests $NUM_TESTS | ||
| 941 | |||
| 942 | print_test_banner "$TEST_DESC" | ||
| 943 | |||
| 944 | -if [ "$(id -u)" == "0" ]; then | ||
| 945 | - isroot=1 | ||
| 946 | -else | ||
| 947 | - isroot=0 | ||
| 948 | -fi | ||
| 949 | - | ||
| 950 | -skip $isroot "Root access is needed. Skipping all kernel snapshot tests" $NUM_TESTS || | ||
| 951 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 952 | { | ||
| 953 | |||
| 954 | validate_lttng_modules_present | ||
| 955 | diff --git a/tests/regression/tools/snapshots/test_kernel_streaming b/tests/regression/tools/snapshots/test_kernel_streaming | ||
| 956 | index 0c92dc7..dd965af 100755 | ||
| 957 | --- a/tests/regression/tools/snapshots/test_kernel_streaming | ||
| 958 | +++ b/tests/regression/tools/snapshots/test_kernel_streaming | ||
| 959 | @@ -145,13 +145,7 @@ plan_tests $NUM_TESTS | ||
| 960 | |||
| 961 | print_test_banner "$TEST_DESC" | ||
| 962 | |||
| 963 | -if [ "$(id -u)" == "0" ]; then | ||
| 964 | - isroot=1 | ||
| 965 | -else | ||
| 966 | - isroot=0 | ||
| 967 | -fi | ||
| 968 | - | ||
| 969 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests" $NUM_TESTS || | ||
| 970 | +check_skip_kernel_test $NUM_TESTS "Skipping all tests." || | ||
| 971 | { | ||
| 972 | validate_lttng_modules_present | ||
| 973 | |||
| 974 | diff --git a/tests/regression/tools/streaming/test_high_throughput_limits b/tests/regression/tools/streaming/test_high_throughput_limits | ||
| 975 | index 2b9e3ad..c55d510 100755 | ||
| 976 | --- a/tests/regression/tools/streaming/test_high_throughput_limits | ||
| 977 | +++ b/tests/regression/tools/streaming/test_high_throughput_limits | ||
| 978 | @@ -170,13 +170,7 @@ plan_tests $NUM_TESTS | ||
| 979 | |||
| 980 | print_test_banner "$TEST_DESC" | ||
| 981 | |||
| 982 | -if [ "$(id -u)" == "0" ]; then | ||
| 983 | - isroot=1 | ||
| 984 | -else | ||
| 985 | - isroot=0 | ||
| 986 | -fi | ||
| 987 | - | ||
| 988 | -skip $isroot "Root access is needed to set bandwith limits. Skipping all tests." $NUM_TESTS || | ||
| 989 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 990 | { | ||
| 991 | |||
| 992 | # Catch sigint and try to cleanup limits | ||
| 993 | diff --git a/tests/regression/tools/streaming/test_kernel b/tests/regression/tools/streaming/test_kernel | ||
| 994 | index 3333422..113eea7 100755 | ||
| 995 | --- a/tests/regression/tools/streaming/test_kernel | ||
| 996 | +++ b/tests/regression/tools/streaming/test_kernel | ||
| 997 | @@ -47,13 +47,7 @@ plan_tests $NUM_TESTS | ||
| 998 | |||
| 999 | print_test_banner "$TEST_DESC" | ||
| 1000 | |||
| 1001 | -if [ "$(id -u)" == "0" ]; then | ||
| 1002 | - isroot=1 | ||
| 1003 | -else | ||
| 1004 | - isroot=0 | ||
| 1005 | -fi | ||
| 1006 | - | ||
| 1007 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
| 1008 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
| 1009 | { | ||
| 1010 | validate_lttng_modules_present | ||
| 1011 | |||
| 1012 | diff --git a/tests/regression/tools/tracker/test_event_tracker b/tests/regression/tools/tracker/test_event_tracker | ||
| 1013 | index cc0f698..de0c79d 100755 | ||
| 1014 | --- a/tests/regression/tools/tracker/test_event_tracker | ||
| 1015 | +++ b/tests/regression/tools/tracker/test_event_tracker | ||
| 1016 | @@ -466,13 +466,7 @@ test_event_track_untrack ust 0 "${EVENT_NAME}" "--pid --all" # backward compat | ||
| 1017 | test_event_tracker ust 1 "${EVENT_NAME}" "--pid --all" # backward compat | ||
| 1018 | test_event_pid_tracker ust 1 "${EVENT_NAME}" | ||
| 1019 | |||
| 1020 | -if [ "$(id -u)" == "0" ]; then | ||
| 1021 | - isroot=1 | ||
| 1022 | -else | ||
| 1023 | - isroot=0 | ||
| 1024 | -fi | ||
| 1025 | - | ||
| 1026 | -skip $isroot "Root access is needed. Skipping all kernel tracker tests." $NUM_KERNEL_TESTS || | ||
| 1027 | +check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel tracker tests." || | ||
| 1028 | { | ||
| 1029 | diag "Test kernel tracker" | ||
| 1030 | |||
| 1031 | diff --git a/tests/regression/tools/trigger/test_add_trigger_cli b/tests/regression/tools/trigger/test_add_trigger_cli | ||
| 1032 | index 98ecf62..d1763aa 100755 | ||
| 1033 | --- a/tests/regression/tools/trigger/test_add_trigger_cli | ||
| 1034 | +++ b/tests/regression/tools/trigger/test_add_trigger_cli | ||
| 1035 | @@ -34,12 +34,6 @@ tmp_stdout=$(mktemp --tmpdir -t test_parse_cli_trigger_stdout.XXXXXX) | ||
| 1036 | tmp_stderr=$(mktemp --tmpdir -t test_parse_cli_trigger_stderr.XXXXXX) | ||
| 1037 | uprobe_elf_binary="${TESTDIR}/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary" | ||
| 1038 | |||
| 1039 | -if [ "$(id -u)" == "0" ]; then | ||
| 1040 | - ist_root=1 | ||
| 1041 | -else | ||
| 1042 | - ist_root=0 | ||
| 1043 | -fi | ||
| 1044 | - | ||
| 1045 | function test_success () | ||
| 1046 | { | ||
| 1047 | local test_name="$1" | ||
| 1048 | @@ -223,7 +217,7 @@ test_success "--exclude-name two" "trigger5" \ | ||
| 1049 | --condition event-rule-matches --type=user --name='jean-*' --exclude-name jean-chretien -x jean-charest \ | ||
| 1050 | --action notify | ||
| 1051 | |||
| 1052 | -skip $ist_root "non-root user: skipping kprobe tests" 18 || { | ||
| 1053 | +check_skip_kernel_test 18 "Skipping kprobe tests." || { | ||
| 1054 | i=0 | ||
| 1055 | |||
| 1056 | for type in kprobe kernel:kprobe; do | ||
| 1057 | @@ -262,7 +256,7 @@ skip $ist_root "non-root user: skipping kprobe tests" 18 || { | ||
| 1058 | done | ||
| 1059 | } | ||
| 1060 | |||
| 1061 | -skip $ist_root "non-root user: skipping uprobe tests" 6 || { | ||
| 1062 | +check_skip_kernel_test 6 "Skipping uprobe tests." || { | ||
| 1063 | test_success "--condition event-rule-matches uprobe" "uprobe-trigger-0" \ | ||
| 1064 | --name="uprobe-trigger-0" \ | ||
| 1065 | --condition event-rule-matches --type=kernel:uprobe --location=${uprobe_elf_binary}:test_function --event-name=ma-probe \ | ||
| 1066 | @@ -274,7 +268,7 @@ skip $ist_root "non-root user: skipping uprobe tests" 6 || { | ||
| 1067 | --action notify | ||
| 1068 | } | ||
| 1069 | |||
| 1070 | -skip $ist_root "non-root user: skipping syscall tests" 30 || { | ||
| 1071 | +check_skip_kernel_test 30 "Skipping syscall tests." || { | ||
| 1072 | test_success "--condition event-rule-matches one syscall" "syscall-trigger-0" \ | ||
| 1073 | --name="syscall-trigger-0" \ | ||
| 1074 | --condition event-rule-matches --type=syscall --name=open \ | ||
| 1075 | diff --git a/tests/regression/tools/trigger/test_list_triggers_cli b/tests/regression/tools/trigger/test_list_triggers_cli | ||
| 1076 | index 2574e15..652a08c 100755 | ||
| 1077 | --- a/tests/regression/tools/trigger/test_list_triggers_cli | ||
| 1078 | +++ b/tests/regression/tools/trigger/test_list_triggers_cli | ||
| 1079 | @@ -36,22 +36,12 @@ uprobe_sdt_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-sdt-binar | ||
| 1080 | register_some_triggers_bin=$(realpath "${CURDIR}/utils/register-some-triggers") | ||
| 1081 | |||
| 1082 | uid=$(id --user) | ||
| 1083 | -gid=$(id --group) | ||
| 1084 | |||
| 1085 | -if [ "$uid" == "0" ]; then | ||
| 1086 | - ist_root=1 | ||
| 1087 | - ls "$uprobe_sdt_binary" >/dev/null 2>&1 | ||
| 1088 | - if test $? == 0; then | ||
| 1089 | - hast_sdt_binary=1 | ||
| 1090 | - else | ||
| 1091 | - hast_sdt_binary=0 | ||
| 1092 | - fi | ||
| 1093 | -else | ||
| 1094 | - ist_root=0 | ||
| 1095 | - hast_sdt_binary=0 | ||
| 1096 | +sdt_binary_present=0 | ||
| 1097 | +if [ -f "$uprobe_sdt_binary" ]; then | ||
| 1098 | + sdt_binary_present=1 | ||
| 1099 | fi | ||
| 1100 | |||
| 1101 | - | ||
| 1102 | test_top_level_options () | ||
| 1103 | { | ||
| 1104 | diag "Listing top level options" | ||
| 1105 | @@ -2695,10 +2685,12 @@ start_lttng_sessiond_notap | ||
| 1106 | |||
| 1107 | test_top_level_options | ||
| 1108 | test_event_rule_matches_tracepoint | ||
| 1109 | -skip $ist_root "non-root user: skipping kprobe tests" 13 || test_event_rule_matches_probe | ||
| 1110 | -skip $ist_root "non-root user: skipping uprobe tests" 9 || test_event_rule_matches_userspace_probe_elf | ||
| 1111 | -skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt | ||
| 1112 | -skip $ist_root "non-root user: skipping syscall tests" 17 || test_event_rule_matches_syscall | ||
| 1113 | +check_skip_kernel_test 48 "Skipping kprobe, uprobe, SDT and syscall tests." || { | ||
| 1114 | + test_event_rule_matches_probe | ||
| 1115 | + test_event_rule_matches_userspace_probe_elf | ||
| 1116 | + skip $sdt_binary_present "No SDT binary. Skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt | ||
| 1117 | + test_event_rule_matches_syscall | ||
| 1118 | +} | ||
| 1119 | test_session_consumed_size_condition | ||
| 1120 | test_buffer_usage_conditions | ||
| 1121 | test_session_rotation_conditions | ||
| 1122 | diff --git a/tests/regression/tools/wildcard/test_event_wildcard b/tests/regression/tools/wildcard/test_event_wildcard | ||
| 1123 | index f69baff..14d9bb8 100755 | ||
| 1124 | --- a/tests/regression/tools/wildcard/test_event_wildcard | ||
| 1125 | +++ b/tests/regression/tools/wildcard/test_event_wildcard | ||
| 1126 | @@ -124,13 +124,7 @@ test_event_wildcard ust 1 'tp*tptest' | ||
| 1127 | test_event_wildcard ust 1 'tp**tptest' | ||
| 1128 | test_event_wildcard ust 1 'tp*test' | ||
| 1129 | |||
| 1130 | -if [ "$(id -u)" == "0" ]; then | ||
| 1131 | - isroot=1 | ||
| 1132 | -else | ||
| 1133 | - isroot=0 | ||
| 1134 | -fi | ||
| 1135 | - | ||
| 1136 | -skip $isroot "Root access is needed. Skipping all kernel wildcard tests." $NUM_KERNEL_TESTS || | ||
| 1137 | +check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel wildcard tests." || | ||
| 1138 | { | ||
| 1139 | diag "Test kernel wildcards" | ||
| 1140 | |||
| 1141 | diff --git a/tests/regression/tools/working-directory/test_relayd_working_directory b/tests/regression/tools/working-directory/test_relayd_working_directory | ||
| 1142 | index c7e784c..6bd1e50 100755 | ||
| 1143 | --- a/tests/regression/tools/working-directory/test_relayd_working_directory | ||
| 1144 | +++ b/tests/regression/tools/working-directory/test_relayd_working_directory | ||
| 1145 | @@ -145,9 +145,9 @@ function test_relayd_debug_permission() | ||
| 1146 | diag "Test lttng-relayd change working directory on non writable directory" | ||
| 1147 | |||
| 1148 | if [ "$(id -u)" == "0" ]; then | ||
| 1149 | - is_user=0 | ||
| 1150 | + is_user=0 | ||
| 1151 | else | ||
| 1152 | - is_user=1 | ||
| 1153 | + is_user=1 | ||
| 1154 | fi | ||
| 1155 | |||
| 1156 | skip $is_user "Skipping permission debug output test; operation can't fail as root" 6 || | ||
| 1157 | diff --git a/tests/regression/ust/namespaces/test_ns_contexts_change b/tests/regression/ust/namespaces/test_ns_contexts_change | ||
| 1158 | index 8a4b62c..622241f 100755 | ||
| 1159 | --- a/tests/regression/ust/namespaces/test_ns_contexts_change | ||
| 1160 | +++ b/tests/regression/ust/namespaces/test_ns_contexts_change | ||
| 1161 | @@ -101,12 +101,7 @@ plan_tests $NUM_TESTS | ||
| 1162 | |||
| 1163 | print_test_banner "$TEST_DESC" | ||
| 1164 | |||
| 1165 | -isroot=0 | ||
| 1166 | -if [ "$(id -u)" == "0" ]; then | ||
| 1167 | - isroot=1 | ||
| 1168 | -fi | ||
| 1169 | - | ||
| 1170 | -skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" && exit 0 | ||
| 1171 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." && exit 0 | ||
| 1172 | |||
| 1173 | system_has_ns=0 | ||
| 1174 | if [ -d "/proc/$$/ns" ]; then | ||
| 1175 | diff --git a/tests/regression/ust/test_event_perf b/tests/regression/ust/test_event_perf | ||
| 1176 | index 33aab29..178959a 100755 | ||
| 1177 | --- a/tests/regression/ust/test_event_perf | ||
| 1178 | +++ b/tests/regression/ust/test_event_perf | ||
| 1179 | @@ -119,17 +119,11 @@ plan_tests $NUM_TESTS | ||
| 1180 | |||
| 1181 | print_test_banner "$TEST_DESC" | ||
| 1182 | |||
| 1183 | -if [ "$(id -u)" == "0" ]; then | ||
| 1184 | - isroot=1 | ||
| 1185 | -else | ||
| 1186 | - isroot=0 | ||
| 1187 | -fi | ||
| 1188 | - | ||
| 1189 | start_lttng_sessiond | ||
| 1190 | |||
| 1191 | test_parsing_raw | ||
| 1192 | |||
| 1193 | -skip $isroot "Root access is needed. Skipping UST perf tests." 8 || | ||
| 1194 | +check_skip_kernel_test 8 "Skipping UST perf tests." || | ||
| 1195 | { | ||
| 1196 | test_event_basic | ||
| 1197 | } | ||
| 1198 | diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh | ||
| 1199 | index 35633fa..b6783ef 100644 | ||
| 1200 | --- a/tests/utils/utils.sh | ||
| 1201 | +++ b/tests/utils/utils.sh | ||
| 1202 | @@ -329,6 +329,41 @@ function conf_proc_count() | ||
| 1203 | echo | ||
| 1204 | } | ||
| 1205 | |||
| 1206 | +# Usage: | ||
| 1207 | +# check_skip_kernel_test [NB_TESTS] [SKIP_MESSAGE] | ||
| 1208 | +# Return 0 if LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set or the current user is not a root user | ||
| 1209 | +# If NB_TESTS is set, call skip() to skip number of tests. | ||
| 1210 | +# If NB_TESTS is empty, just output a reason with diag. | ||
| 1211 | +# An optional message can be added. | ||
| 1212 | + | ||
| 1213 | +function check_skip_kernel_test () | ||
| 1214 | +{ | ||
| 1215 | + local num_tests="$1" | ||
| 1216 | + local skip_message="$2" | ||
| 1217 | + | ||
| 1218 | + # Check for skip test kernel flag | ||
| 1219 | + if [ "$LTTNG_TOOLS_DISABLE_KERNEL_TESTS" == "1" ]; then | ||
| 1220 | + if ! test -z "$num_tests"; then | ||
| 1221 | + skip 0 "LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set.${skip_message+ }${skip_message}" "$num_tests" | ||
| 1222 | + else | ||
| 1223 | + diag "LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set.${skip_message+ }${skip_message}" | ||
| 1224 | + fi | ||
| 1225 | + return 0 | ||
| 1226 | + fi | ||
| 1227 | + | ||
| 1228 | + # Check if we are running as root | ||
| 1229 | + if [ "$(id -u)" != "0" ]; then | ||
| 1230 | + if ! test -z "$num_tests"; then | ||
| 1231 | + skip 0 "Root access is needed for kernel testing.${skip_message+ }${skip_message}" "$num_tests" | ||
| 1232 | + else | ||
| 1233 | + diag "Root access is needed for kernel testing.${skip_message+ }${skip_message}" | ||
| 1234 | + fi | ||
| 1235 | + return 0 | ||
| 1236 | + fi | ||
| 1237 | + | ||
| 1238 | + return 1 | ||
| 1239 | +} | ||
| 1240 | + | ||
| 1241 | # Check if base lttng-modules are present. | ||
| 1242 | # Bail out on failure | ||
| 1243 | function validate_lttng_modules_present () | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch index 84c02a02cf..0547f30c02 100644 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch +++ b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 3f1f1dc868accca37d2f276ed741884698b38538 Mon Sep 17 00:00:00 2001 | 1 | From a45157a50e14d4bd244a3dd05d79c5703c819550 Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Thu, 12 Dec 2019 16:52:07 +0100 | 3 | Date: Thu, 12 Dec 2019 16:52:07 +0100 |
| 4 | Subject: [PATCH] tests: do not strip a helper library | 4 | Subject: [PATCH] tests: do not strip a helper library |
diff --git a/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch b/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch index b8971a69de..d32cf87535 100644 --- a/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch +++ b/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 1fbd24512e8fce64b92efa846c301e45a7371ed2 Mon Sep 17 00:00:00 2001 | 1 | From 05cf8ed6cc42a2f6ff53009d0ae2713fe63f1245 Mon Sep 17 00:00:00 2001 |
| 2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | 2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 3 | Date: Tue, 14 Dec 2021 12:34:04 +0000 | 3 | Date: Tue, 14 Dec 2021 12:34:04 +0000 |
| 4 | Subject: [PATCH] lttng-tools: Disable problem tests | 4 | Subject: [PATCH] lttng-tools: Disable problem tests |
| @@ -18,12 +18,12 @@ Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | |||
| 18 | 1 file changed, 12 deletions(-) | 18 | 1 file changed, 12 deletions(-) |
| 19 | 19 | ||
| 20 | diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am | 20 | diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am |
| 21 | index e556223..756fb98 100644 | 21 | index 7076488..e5be904 100644 |
| 22 | --- a/tests/regression/Makefile.am | 22 | --- a/tests/regression/Makefile.am |
| 23 | +++ b/tests/regression/Makefile.am | 23 | +++ b/tests/regression/Makefile.am |
| 24 | @@ -29,18 +29,6 @@ TESTS = tools/base-path/test_ust \ | 24 | @@ -40,18 +40,6 @@ SERIAL_TESTS = tools/base-path/test_ust \ |
| 25 | tools/crash/test_crash \ | ||
| 26 | tools/regen-metadata/test_ust \ | 25 | tools/regen-metadata/test_ust \ |
| 26 | tools/regen-statedump/test_kernel \ | ||
| 27 | tools/regen-statedump/test_ust \ | 27 | tools/regen-statedump/test_ust \ |
| 28 | - tools/notification/test_notification_ust_error \ | 28 | - tools/notification/test_notification_ust_error \ |
| 29 | - tools/notification/test_notification_ust_buffer_usage \ | 29 | - tools/notification/test_notification_ust_buffer_usage \ |
| @@ -39,4 +39,4 @@ index e556223..756fb98 100644 | |||
| 39 | - tools/notification/test_notification_multi_app \ | 39 | - tools/notification/test_notification_multi_app \ |
| 40 | tools/rotation/test_ust \ | 40 | tools/rotation/test_ust \ |
| 41 | tools/rotation/test_kernel \ | 41 | tools/rotation/test_kernel \ |
| 42 | tools/rotation/test_save_load_mi \ | 42 | tools/rotation/test_ust_kernel \ |
diff --git a/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/meta/recipes-kernel/lttng/lttng-tools/run-ptest index 39d93e2bbf..f4f7a3baea 100755 --- a/meta/recipes-kernel/lttng/lttng-tools/run-ptest +++ b/meta/recipes-kernel/lttng/lttng-tools/run-ptest | |||
| @@ -20,7 +20,7 @@ function validate_lttng_modules_present() | |||
| 20 | return 1 | 20 | return 1 |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs | 23 | export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs:FIXMEPTESTPATH/tests/utils/testapp/gen-ust-events-constructor/.libs |
| 24 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=FIXMEPTESTPATH top_builddir=FIXMEPTESTPATH" | 24 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=FIXMEPTESTPATH top_builddir=FIXMEPTESTPATH" |
| 25 | 25 | ||
| 26 | #If current system doesn't have lttng kernel modules, disable lttng kernel related tests. | 26 | #If current system doesn't have lttng kernel modules, disable lttng kernel related tests. |
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.13.15.bb b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb index f39404afa0..66fec08ff3 100644 --- a/meta/recipes-kernel/lttng/lttng-tools_2.13.15.bb +++ b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb | |||
| @@ -12,14 +12,27 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \ | |||
| 12 | 12 | ||
| 13 | include lttng-platforms.inc | 13 | include lttng-platforms.inc |
| 14 | 14 | ||
| 15 | DEPENDS = "liburcu popt libxml2 util-linux bison-native" | 15 | DEPENDS = "liburcu popt libxml2 util-linux bison-native babeltrace2" |
| 16 | RDEPENDS:${PN} = "libgcc" | 16 | RDEPENDS:${PN} = "libgcc" |
| 17 | RRECOMMENDS:${PN} += "${LTTNGMODULES}" | 17 | RRECOMMENDS:${PN} += "${LTTNGMODULES}" |
| 18 | RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep binutils" | 18 | RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep binutils" |
| 19 | RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" | 19 | RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" |
| 20 | RDEPENDS:${PN}-ptest:append:libc-musl = " musl-utils" | 20 | RDEPENDS:${PN}-ptest:append:libc-musl = " musl-utils" |
| 21 | # babelstats.pl wants getopt-long | 21 | # babelstats.pl wants getopt-long |
| 22 | RDEPENDS:${PN}-ptest += "perl-module-getopt-long" | 22 | RDEPENDS:${PN}-ptest += "perl-module-getopt-long \ |
| 23 | babeltrace2 \ | ||
| 24 | lttng-ust-dev \ | ||
| 25 | python3-asyncio \ | ||
| 26 | python3-logging \ | ||
| 27 | python3-math \ | ||
| 28 | python3-numbers \ | ||
| 29 | python3-json \ | ||
| 30 | python3-io \ | ||
| 31 | python3-shell \ | ||
| 32 | python3-xml \ | ||
| 33 | " | ||
| 34 | |||
| 35 | INSANE_SKIP:${PN}-ptest += "dev-deps" | ||
| 23 | 36 | ||
| 24 | PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ | 37 | PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ |
| 25 | am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ | 38 | am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ |
| @@ -36,13 +49,10 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ | |||
| 36 | file://run-ptest \ | 49 | file://run-ptest \ |
| 37 | file://lttng-sessiond.service \ | 50 | file://lttng-sessiond.service \ |
| 38 | file://disable-tests.patch \ | 51 | file://disable-tests.patch \ |
| 39 | file://0001-compat-Define-off64_t-as-off_t-on-linux.patch \ | 52 | file://0001-gen-ust-events-constructor-change-rpath-to-libdir-li.patch \ |
| 40 | file://0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch \ | ||
| 41 | file://0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch \ | ||
| 42 | file://0001-fix-lttng-tools-fails-to-compile-with-libxml2-2.14.0.patch \ | ||
| 43 | " | 53 | " |
| 44 | 54 | ||
| 45 | SRC_URI[sha256sum] = "96ea42351ee112c19dad9fdc7aae93b583d9f1722b2175664a381d2d337703c4" | 55 | SRC_URI[sha256sum] = "d8c39c26cec13b7bd82551cd52a22efc358b888e36ebcf9c1b60ef1c3a3c2fd3" |
| 46 | 56 | ||
| 47 | inherit autotools ptest pkgconfig useradd python3-dir manpages systemd | 57 | inherit autotools ptest pkgconfig useradd python3-dir manpages systemd |
| 48 | 58 | ||
| @@ -80,11 +90,14 @@ do_install_ptest () { | |||
| 80 | tests/regression/tools/save-load/configuration/load-42*.lttng tests/regression/tools/health/test_health.sh \ | 90 | tests/regression/tools/save-load/configuration/load-42*.lttng tests/regression/tools/health/test_health.sh \ |
| 81 | tests/regression/tools/metadata/utils.sh tests/regression/tools/rotation/rotate_utils.sh \ | 91 | tests/regression/tools/metadata/utils.sh tests/regression/tools/rotation/rotate_utils.sh \ |
| 82 | tests/regression/tools/notification/util_event_generator.sh \ | 92 | tests/regression/tools/notification/util_event_generator.sh \ |
| 93 | tests/regression/tools/trace-format/ust-local-trace-pretty.expect \ | ||
| 94 | tests/regression/tools/trace-format/kernel-local-trace-pretty.expect \ | ||
| 83 | tests/regression/tools/base-path/*.lttng; do | 95 | tests/regression/tools/base-path/*.lttng; do |
| 84 | install -D "${B}/$f" "${D}${PTEST_PATH}/$f" | 96 | install -D "${B}/$f" "${D}${PTEST_PATH}/$f" |
| 85 | done | 97 | done |
| 86 | 98 | ||
| 87 | for f in tests/utils/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-4.1.xsd; do | 99 | for f in tests/utils/tap-driver.sh config/test-driver src/common/session.xsd src/common/mi-lttng-4.1.xsd \ |
| 100 | tests/regression/tests.serial; do | ||
| 88 | install -D "${S}/$f" "${D}${PTEST_PATH}/$f" | 101 | install -D "${S}/$f" "${D}${PTEST_PATH}/$f" |
| 89 | done | 102 | done |
| 90 | 103 | ||
