summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQiu Tingting <qiutt@fujitsu.com>2023-09-26 08:12:31 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-28 12:37:46 +0100
commit085adb197bb73d81ba49c6128c634609d69dd191 (patch)
treecca8e5643b139b27160ea377d162ccb1d8363237
parent857c2468b9ae6855df67d18ed3245ac32559b1a6 (diff)
downloadpoky-085adb197bb73d81ba49c6128c634609d69dd191.tar.gz
tar: add ptest support
Add a ptest for tar. - It is taking around 3m to execute with kvm, so added it to PTEST_SLOW. - It contains 244 cases. - Below is parts of the run log: START: ptest-runner 2023-09-26T08:37 BEGIN: /usr/lib/tar/ptest ## ------------------------ ## ## GNU tar 1.35 test suite. ## ## ------------------------ ## PASS: tar version PASS: decompressing from stdin ... 200 tests were successful. 44 tests were skipped. DURATION: 190 END: /usr/lib/tar/ptest 2023-09-26T08:40 STOP: ptest-runner TOTAL: 1 FAIL: 0 (From OE-Core rev: 12eed1e6c701759321541d2c04eeca3db3c99247) Signed-off-by: Qiu Tingting <qiutt@fujitsu.com> Signed-off-by: Yan Xinkuan <yanxk.fnst@fujitsu.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/conf/distro/include/ptest-packagelists.inc1
-rw-r--r--meta/recipes-core/images/core-image-ptest.bb3
-rw-r--r--meta/recipes-extended/tar/tar/0001-tests-fix-TESTSUITE_AT.patch228
-rw-r--r--meta/recipes-extended/tar/tar/0002-tests-check-for-recently-fixed-bug.patch60
-rw-r--r--meta/recipes-extended/tar/tar/0003-Exclude-VCS-directory-with-writing-from-an-archive.patch112
-rw-r--r--meta/recipes-extended/tar/tar/run-ptest14
-rw-r--r--meta/recipes-extended/tar/tar_1.35.bb34
7 files changed, 452 insertions, 0 deletions
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 07697e5d7d..fc42f95de2 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -112,6 +112,7 @@ PTESTS_SLOW = "\
112 python3-click \ 112 python3-click \
113 python3-xmltodict \ 113 python3-xmltodict \
114 strace \ 114 strace \
115 tar \
115 tcl \ 116 tcl \
116 util-linux \ 117 util-linux \
117 valgrind \ 118 valgrind \
diff --git a/meta/recipes-core/images/core-image-ptest.bb b/meta/recipes-core/images/core-image-ptest.bb
index b81ab7b7c8..b6f5c2fd60 100644
--- a/meta/recipes-core/images/core-image-ptest.bb
+++ b/meta/recipes-core/images/core-image-ptest.bb
@@ -24,6 +24,9 @@ IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-mdadm = "1524288"
24IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-strace = "1024288" 24IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-strace = "1024288"
25IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-lttng-tools = "1524288" 25IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-lttng-tools = "1524288"
26 26
27# tar-ptest in particular needs more space
28IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-tar = "1524288"
29
27# ptests need more memory than standard to avoid the OOM killer 30# ptests need more memory than standard to avoid the OOM killer
28QB_MEM = "-m 1024" 31QB_MEM = "-m 1024"
29QB_MEM:virtclass-mcextend-lttng-tools = "-m 4096" 32QB_MEM:virtclass-mcextend-lttng-tools = "-m 4096"
diff --git a/meta/recipes-extended/tar/tar/0001-tests-fix-TESTSUITE_AT.patch b/meta/recipes-extended/tar/tar/0001-tests-fix-TESTSUITE_AT.patch
new file mode 100644
index 0000000000..27d4d9aebf
--- /dev/null
+++ b/meta/recipes-extended/tar/tar/0001-tests-fix-TESTSUITE_AT.patch
@@ -0,0 +1,228 @@
1From 39849e9d91f477d3fb839f93cd0815d0cb3273e9 Mon Sep 17 00:00:00 2001
2From: Paul Eggert <eggert@cs.ucla.edu>
3Date: Tue, 18 Jul 2023 09:15:03 -0700
4Subject: tests: fix TESTSUITE_AT
5
6Problem reported by Lukas Javorsky <ljavorsk@redhat.com> in:
7https://lists.gnu.org/r/bug-tar/2023-07/msg00002.html
8* tests/Makefile.am (TESTSUITE_AT): Add exclude17.at, exclude18.at.
9Remove compress.m4; all uses changed. Add a comment saying how
10to rederive this. Sort.
11
12Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/tar.git/commit/?id=39849e9d91f477d3fb839f93cd0815d0cb3273e9]
13---
14 tests/Makefile.am | 93 ++++++++++++++++++++++++++++---------------------------
15 1 file changed, 48 insertions(+), 45 deletions(-)
16
17diff --git a/tests/Makefile.am b/tests/Makefile.am
18index 4a8f501..1884b72 100644
19--- a/tests/Makefile.am
20+++ b/tests/Makefile.am
21@@ -45,21 +45,24 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
22 ## Test suite. ##
23 ## ------------ ##
24
25+# You can generate the body of this macro with the following shell command:
26+# LC_ALL=C ls *.at */*.at | sed -e 's/^/ /' -e '$!s/$/\\/'
27 TESTSUITE_AT = \
28- testsuite.at\
29- compress.m4\
30 T-cd.at\
31 T-dir00.at\
32 T-dir01.at\
33 T-empty.at\
34+ T-mult.at\
35+ T-nest.at\
36+ T-nonl.at\
37 T-null.at\
38 T-null2.at\
39 T-rec.at\
40 T-recurse.at\
41 T-zfile.at\
42- T-nonl.at\
43- T-mult.at\
44- T-nest.at\
45+ acls01.at\
46+ acls02.at\
47+ acls03.at\
48 add-file.at\
49 append.at\
50 append01.at\
51@@ -68,14 +71,15 @@ TESTSUITE_AT = \
52 append04.at\
53 append05.at\
54 backup01.at\
55- chtype.at\
56- comprec.at\
57- comperr.at\
58+ capabs_raw01.at\
59 checkpoint/defaults.at\
60- checkpoint/interval.at\
61- checkpoint/dot.at\
62 checkpoint/dot-compat.at\
63 checkpoint/dot-int.at\
64+ checkpoint/dot.at\
65+ checkpoint/interval.at\
66+ chtype.at\
67+ comperr.at\
68+ comprec.at\
69 delete01.at\
70 delete02.at\
71 delete03.at\
72@@ -83,6 +87,8 @@ TESTSUITE_AT = \
73 delete05.at\
74 delete06.at\
75 difflink.at\
76+ dirrem01.at\
77+ dirrem02.at\
78 exclude.at\
79 exclude01.at\
80 exclude02.at\
81@@ -100,6 +106,8 @@ TESTSUITE_AT = \
82 exclude14.at\
83 exclude15.at\
84 exclude16.at\
85+ exclude17.at\
86+ exclude18.at\
87 extrac01.at\
88 extrac02.at\
89 extrac03.at\
90@@ -127,11 +135,9 @@ TESTSUITE_AT = \
91 extrac25.at\
92 filerem01.at\
93 filerem02.at\
94- dirrem01.at\
95- dirrem02.at\
96- gzip.at\
97 grow.at\
98- incremental.at\
99+ gzip.at\
100+ ignfail.at\
101 incr01.at\
102 incr02.at\
103 incr03.at\
104@@ -143,8 +149,8 @@ TESTSUITE_AT = \
105 incr09.at\
106 incr10.at\
107 incr11.at\
108+ incremental.at\
109 indexfile.at\
110- ignfail.at\
111 label01.at\
112 label02.at\
113 label03.at\
114@@ -188,22 +194,16 @@ TESTSUITE_AT = \
115 opcomp04.at\
116 opcomp05.at\
117 opcomp06.at\
118- positional01.at\
119- positional02.at\
120- positional03.at\
121 options.at\
122 options02.at\
123 options03.at\
124 owner.at\
125 pipe.at\
126- recurse.at\
127+ positional01.at\
128+ positional02.at\
129+ positional03.at\
130 recurs02.at\
131- rename01.at\
132- rename02.at\
133- rename03.at\
134- rename04.at\
135- rename05.at\
136- rename06.at\
137+ recurse.at\
138 remfiles01.at\
139 remfiles02.at\
140 remfiles03.at\
141@@ -226,11 +226,19 @@ TESTSUITE_AT = \
142 remfiles09b.at\
143 remfiles09c.at\
144 remfiles10.at\
145+ rename01.at\
146+ rename02.at\
147+ rename03.at\
148+ rename04.at\
149+ rename05.at\
150+ rename06.at\
151 same-order01.at\
152 same-order02.at\
153+ selacl01.at\
154+ selnx01.at\
155 shortfile.at\
156- shortupd.at\
157 shortrec.at\
158+ shortupd.at\
159 sigpipe.at\
160 sparse01.at\
161 sparse02.at\
162@@ -247,6 +255,13 @@ TESTSUITE_AT = \
163 sptrcreat.at\
164 sptrdiff00.at\
165 sptrdiff01.at\
166+ star/gtarfail.at\
167+ star/gtarfail2.at\
168+ star/multi-fail.at\
169+ star/pax-big-10g.at\
170+ star/ustar-big-2g.at\
171+ star/ustar-big-8g.at\
172+ testsuite.at\
173 time01.at\
174 time02.at\
175 truncate.at\
176@@ -255,21 +270,11 @@ TESTSUITE_AT = \
177 update02.at\
178 update03.at\
179 update04.at\
180- volsize.at\
181- volume.at\
182 verbose.at\
183 verify.at\
184 version.at\
185- xform-h.at\
186- xform01.at\
187- xform02.at\
188- xform03.at\
189- star/gtarfail.at\
190- star/gtarfail2.at\
191- star/multi-fail.at\
192- star/ustar-big-2g.at\
193- star/ustar-big-8g.at\
194- star/pax-big-10g.at\
195+ volsize.at\
196+ volume.at\
197 xattr01.at\
198 xattr02.at\
199 xattr03.at\
200@@ -278,12 +283,10 @@ TESTSUITE_AT = \
201 xattr06.at\
202 xattr07.at\
203 xattr08.at\
204- acls01.at\
205- acls02.at\
206- acls03.at\
207- selnx01.at\
208- selacl01.at\
209- capabs_raw01.at
210+ xform-h.at\
211+ xform01.at\
212+ xform02.at\
213+ xform03.at
214
215 distclean-local:
216 -rm -rf download
217@@ -291,7 +294,7 @@ distclean-local:
218 TESTSUITE = $(srcdir)/testsuite
219
220 AUTOTEST = $(AUTOM4TE) --language=autotest
221-$(TESTSUITE): package.m4 $(TESTSUITE_AT)
222+$(TESTSUITE): compress.m4 package.m4 $(TESTSUITE_AT)
223 $(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
224 mv $@.tmp $@
225
226--
227cgit v1.1
228
diff --git a/meta/recipes-extended/tar/tar/0002-tests-check-for-recently-fixed-bug.patch b/meta/recipes-extended/tar/tar/0002-tests-check-for-recently-fixed-bug.patch
new file mode 100644
index 0000000000..6cd8c5510f
--- /dev/null
+++ b/meta/recipes-extended/tar/tar/0002-tests-check-for-recently-fixed-bug.patch
@@ -0,0 +1,60 @@
1From 0f0722df45ec520d0dac7c9ad7e69165e9140931 Mon Sep 17 00:00:00 2001
2From: Paul Eggert <eggert@cs.ucla.edu>
3Date: Fri, 7 Oct 2022 15:22:07 -0700
4Subject: tests: check for recently-fixed bug
5
6* tests/exclude17.at: New file.
7
8Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/tar.git/commit/?id=0f0722df45ec520d0dac7c9ad7e69165e9140931]
9
10Signed-off-by: Qiu Tingting <qiutt@fujitsu.com>
11
12---
13 tests/exclude17.at | 35 +++++++++++++++++++++++++++++++++++
14 1 files changed, 35 insertions(+)
15 create mode 100644 tests/exclude17.at
16
17diff --git a/tests/exclude17.at b/tests/exclude17.at
18new file mode 100644
19index 0000000..4162b2b
20--- /dev/null
21+++ b/tests/exclude17.at
22@@ -0,0 +1,35 @@
23+# Process this file with autom4te to create testsuite. -*- Autotest -*-
24+#
25+# Test suite for GNU tar.
26+# Copyright 2013-2022 Free Software Foundation, Inc.
27+
28+# This file is part of GNU tar.
29+
30+# GNU tar is free software; you can redistribute it and/or modify
31+# it under the terms of the GNU General Public License as published by
32+# the Free Software Foundation; either version 3 of the License, or
33+# (at your option) any later version.
34+
35+# GNU tar is distributed in the hope that it will be useful,
36+# but WITHOUT ANY WARRANTY; without even the implied warranty of
37+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38+# GNU General Public License for more details.
39+
40+# You should have received a copy of the GNU General Public License
41+# along with this program. If not, see <http://www.gnu.org/licenses/>.
42+
43+AT_SETUP([--exclude-vcs-ignores memory allocation])
44+AT_KEYWORDS([exclude exclude17])
45+
46+AT_TAR_CHECK([
47+mkdir dir
48+cd dir
49+echo '*.o' >.cvsignore
50+tar -cf - --exclude-vcs-ignores . | tar -tf -
51+],
52+[0],
53+[./
54+./.cvsignore
55+])
56+
57+AT_CLEANUP
58--
59cgit v1.1
60
diff --git a/meta/recipes-extended/tar/tar/0003-Exclude-VCS-directory-with-writing-from-an-archive.patch b/meta/recipes-extended/tar/tar/0003-Exclude-VCS-directory-with-writing-from-an-archive.patch
new file mode 100644
index 0000000000..577a9ba997
--- /dev/null
+++ b/meta/recipes-extended/tar/tar/0003-Exclude-VCS-directory-with-writing-from-an-archive.patch
@@ -0,0 +1,112 @@
1From 4f814e0e4c673f86dc65a557f7e55f6b5efd1529 Mon Sep 17 00:00:00 2001
2From: Anton Makrushin <makrusan@gmail.com>
3Date: Mon, 20 Mar 2023 20:05:42 +0530
4Subject: Exclude VCS directory with writing from an archive
5
6See https://savannah.gnu.org/bugs/?62859
7
8Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/tar.git/commit/?id=4f814e0e4c673f86dc65a557f7e55f6b5efd1529]
9
10Signed-off-by: Qiu Tingting <qiutt@fujitsu.com>
11
12---
13 tests/exclude18.at | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
14 1 files changed, 87 insertions(+)
15 create mode 100644 tests/exclude18.at
16
17diff --git a/tests/exclude18.at b/tests/exclude18.at
18new file mode 100644
19index 0000000..64aaa52
20--- /dev/null
21+++ b/tests/exclude18.at
22@@ -0,0 +1,87 @@
23+# Process this file with autom4te to create testsuite. -*- Autotest -*-
24+
25+# Test suite for GNU tar.
26+# Copyright 2004-2023 Free Software Foundation, Inc.
27+
28+# This file is part of GNU tar.
29+
30+# GNU tar is free software; you can redistribute it and/or modify
31+# it under the terms of the GNU General Public License as published by
32+# the Free Software Foundation; either version 3 of the License, or
33+# (at your option) any later version.
34+
35+# GNU tar is distributed in the hope that it will be useful,
36+# but WITHOUT ANY WARRANTY; without even the implied warranty of
37+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38+# GNU General Public License for more details.
39+
40+# You should have received a copy of the GNU General Public License
41+# along with this program. If not, see <http://www.gnu.org/licenses/>.
42+
43+# Test --exclude-vcs option with subcommands: EXTRACT, LIST, DIFF.
44+# Check VCS directory with files, and empty.
45+#
46+# Ref: https://savannah.gnu.org/bugs/?62859
47+# Wed 03 Aug 2022 04:06:28 PM UTC, original submission: Quote
48+# Mohamed Akram <mohdakram>
49+# > The --exclude-vcs flag seems to exclude .gitignore but not .git when
50+# extracting.
51+
52+AT_SETUP([--exclude-vcs extract list compare])
53+AT_KEYWORDS([exclude-vcs extract list compare exclude18])
54+
55+AT_TAR_CHECK([
56+AT_SORT_PREREQ
57+mkdir gitrepo
58+cd gitrepo
59+
60+# Make an empty VCS directory:
61+mkdir .svn
62+
63+# Make a VCS directory with a file:
64+mkdir .git
65+touch .git/_A
66+
67+# Make a VCS file:
68+touch .gitignore
69+
70+# Make non-VCS files:
71+touch .git_B
72+touch _C
73+
74+# Create an archive, include VCS:
75+cd ..
76+tar -cf gitrepo.tar gitrepo
77+rm -r gitrepo
78+
79+echo Extract:
80+tar -xvf gitrepo.tar --exclude-vcs | sort
81+
82+echo
83+echo List:
84+tar -tf gitrepo.tar --exclude-vcs | sort
85+
86+echo
87+echo Diff:
88+tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort
89+
90+],
91+[0],
92+[Extract:
93+gitrepo/
94+gitrepo/.git_B
95+gitrepo/_C
96+
97+List:
98+gitrepo/
99+gitrepo/.git_B
100+gitrepo/_C
101+
102+Diff:
103+gitrepo/
104+gitrepo/.git_B
105+gitrepo/_C
106+],
107+[])
108+
109+AT_CLEANUP
110--
111cgit v1.1
112
diff --git a/meta/recipes-extended/tar/tar/run-ptest b/meta/recipes-extended/tar/tar/run-ptest
new file mode 100644
index 0000000000..185b33d61a
--- /dev/null
+++ b/meta/recipes-extended/tar/tar/run-ptest
@@ -0,0 +1,14 @@
1#!/bin/sh
2
3# Define tar test work dir
4WORKDIR=@PTEST_PATH@/tests/
5
6# Run test
7cd ${WORKDIR}
8./atconfig ./atlocal ./testsuite
9
10# clear log
11rm -rf testsuite.dir
12rm -rf testsuite.log
13
14./testsuite --am-fmt
diff --git a/meta/recipes-extended/tar/tar_1.35.bb b/meta/recipes-extended/tar/tar_1.35.bb
index 4dbd418b60..c7bd1d195e 100644
--- a/meta/recipes-extended/tar/tar_1.35.bb
+++ b/meta/recipes-extended/tar/tar_1.35.bb
@@ -42,6 +42,40 @@ do_install:append:class-target() {
42 fi 42 fi
43} 43}
44 44
45# add for ptest support
46SRC_URI += " \
47 file://run-ptest \
48 file://0001-tests-fix-TESTSUITE_AT.patch \
49 file://0002-tests-check-for-recently-fixed-bug.patch \
50 file://0003-Exclude-VCS-directory-with-writing-from-an-archive.patch \
51"
52
53inherit ptest
54
55do_compile_ptest() {
56 oe_runmake -C ${B}/gnu/ check
57 oe_runmake -C ${B}/lib/ check
58 oe_runmake -C ${B}/rmt/ check
59 oe_runmake -C ${B}/src/ check
60 rm -rf ${S}/tests/testsuite
61 oe_runmake -C ${B}/tests/ testsuite
62 oe_runmake -C ${B}/tests/ genfile checkseekhole ckmtime
63}
64
65do_install_ptest() {
66 install -d ${D}${PTEST_PATH}/tests/
67 install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
68 sed -i "/abs_/d" ${D}${PTEST_PATH}/tests/atconfig
69 echo "abs_builddir=${PTEST_PATH}/tests/" >> ${D}${PTEST_PATH}/tests/atconfig
70 install --mode=755 ${B}/tests/atlocal ${D}${PTEST_PATH}/tests/
71 sed -i "/PATH=/d" ${D}${PTEST_PATH}/tests/atlocal
72 install --mode=755 ${B}/tests/genfile ${D}${PTEST_PATH}/tests/
73 install --mode=755 ${B}/tests/checkseekhole ${D}${PTEST_PATH}/tests/
74 install --mode=755 ${B}/tests/ckmtime ${D}${PTEST_PATH}/tests/
75 install --mode=755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/
76 sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/run-ptest
77}
78
45PACKAGES =+ "${PN}-rmt" 79PACKAGES =+ "${PN}-rmt"
46 80
47FILES:${PN}-rmt = "${sbindir}/rmt*" 81FILES:${PN}-rmt = "${sbindir}/rmt*"