diff options
author | Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> | 2019-04-04 21:47:40 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-05 17:32:50 +0100 |
commit | 8e9a0fe61f0ccdad8d88ecf8f46ae90c0c73da97 (patch) | |
tree | 01d9bf650a0d9b5524eb7eed975a2957db8ff501 /meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch | |
parent | bb1940a0d65660a967b1f126ce3cbd89314d1e3b (diff) | |
download | poky-8e9a0fe61f0ccdad8d88ecf8f46ae90c0c73da97.tar.gz |
lttng-tools: improve ptest and test suite
Multiple patches are to be applied to improve the current ptest suite.
0001-Fix-tests-link-libpause_consumer-on-liblttng-ctl.patch
0002-Fix-test-skip-test_getcpu_override-on-single-thread-.patch
0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch
0006-Tests-check-for-lttng-modules-presence.patch
All deal with problem in the test suite. Most of these are already
accepted upstream and will be removed on the next recipe update.
0004-Skip-when-testapp-is-not-present.patch
Is a OE specific fix that make sure that we skip the test if
the test util application (event generator) is not present. We are
still unsure on how (upstream) we are going to solve this problem. We
already have this problem if a user build lttng without lttng-ust
(--without-lttng-ust). We will most probably end up splitting each test
into kernel and userspace tests and adjust the makefile accordingly.
Another option is to probe lttng for enabled function at runtime.
0005-Tests-use-modprobe-to-test-for-the-presence-of-lttng.patch
Is a requirement for 0006 that should be accepted upstream shorlty.
0007-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch
Fixes a race found while testing OE built with musl. This is a legit
bug. The fixes or a variant should be accepted soon.
(From OE-Core rev: 57db7be54b9ee21b2be33b83782f0636d0702168)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch')
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch b/meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch new file mode 100644 index 0000000000..822b26a367 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch | |||
@@ -0,0 +1,80 @@ | |||
1 | From 83d165442d1c3658b6bafa28ddade8ffee7092ad Mon Sep 17 00:00:00 2001 | ||
2 | From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> | ||
3 | Date: Wed, 6 Mar 2019 16:46:49 -0500 | ||
4 | Subject: [PATCH lttng-tools 2/2] Fix: test: unit: the tree origin can be a | ||
5 | symlink itself | ||
6 | |||
7 | Problem: | ||
8 | |||
9 | The base tree is defined as "/tmp/.....XXXXXX". | ||
10 | On systems where "/tmp/" is itself a symlink utils_expand_path will | ||
11 | expand the tree origin itself. | ||
12 | |||
13 | For example on a base core-image-minimal Yocto build /tmp is a symlink | ||
14 | to "/var/tmp", which is a symlink to "/var/volatile". | ||
15 | |||
16 | utils_expand_path will return something like this for the symlink test: | ||
17 | "/var/volative/.....XXXXXX/...." which is the valid result. | ||
18 | |||
19 | Solution: | ||
20 | |||
21 | Simply use realpath on the tree_origin and use this path to perform the | ||
22 | test validation. | ||
23 | |||
24 | This work was performed in the effort to support yocto fully and be able | ||
25 | to run the test suite to detect problem as early as possible. | ||
26 | |||
27 | |||
28 | Upstream-Status: Accepted [f66e964a2e0c75f5e1a55fbcc963b1c5e2b4519d] | ||
29 | Backported to 2.11 and 2.10 | ||
30 | |||
31 | Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> | ||
32 | --- | ||
33 | tests/unit/test_utils_expand_path.c | 18 ++++++++++++++---- | ||
34 | 1 file changed, 14 insertions(+), 4 deletions(-) | ||
35 | |||
36 | diff --git a/tests/unit/test_utils_expand_path.c b/tests/unit/test_utils_expand_path.c | ||
37 | index d5cab002e..d047c207d 100644 | ||
38 | --- a/tests/unit/test_utils_expand_path.c | ||
39 | +++ b/tests/unit/test_utils_expand_path.c | ||
40 | @@ -281,8 +281,8 @@ error: | ||
41 | static void test_utils_expand_path(void) | ||
42 | { | ||
43 | char *result; | ||
44 | - char name[100], tmppath[PATH_MAX]; | ||
45 | - int i; | ||
46 | + char name[100], tmppath[PATH_MAX], real_tree_origin[PATH_MAX]; | ||
47 | + int i, treelen; | ||
48 | |||
49 | /* Test valid cases */ | ||
50 | for (i = 0; i < num_valid_tests; i++) { | ||
51 | @@ -295,14 +295,24 @@ static void test_utils_expand_path(void) | ||
52 | free(result); | ||
53 | } | ||
54 | |||
55 | + /* | ||
56 | + * Get the realpath for the tree_origin since it can itself be a | ||
57 | + * symlink. | ||
58 | + */ | ||
59 | + result = realpath(tree_origin, real_tree_origin); | ||
60 | + if (!result) { | ||
61 | + fail("realpath failed."); | ||
62 | + return; | ||
63 | + } | ||
64 | + | ||
65 | /* Test symlink tree cases */ | ||
66 | - int treelen = strlen(tree_origin) + 1; | ||
67 | + treelen = strlen(real_tree_origin) + 1; | ||
68 | for (i = 0; i < num_symlink_tests; i++) { | ||
69 | sprintf(name, "symlink tree test case: [tmppath/]%s", | ||
70 | symlink_tests_inputs[i].input); | ||
71 | |||
72 | snprintf(tmppath, PATH_MAX, "%s/%s", | ||
73 | - tree_origin, symlink_tests_inputs[i].input); | ||
74 | + real_tree_origin, symlink_tests_inputs[i].input); | ||
75 | result = utils_expand_path(tmppath); | ||
76 | ok(result != NULL && strcmp(result + treelen, | ||
77 | symlink_tests_inputs[i].expected_result) == 0, name); | ||
78 | -- | ||
79 | 2.17.1 | ||
80 | |||