diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-09 14:25:42 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-10 10:30:39 +0000 |
commit | 618b2ce5cadcbbffa106f1b0df61414ee05a5f04 (patch) | |
tree | 641bff0a89601e9796bcec63f7b22055d18b87e7 | |
parent | 7c8a944c47c1ed1dc4a30ca80ab228c7be17dcce (diff) | |
download | poky-618b2ce5cadcbbffa106f1b0df61414ee05a5f04.tar.gz |
ltp: Fix libswapon issue properly
Replace the libswapon reproducibility workaround with the solution
preferred by upstream.
(From OE-Core rev: 5fc7d4a4c428d5be7103d8e9345d23038dae4247)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 files changed, 502 insertions, 8 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0003-syscalls-swapon-swapoff-Move-common-library-to-libs.patch b/meta/recipes-extended/ltp/ltp/0003-syscalls-swapon-swapoff-Move-common-library-to-libs.patch new file mode 100644 index 0000000000..5ace82dba5 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0003-syscalls-swapon-swapoff-Move-common-library-to-libs.patch | |||
@@ -0,0 +1,133 @@ | |||
1 | From 0653f1d809d0cc13f84facb9d2d82d984ac4d0ac Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
3 | Date: Tue, 9 Mar 2021 15:25:16 +0000 | ||
4 | Subject: [PATCH 3/3] syscalls/swapon/swapoff: Move common library to libs/ | ||
5 | |||
6 | There is a race/determinism issue with libswapon currently as depending on | ||
7 | which makefile path builds it, the debug paths may be "../swapon/libswapon.c" | ||
8 | or "libswapon.c". To avoid the determinism issue, move libswapon to libs/ | ||
9 | and use it from the shared location. | ||
10 | |||
11 | The header is moved to the common includes directory to match and | ||
12 | the Makefile.inc fragment can be dropped. | ||
13 | |||
14 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
15 | Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2021-March/021387.html] | ||
16 | |||
17 | --- | ||
18 | .../kernel/syscalls/swapon => include}/libswapon.h | 0 | ||
19 | libs/libltpswapon/Makefile | 12 ++++++++++++ | ||
20 | .../swapon => libs/libltpswapon}/libswapon.c | 0 | ||
21 | testcases/kernel/syscalls/swapoff/Makefile | 7 +++++-- | ||
22 | testcases/kernel/syscalls/swapoff/Makefile.inc | 6 ------ | ||
23 | testcases/kernel/syscalls/swapoff/swapoff01.c | 2 +- | ||
24 | testcases/kernel/syscalls/swapoff/swapoff02.c | 2 +- | ||
25 | testcases/kernel/syscalls/swapon/Makefile | 6 +++--- | ||
26 | 8 files changed, 22 insertions(+), 13 deletions(-) | ||
27 | rename {testcases/kernel/syscalls/swapon => include}/libswapon.h (100%) | ||
28 | create mode 100644 libs/libltpswapon/Makefile | ||
29 | rename {testcases/kernel/syscalls/swapon => libs/libltpswapon}/libswapon.c (100%) | ||
30 | delete mode 100644 testcases/kernel/syscalls/swapoff/Makefile.inc | ||
31 | |||
32 | diff --git a/testcases/kernel/syscalls/swapon/libswapon.h b/include/libswapon.h | ||
33 | similarity index 100% | ||
34 | rename from testcases/kernel/syscalls/swapon/libswapon.h | ||
35 | rename to include/libswapon.h | ||
36 | diff --git a/libs/libltpswapon/Makefile b/libs/libltpswapon/Makefile | ||
37 | new file mode 100644 | ||
38 | index 000000000..8f738338b | ||
39 | --- /dev/null | ||
40 | +++ b/libs/libltpswapon/Makefile | ||
41 | @@ -0,0 +1,12 @@ | ||
42 | +# SPDX-License-Identifier: GPL-2.0-or-later | ||
43 | +# | ||
44 | +# Copyright (C) Richard Purdie <richard.purdie@linuxfoundation.org> | ||
45 | + | ||
46 | +top_srcdir ?= ../.. | ||
47 | + | ||
48 | +include $(top_srcdir)/include/mk/env_pre.mk | ||
49 | + | ||
50 | +INTERNAL_LIB := libltpswapon.a | ||
51 | + | ||
52 | +include $(top_srcdir)/include/mk/lib.mk | ||
53 | +include $(top_srcdir)/include/mk/generic_leaf_target.mk | ||
54 | diff --git a/testcases/kernel/syscalls/swapon/libswapon.c b/libs/libltpswapon/libswapon.c | ||
55 | similarity index 100% | ||
56 | rename from testcases/kernel/syscalls/swapon/libswapon.c | ||
57 | rename to libs/libltpswapon/libswapon.c | ||
58 | diff --git a/testcases/kernel/syscalls/swapoff/Makefile b/testcases/kernel/syscalls/swapoff/Makefile | ||
59 | index fbfbe0441..a74374605 100644 | ||
60 | --- a/testcases/kernel/syscalls/swapoff/Makefile | ||
61 | +++ b/testcases/kernel/syscalls/swapoff/Makefile | ||
62 | @@ -3,7 +3,10 @@ | ||
63 | |||
64 | top_srcdir ?= ../../../.. | ||
65 | |||
66 | +LTPLIBS = ltpswapon | ||
67 | + | ||
68 | include $(top_srcdir)/include/mk/testcases.mk | ||
69 | -include $(abs_srcdir)/./Makefile.inc | ||
70 | + | ||
71 | +LTPLDLIBS = -lltpswapon | ||
72 | + | ||
73 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | ||
74 | -$(MAKE_TARGETS): %: ../swapon/libswapon.o | ||
75 | diff --git a/testcases/kernel/syscalls/swapoff/Makefile.inc b/testcases/kernel/syscalls/swapoff/Makefile.inc | ||
76 | deleted file mode 100644 | ||
77 | index 65350cbeb..000000000 | ||
78 | --- a/testcases/kernel/syscalls/swapoff/Makefile.inc | ||
79 | +++ /dev/null | ||
80 | @@ -1,6 +0,0 @@ | ||
81 | -LIBDIR += ../swapon/ | ||
82 | -LIBSWAPON := $(LIBDIR)/libswapon.o | ||
83 | -$(LIBSWAPON): | ||
84 | - $(MAKE) -C $(LIBDIR) | ||
85 | -CPPFLAGS += -I$(abs_srcdir)/$(LIBDIR) | ||
86 | -LDFLAGS += -L$(abs_builddir)/$(LIBDIR) | ||
87 | diff --git a/testcases/kernel/syscalls/swapoff/swapoff01.c b/testcases/kernel/syscalls/swapoff/swapoff01.c | ||
88 | index e115269c0..87a217a89 100644 | ||
89 | --- a/testcases/kernel/syscalls/swapoff/swapoff01.c | ||
90 | +++ b/testcases/kernel/syscalls/swapoff/swapoff01.c | ||
91 | @@ -25,7 +25,7 @@ | ||
92 | #include <stdlib.h> | ||
93 | #include "config.h" | ||
94 | #include "lapi/syscalls.h" | ||
95 | -#include "../swapon/libswapon.h" | ||
96 | +#include "libswapon.h" | ||
97 | |||
98 | static void setup(void); | ||
99 | static void cleanup(void); | ||
100 | diff --git a/testcases/kernel/syscalls/swapoff/swapoff02.c b/testcases/kernel/syscalls/swapoff/swapoff02.c | ||
101 | index 8954f975f..60cd66c26 100644 | ||
102 | --- a/testcases/kernel/syscalls/swapoff/swapoff02.c | ||
103 | +++ b/testcases/kernel/syscalls/swapoff/swapoff02.c | ||
104 | @@ -33,7 +33,7 @@ | ||
105 | #include "test.h" | ||
106 | #include "lapi/syscalls.h" | ||
107 | #include "safe_macros.h" | ||
108 | -#include "../swapon/libswapon.h" | ||
109 | +#include "libswapon.h" | ||
110 | |||
111 | static void setup(void); | ||
112 | static void cleanup(void); | ||
113 | diff --git a/testcases/kernel/syscalls/swapon/Makefile b/testcases/kernel/syscalls/swapon/Makefile | ||
114 | index 97113a447..57ec45d48 100644 | ||
115 | --- a/testcases/kernel/syscalls/swapon/Makefile | ||
116 | +++ b/testcases/kernel/syscalls/swapon/Makefile | ||
117 | @@ -8,10 +8,10 @@ endif | ||
118 | |||
119 | top_srcdir ?= ../../../.. | ||
120 | |||
121 | +LTPLIBS = ltpswapon | ||
122 | + | ||
123 | include $(top_srcdir)/include/mk/testcases.mk | ||
124 | |||
125 | -FILTER_OUT_MAKE_TARGETS := libswapon | ||
126 | +LTPLDLIBS = -lltpswapon | ||
127 | |||
128 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | ||
129 | - | ||
130 | -$(MAKE_TARGETS): %: libswapon.o | ||
131 | -- | ||
132 | 2.27.0 | ||
133 | |||
diff --git a/meta/recipes-extended/ltp/ltp/libswapon.patch b/meta/recipes-extended/ltp/ltp/libswapon.patch new file mode 100644 index 0000000000..07b0dcefcf --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/libswapon.patch | |||
@@ -0,0 +1,368 @@ | |||
1 | Index: git/libs/libltpswapon/Makefile | ||
2 | =================================================================== | ||
3 | --- /dev/null | ||
4 | +++ git/libs/libltpswapon/Makefile | ||
5 | @@ -0,0 +1,12 @@ | ||
6 | +# SPDX-License-Identifier: GPL-2.0-or-later | ||
7 | +# | ||
8 | +# Copyright (C) Richard Purdie <richard.purdie@linuxfoundation.org> | ||
9 | + | ||
10 | +top_srcdir ?= ../.. | ||
11 | + | ||
12 | +include $(top_srcdir)/include/mk/env_pre.mk | ||
13 | + | ||
14 | +INTERNAL_LIB := libltpswapon.a | ||
15 | + | ||
16 | +include $(top_srcdir)/include/mk/lib.mk | ||
17 | +include $(top_srcdir)/include/mk/generic_leaf_target.mk | ||
18 | Index: git/libs/libltpswapon/libswapon.c | ||
19 | =================================================================== | ||
20 | --- /dev/null | ||
21 | +++ git/libs/libltpswapon/libswapon.c | ||
22 | @@ -0,0 +1,90 @@ | ||
23 | +/* | ||
24 | + * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved. | ||
25 | + * | ||
26 | + * This program is free software; you can redistribute it and/or | ||
27 | + * modify it under the terms of the GNU General Public License as | ||
28 | + * published by the Free Software Foundation; either version 2 of | ||
29 | + * the License, or (at your option) any later version. | ||
30 | + * | ||
31 | + * This program is distributed in the hope that it would be useful, | ||
32 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
33 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
34 | + * GNU General Public License for more details. | ||
35 | + * | ||
36 | + * You should have received a copy of the GNU General Public License | ||
37 | + * along with this program; if not, write the Free Software Foundation, | ||
38 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
39 | + * | ||
40 | + * Author: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com> | ||
41 | + * | ||
42 | + */ | ||
43 | + | ||
44 | +#include <errno.h> | ||
45 | +#include "lapi/syscalls.h" | ||
46 | +#include "test.h" | ||
47 | +#include "libswapon.h" | ||
48 | + | ||
49 | +/* | ||
50 | + * Make a swap file | ||
51 | + */ | ||
52 | +int make_swapfile(void (cleanup)(void), const char *swapfile, int safe) | ||
53 | +{ | ||
54 | + if (!tst_fs_has_free(NULL, ".", sysconf(_SC_PAGESIZE) * 10, | ||
55 | + TST_BYTES)) { | ||
56 | + tst_brkm(TBROK, cleanup, | ||
57 | + "Insufficient disk space to create swap file"); | ||
58 | + } | ||
59 | + | ||
60 | + /* create file */ | ||
61 | + if (tst_fill_file(swapfile, 0, | ||
62 | + sysconf(_SC_PAGESIZE), 10) != 0) { | ||
63 | + tst_brkm(TBROK, cleanup, "Failed to create swapfile"); | ||
64 | + } | ||
65 | + | ||
66 | + /* make the file swapfile */ | ||
67 | + const char *argv[2 + 1]; | ||
68 | + argv[0] = "mkswap"; | ||
69 | + argv[1] = swapfile; | ||
70 | + argv[2] = NULL; | ||
71 | + | ||
72 | + return tst_cmd(cleanup, argv, "/dev/null", "/dev/null", safe); | ||
73 | +} | ||
74 | + | ||
75 | +/* | ||
76 | + * Check swapon/swapoff support status of filesystems or files | ||
77 | + * we are testing on. | ||
78 | + */ | ||
79 | +void is_swap_supported(void (cleanup)(void), const char *filename) | ||
80 | +{ | ||
81 | + int fibmap = tst_fibmap(filename); | ||
82 | + long fs_type = tst_fs_type(cleanup, filename); | ||
83 | + const char *fstype = tst_fs_type_name(fs_type); | ||
84 | + | ||
85 | + int ret = make_swapfile(NULL, filename, 1); | ||
86 | + if (ret != 0) { | ||
87 | + if (fibmap == 1) { | ||
88 | + tst_brkm(TCONF, cleanup, | ||
89 | + "mkswap on %s not supported", fstype); | ||
90 | + } else { | ||
91 | + tst_brkm(TFAIL, cleanup, | ||
92 | + "mkswap on %s failed", fstype); | ||
93 | + } | ||
94 | + } | ||
95 | + | ||
96 | + TEST(ltp_syscall(__NR_swapon, filename, 0)); | ||
97 | + if (TEST_RETURN == -1) { | ||
98 | + if (fibmap == 1 && errno == EINVAL) { | ||
99 | + tst_brkm(TCONF, cleanup, | ||
100 | + "Swapfile on %s not implemented", fstype); | ||
101 | + } else { | ||
102 | + tst_brkm(TFAIL | TERRNO, cleanup, | ||
103 | + "swapon on %s failed", fstype); | ||
104 | + } | ||
105 | + } | ||
106 | + | ||
107 | + TEST(ltp_syscall(__NR_swapoff, filename, 0)); | ||
108 | + if (TEST_RETURN == -1) { | ||
109 | + tst_brkm(TFAIL | TERRNO, cleanup, | ||
110 | + "swapoff on %s failed", fstype); | ||
111 | + } | ||
112 | +} | ||
113 | Index: git/testcases/kernel/syscalls/swapoff/Makefile | ||
114 | =================================================================== | ||
115 | --- git.orig/testcases/kernel/syscalls/swapoff/Makefile | ||
116 | +++ git/testcases/kernel/syscalls/swapoff/Makefile | ||
117 | @@ -3,7 +3,11 @@ | ||
118 | |||
119 | top_srcdir ?= ../../../.. | ||
120 | |||
121 | +LTPLIBS = ltpswapon | ||
122 | + | ||
123 | include $(top_srcdir)/include/mk/testcases.mk | ||
124 | -include $(abs_srcdir)/./Makefile.inc | ||
125 | + | ||
126 | +LTPLDLIBS = -lltpswapon | ||
127 | + | ||
128 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | ||
129 | -$(MAKE_TARGETS): %: ../swapon/libswapon.o | ||
130 | + | ||
131 | Index: git/testcases/kernel/syscalls/swapoff/Makefile.inc | ||
132 | =================================================================== | ||
133 | --- git.orig/testcases/kernel/syscalls/swapoff/Makefile.inc | ||
134 | +++ /dev/null | ||
135 | @@ -1,6 +0,0 @@ | ||
136 | -LIBDIR += ../swapon/ | ||
137 | -LIBSWAPON := $(LIBDIR)/libswapon.o | ||
138 | -$(LIBSWAPON): | ||
139 | - $(MAKE) -C $(LIBDIR) | ||
140 | -CPPFLAGS += -I$(abs_srcdir)/$(LIBDIR) | ||
141 | -LDFLAGS += -L$(abs_builddir)/$(LIBDIR) | ||
142 | Index: git/testcases/kernel/syscalls/swapon/Makefile | ||
143 | =================================================================== | ||
144 | --- git.orig/testcases/kernel/syscalls/swapon/Makefile | ||
145 | +++ git/testcases/kernel/syscalls/swapon/Makefile | ||
146 | @@ -8,10 +8,10 @@ endif | ||
147 | |||
148 | top_srcdir ?= ../../../.. | ||
149 | |||
150 | +LTPLIBS = ltpswapon | ||
151 | + | ||
152 | include $(top_srcdir)/include/mk/testcases.mk | ||
153 | |||
154 | -FILTER_OUT_MAKE_TARGETS := libswapon | ||
155 | +LTPLDLIBS = -lltpswapon | ||
156 | |||
157 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | ||
158 | - | ||
159 | -$(MAKE_TARGETS): %: libswapon.o | ||
160 | Index: git/testcases/kernel/syscalls/swapon/libswapon.c | ||
161 | =================================================================== | ||
162 | --- git.orig/testcases/kernel/syscalls/swapon/libswapon.c | ||
163 | +++ /dev/null | ||
164 | @@ -1,90 +0,0 @@ | ||
165 | -/* | ||
166 | - * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved. | ||
167 | - * | ||
168 | - * This program is free software; you can redistribute it and/or | ||
169 | - * modify it under the terms of the GNU General Public License as | ||
170 | - * published by the Free Software Foundation; either version 2 of | ||
171 | - * the License, or (at your option) any later version. | ||
172 | - * | ||
173 | - * This program is distributed in the hope that it would be useful, | ||
174 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
175 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
176 | - * GNU General Public License for more details. | ||
177 | - * | ||
178 | - * You should have received a copy of the GNU General Public License | ||
179 | - * along with this program; if not, write the Free Software Foundation, | ||
180 | - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
181 | - * | ||
182 | - * Author: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com> | ||
183 | - * | ||
184 | - */ | ||
185 | - | ||
186 | -#include <errno.h> | ||
187 | -#include "lapi/syscalls.h" | ||
188 | -#include "test.h" | ||
189 | -#include "libswapon.h" | ||
190 | - | ||
191 | -/* | ||
192 | - * Make a swap file | ||
193 | - */ | ||
194 | -int make_swapfile(void (cleanup)(void), const char *swapfile, int safe) | ||
195 | -{ | ||
196 | - if (!tst_fs_has_free(NULL, ".", sysconf(_SC_PAGESIZE) * 10, | ||
197 | - TST_BYTES)) { | ||
198 | - tst_brkm(TBROK, cleanup, | ||
199 | - "Insufficient disk space to create swap file"); | ||
200 | - } | ||
201 | - | ||
202 | - /* create file */ | ||
203 | - if (tst_fill_file(swapfile, 0, | ||
204 | - sysconf(_SC_PAGESIZE), 10) != 0) { | ||
205 | - tst_brkm(TBROK, cleanup, "Failed to create swapfile"); | ||
206 | - } | ||
207 | - | ||
208 | - /* make the file swapfile */ | ||
209 | - const char *argv[2 + 1]; | ||
210 | - argv[0] = "mkswap"; | ||
211 | - argv[1] = swapfile; | ||
212 | - argv[2] = NULL; | ||
213 | - | ||
214 | - return tst_cmd(cleanup, argv, "/dev/null", "/dev/null", safe); | ||
215 | -} | ||
216 | - | ||
217 | -/* | ||
218 | - * Check swapon/swapoff support status of filesystems or files | ||
219 | - * we are testing on. | ||
220 | - */ | ||
221 | -void is_swap_supported(void (cleanup)(void), const char *filename) | ||
222 | -{ | ||
223 | - int fibmap = tst_fibmap(filename); | ||
224 | - long fs_type = tst_fs_type(cleanup, filename); | ||
225 | - const char *fstype = tst_fs_type_name(fs_type); | ||
226 | - | ||
227 | - int ret = make_swapfile(NULL, filename, 1); | ||
228 | - if (ret != 0) { | ||
229 | - if (fibmap == 1) { | ||
230 | - tst_brkm(TCONF, cleanup, | ||
231 | - "mkswap on %s not supported", fstype); | ||
232 | - } else { | ||
233 | - tst_brkm(TFAIL, cleanup, | ||
234 | - "mkswap on %s failed", fstype); | ||
235 | - } | ||
236 | - } | ||
237 | - | ||
238 | - TEST(ltp_syscall(__NR_swapon, filename, 0)); | ||
239 | - if (TEST_RETURN == -1) { | ||
240 | - if (fibmap == 1 && errno == EINVAL) { | ||
241 | - tst_brkm(TCONF, cleanup, | ||
242 | - "Swapfile on %s not implemented", fstype); | ||
243 | - } else { | ||
244 | - tst_brkm(TFAIL | TERRNO, cleanup, | ||
245 | - "swapon on %s failed", fstype); | ||
246 | - } | ||
247 | - } | ||
248 | - | ||
249 | - TEST(ltp_syscall(__NR_swapoff, filename, 0)); | ||
250 | - if (TEST_RETURN == -1) { | ||
251 | - tst_brkm(TFAIL | TERRNO, cleanup, | ||
252 | - "swapoff on %s failed", fstype); | ||
253 | - } | ||
254 | -} | ||
255 | Index: git/testcases/kernel/syscalls/swapon/libswapon.h | ||
256 | =================================================================== | ||
257 | --- git.orig/testcases/kernel/syscalls/swapon/libswapon.h | ||
258 | +++ /dev/null | ||
259 | @@ -1,39 +0,0 @@ | ||
260 | -/* | ||
261 | - * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved. | ||
262 | - * | ||
263 | - * This program is free software; you can redistribute it and/or | ||
264 | - * modify it under the terms of the GNU General Public License as | ||
265 | - * published by the Free Software Foundation; either version 2 of | ||
266 | - * the License, or (at your option) any later version. | ||
267 | - * | ||
268 | - * This program is distributed in the hope that it would be useful, | ||
269 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
270 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
271 | - * GNU General Public License for more details. | ||
272 | - * | ||
273 | - * You should have received a copy of the GNU General Public License | ||
274 | - * along with this program; if not, write the Free Software Foundation, | ||
275 | - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
276 | - * | ||
277 | - * Author: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com> | ||
278 | - * | ||
279 | - */ | ||
280 | - | ||
281 | -/* | ||
282 | - * Contains common content for all swapon tests | ||
283 | - */ | ||
284 | - | ||
285 | -#ifndef __LIBSWAPON_H__ | ||
286 | -#define __LIBSWAPON_H__ | ||
287 | - | ||
288 | -/* | ||
289 | - * Make a swap file | ||
290 | - */ | ||
291 | -int make_swapfile(void (cleanup)(void), const char *swapfile, int safe); | ||
292 | - | ||
293 | -/* | ||
294 | - * Check swapon/swapoff support status of filesystems or files | ||
295 | - * we are testing on. | ||
296 | - */ | ||
297 | -void is_swap_supported(void (cleanup)(void), const char *filename); | ||
298 | -#endif /* __LIBSWAPON_H__ */ | ||
299 | Index: git/testcases/kernel/syscalls/swapoff/swapoff01.c | ||
300 | =================================================================== | ||
301 | --- git.orig/testcases/kernel/syscalls/swapoff/swapoff01.c | ||
302 | +++ git/testcases/kernel/syscalls/swapoff/swapoff01.c | ||
303 | @@ -25,7 +25,7 @@ | ||
304 | #include <stdlib.h> | ||
305 | #include "config.h" | ||
306 | #include "lapi/syscalls.h" | ||
307 | -#include "../swapon/libswapon.h" | ||
308 | +#include "libswapon.h" | ||
309 | |||
310 | static void setup(void); | ||
311 | static void cleanup(void); | ||
312 | Index: git/testcases/kernel/syscalls/swapoff/swapoff02.c | ||
313 | =================================================================== | ||
314 | --- git.orig/testcases/kernel/syscalls/swapoff/swapoff02.c | ||
315 | +++ git/testcases/kernel/syscalls/swapoff/swapoff02.c | ||
316 | @@ -33,7 +33,7 @@ | ||
317 | #include "test.h" | ||
318 | #include "lapi/syscalls.h" | ||
319 | #include "safe_macros.h" | ||
320 | -#include "../swapon/libswapon.h" | ||
321 | +#include "libswapon.h" | ||
322 | |||
323 | static void setup(void); | ||
324 | static void cleanup(void); | ||
325 | Index: git/include/libswapon.h | ||
326 | =================================================================== | ||
327 | --- /dev/null | ||
328 | +++ git/include/libswapon.h | ||
329 | @@ -0,0 +1,39 @@ | ||
330 | +/* | ||
331 | + * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved. | ||
332 | + * | ||
333 | + * This program is free software; you can redistribute it and/or | ||
334 | + * modify it under the terms of the GNU General Public License as | ||
335 | + * published by the Free Software Foundation; either version 2 of | ||
336 | + * the License, or (at your option) any later version. | ||
337 | + * | ||
338 | + * This program is distributed in the hope that it would be useful, | ||
339 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
340 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
341 | + * GNU General Public License for more details. | ||
342 | + * | ||
343 | + * You should have received a copy of the GNU General Public License | ||
344 | + * along with this program; if not, write the Free Software Foundation, | ||
345 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
346 | + * | ||
347 | + * Author: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com> | ||
348 | + * | ||
349 | + */ | ||
350 | + | ||
351 | +/* | ||
352 | + * Contains common content for all swapon tests | ||
353 | + */ | ||
354 | + | ||
355 | +#ifndef __LIBSWAPON_H__ | ||
356 | +#define __LIBSWAPON_H__ | ||
357 | + | ||
358 | +/* | ||
359 | + * Make a swap file | ||
360 | + */ | ||
361 | +int make_swapfile(void (cleanup)(void), const char *swapfile, int safe); | ||
362 | + | ||
363 | +/* | ||
364 | + * Check swapon/swapoff support status of filesystems or files | ||
365 | + * we are testing on. | ||
366 | + */ | ||
367 | +void is_swap_supported(void (cleanup)(void), const char *filename); | ||
368 | +#endif /* __LIBSWAPON_H__ */ | ||
diff --git a/meta/recipes-extended/ltp/ltp_20210121.bb b/meta/recipes-extended/ltp/ltp_20210121.bb index 5fe1a4f012..f58ca2eb2c 100644 --- a/meta/recipes-extended/ltp/ltp_20210121.bb +++ b/meta/recipes-extended/ltp/ltp_20210121.bb | |||
@@ -41,6 +41,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
41 | file://determinism.patch \ | 41 | file://determinism.patch \ |
42 | file://0001-open_posix_testsuite-generate-makefiles.sh-Avoid-inc.patch \ | 42 | file://0001-open_posix_testsuite-generate-makefiles.sh-Avoid-inc.patch \ |
43 | file://0002-Makefile-Avoid-wildcard-determinism-issues.patch \ | 43 | file://0002-Makefile-Avoid-wildcard-determinism-issues.patch \ |
44 | file://0003-syscalls-swapon-swapoff-Move-common-library-to-libs.patch \ | ||
44 | " | 45 | " |
45 | 46 | ||
46 | S = "${WORKDIR}/git" | 47 | S = "${WORKDIR}/git" |
@@ -58,14 +59,6 @@ EXTRA_OECONF = " --with-realtime-testsuite --with-open-posix-testsuite " | |||
58 | # ltp network/rpc test cases ftbfs when libtirpc is found | 59 | # ltp network/rpc test cases ftbfs when libtirpc is found |
59 | EXTRA_OECONF += " --without-tirpc " | 60 | EXTRA_OECONF += " --without-tirpc " |
60 | 61 | ||
61 | do_compile_prepend() { | ||
62 | # Reported at http://lists.linux.it/pipermail/ltp/2021-March/021274.html | ||
63 | # Avoid a race over construction of libswapon.o which is built by swapon and swapoff | ||
64 | # but the object differs depending upon which one built it | ||
65 | # ("../swapon/libswapon.c" vs "libswapon.c" references) | ||
66 | make -C ${B}/testcases/kernel/syscalls/swapon/ | ||
67 | } | ||
68 | |||
69 | do_install(){ | 62 | do_install(){ |
70 | install -d ${D}${prefix}/ | 63 | install -d ${D}${prefix}/ |
71 | oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install | 64 | oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install |