Merge ~canonical-kernel-team/+git/autotest-client-tests:phlin/fix-zfs-xfs-generic into ~canonical-kernel-team/+git/autotest-client-tests:master

Proposed by Po-Hsu Lin
Status: Merged
Merged at revision: 8d58ecf4c05d22dd26f2de1895adabee224fe95e
Proposed branch: ~canonical-kernel-team/+git/autotest-client-tests:phlin/fix-zfs-xfs-generic
Merge into: ~canonical-kernel-team/+git/autotest-client-tests:master
Diff against target: 867 lines (+161/-326)
6 files modified
dev/null (+0/-1)
ubuntu_xfstests_btrfs/ubuntu_xfstests_btrfs.py (+25/-65)
ubuntu_xfstests_ext4/ubuntu_xfstests_ext4.py (+24/-68)
ubuntu_xfstests_xfs/ubuntu_xfstests_xfs.py (+24/-65)
ubuntu_zfs_xfs_generic/0001-xfstests-add-minimal-support-for-zfs.patch (+52/-68)
ubuntu_zfs_xfs_generic/ubuntu_zfs_xfs_generic.py (+36/-59)
Reviewer Review Type Date Requested Status
Andrei Gherzan Approve
Review via email: mp+439148@code.launchpad.net

Commit message

The xfstest-bld upstream has been updated with some structural change,
(e.g. the get-all and build-all script has been moved to fstests-bld).

We will need to modify our test case to make it work.

I left local patches untouched just in case.

Build tested with:
  * X-4.4 amd64
  * B-4.15 amd64
  * F-5.4 amd64
  * F-oem-5.14 amd64
  * J-5.15 amd64
  * K-5.19 amd64

For ubuntu_xfstests_*,

Remove the os_dep check, if we're missing any tool we will know it
directly from test build output. There is no need to make extra checks
here. Furthermore, the dependency could change from time to time with
test suite update from upstream.

Build tested with:
  * X-4.4 amd64 / i386
  * B-4.15 amd64
  * F-5.4 amd64
  * J-5.15 amd64
  * K-5.19 amd64

Description of the change

Note that I have re-constructed the required package list, we can get back to this to add more packages if needed.

To post a comment you must log in.
Revision history for this message
Andrei Gherzan (agherzan) wrote :

This looks good to me but I haven't tried it out.

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Applied and pushed, I will have Francis's change ready later.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ubuntu_xfstests_btrfs/ubuntu_xfstests_btrfs.py b/ubuntu_xfstests_btrfs/ubuntu_xfstests_btrfs.py
2index ee5937f..f3a12c4 100644
3--- a/ubuntu_xfstests_btrfs/ubuntu_xfstests_btrfs.py
4+++ b/ubuntu_xfstests_btrfs/ubuntu_xfstests_btrfs.py
5@@ -1,9 +1,11 @@
6-import multiprocessing
7-import os, re, glob, logging
8+import os
9+import re
10+import glob
11+import logging
12 import platform
13 import shutil
14 from autotest.client.shared import error
15-from autotest.client import test, utils, os_dep
16+from autotest.client import test, utils
17 from autotest.client import canonical
18
19 class ubuntu_xfstests_btrfs(test.test):
20@@ -25,7 +27,7 @@ class ubuntu_xfstests_btrfs(test.test):
21 return tests_list
22
23 def install_required_pkgs(self):
24- arch = platform.processor()
25+ arch = platform.processor()
26 try:
27 series = platform.dist()[2]
28 except AttributeError:
29@@ -41,32 +43,22 @@ class ubuntu_xfstests_btrfs(test.test):
30 'build-essential',
31 'dbench',
32 'dump',
33- 'fio',
34 'gettext',
35- 'git',
36- 'keyutils',
37- 'kpartx',
38- 'libacl1-dev',
39- 'libaio-dev',
40- 'libattr1-dev',
41 'libblkid-dev',
42+ 'libicu-dev',
43 'libssl-dev',
44 'libtool',
45 'patchutils',
46- 'pkg-config',
47+ 'pkgconf',
48 'quota',
49- 'texinfo',
50- 'texlive',
51- 'thin-provisioning-tools',
52- 'xfsdump',
53- 'xfslibs-dev'
54+ 'uuid-dev'
55 ]
56+
57 gcc = 'gcc' if arch in ['ppc64le', 'aarch64', 's390x', 'riscv64'] else 'gcc-multilib'
58 pkgs.append(gcc)
59
60 if series not in ['precise', 'trusty']:
61 pkgs.append('btrfs-progs')
62- pkgs.append('libtool-bin')
63 if series not in ['precise', 'trusty', 'xenial']:
64 pkgs.append('duperemove')
65
66@@ -74,7 +66,7 @@ class ubuntu_xfstests_btrfs(test.test):
67 self.results = utils.system_output(cmd, retain_output=True)
68
69 def _run_sub_test(self, test):
70- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
71+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld', 'xfstests-dev'))
72 output = utils.system_output('./check %s' % test,
73 ignore_status=True,
74 retain_output=True)
75@@ -135,10 +127,12 @@ class ubuntu_xfstests_btrfs(test.test):
76
77
78 def _run_suite(self):
79- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
80- output = utils.system_output('./check -g auto -x dangerous',
81- ignore_status=True,
82- retain_output=True)
83+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld', 'xfstests-dev'))
84+ exclusion = os.path.join(self.srcdir, 'xfstests-bld', 'test-appliance', 'files',
85+ 'root', 'fs', 'btrfs', 'exclude')
86+ utils.system_output('./check -E %s -g auto -x dangerous' % exclusion,
87+ ignore_status=True,
88+ retain_output=True)
89
90 def initialize(self):
91 pass
92@@ -152,22 +146,6 @@ class ubuntu_xfstests_btrfs(test.test):
93 utils.system_output('useradd -m fsgqa || true', retain_output=True)
94 utils.system_output('grep -q fsgqa /etc/sudoers || echo \"fsgqa ALL=(ALL)NOPASSWD: ALL\" >> /etc/sudoers', retain_output=True)
95
96- #
97- # Anticipate failures due to missing devel tools, libraries, headers
98- # and xfs commands
99- #
100- os_dep.command('autoconf')
101- os_dep.command('autoheader')
102- os_dep.command('libtool')
103- os_dep.library('libuuid.so.1')
104- #os_dep.header('xfs/xfs.h')
105- #os_dep.header('attr/xattr.h')
106- #os_dep.header('sys/acl.h')
107- os_dep.command('mkfs.xfs')
108- os_dep.command('xfs_db')
109- os_dep.command('xfs_bmap')
110- os_dep.command('xfsdump')
111-
112 self.job.require_gcc()
113
114 canonical.setup_proxy()
115@@ -176,34 +154,16 @@ class ubuntu_xfstests_btrfs(test.test):
116 os.chdir(self.srcdir)
117 shutil.rmtree('xfstests-bld', ignore_errors=True)
118 utils.system('git clone https://github.com/tytso/xfstests-bld')
119+
120 os.chdir(os.path.join(self.srcdir, 'xfstests-bld'))
121- commit_bld = 'a4df7d7b31125901cb1fe9b092f495b6aa950448'
122+ commit_bld = '8672804daa67855739592070e1732991179c2ba9'
123 print("Using head commit for xfstests-bld " + commit_bld)
124 utils.system('git reset --hard ' + commit_bld)
125- # print("Patching xfstests-bld to add ARM64 xattr syscall support")
126- # utils.system('patch -p1 < %s/0004-Add-syscalls-for-ARM64-platforms-LP-1755499.patch' % self.bindir)
127- #
128- # Fix build link issues with newer toolchains (this is an ugly hack)
129- #
130- if float(platform.linux_distribution()[1]) > 18.04:
131- print("Patching xfstest-blkd to fix static linking issue")
132- utils.system('patch -p1 < %s/0005-build-all-remove-static-linking-flags-to-fix-build-i.patch' % self.bindir)
133- print("Fetching all repos..")
134- utils.system('./get-all')
135
136- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
137- commit = '82eda8820ddd68dab0bc35199a53a08f58b1d26c'
138- print("Using xfs from known stable commit point " + commit)
139- utils.system('git reset --hard ' + commit)
140- print("Patching xfstests..")
141- os.chdir(os.path.join(self.srcdir, 'xfstests-bld'))
142- print("Building xfstests")
143- utils.system('pwd')
144- try:
145- nprocs = '-j' + str(multiprocessing.cpu_count())
146- except:
147- nprocs = ''
148- utils.make(nprocs)
149+ print("Building tests...")
150+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld'))
151+ utils.system('./get-all')
152+ utils.system('./build-all')
153
154 logging.debug("Available tests in srcdir: %s" %
155 ", ".join(self._get_available_tests()))
156@@ -213,10 +173,10 @@ class ubuntu_xfstests_btrfs(test.test):
157 return utils.system('/bin/bash %s/create-test-partitions %s %s' % (self.bindir, os.environ['XFSTESTS_TEST_DRIVE'], filesystem))
158
159 def unmount_partitions(self):
160- for mnt_point in [ os.environ['SCRATCH_MNT'], os.environ['TEST_DIR'] ]:
161+ for mnt_point in [os.environ['SCRATCH_MNT'], os.environ['TEST_DIR']]:
162 utils.system('umount %s' % mnt_point, ignore_status=True)
163
164- def run_once(self, test_name, filesystem='ext4', test_number='000', single=False, skip_dangerous=True):
165+ def run_once(self, test_name, filesystem='btrfs', test_number='000', single=False, skip_dangerous=True):
166 if test_name == 'setup':
167 return
168
169diff --git a/ubuntu_xfstests_ext4/ubuntu_xfstests_ext4.py b/ubuntu_xfstests_ext4/ubuntu_xfstests_ext4.py
170index 2df880b..279781d 100644
171--- a/ubuntu_xfstests_ext4/ubuntu_xfstests_ext4.py
172+++ b/ubuntu_xfstests_ext4/ubuntu_xfstests_ext4.py
173@@ -1,9 +1,11 @@
174-import multiprocessing
175-import os, re, glob, logging
176+import os
177+import re
178+import glob
179+import logging
180 import platform
181 import shutil
182 from autotest.client.shared import error
183-from autotest.client import test, utils, os_dep
184+from autotest.client import test, utils
185 from autotest.client import canonical
186
187 class ubuntu_xfstests_ext4(test.test):
188@@ -25,7 +27,7 @@ class ubuntu_xfstests_ext4(test.test):
189 return tests_list
190
191 def install_required_pkgs(self):
192- arch = platform.processor()
193+ arch = platform.processor()
194 try:
195 series = platform.dist()[2]
196 except AttributeError:
197@@ -41,32 +43,20 @@ class ubuntu_xfstests_ext4(test.test):
198 'build-essential',
199 'dbench',
200 'dump',
201- 'fio',
202 'gettext',
203- 'git',
204- 'keyutils',
205- 'kpartx',
206- 'libacl1-dev',
207- 'libaio-dev',
208- 'libattr1-dev',
209 'libblkid-dev',
210+ 'libicu-dev',
211 'libssl-dev',
212 'libtool',
213 'patchutils',
214- 'pkg-config',
215+ 'pkgconf',
216 'quota',
217- 'texinfo',
218- 'texlive',
219- 'thin-provisioning-tools',
220- 'xfsdump',
221- 'xfslibs-dev'
222+ 'uuid-dev'
223 ]
224+
225 gcc = 'gcc' if arch in ['ppc64le', 'aarch64', 's390x', 'riscv64'] else 'gcc-multilib'
226 pkgs.append(gcc)
227
228- if series not in ['precise', 'trusty']:
229- pkgs.append('btrfs-progs')
230- pkgs.append('libtool-bin')
231 if series not in ['precise', 'trusty', 'xenial']:
232 pkgs.append('duperemove')
233
234@@ -74,7 +64,7 @@ class ubuntu_xfstests_ext4(test.test):
235 self.results = utils.system_output(cmd, retain_output=True)
236
237 def _run_sub_test(self, test):
238- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
239+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld', 'xfstests-dev'))
240 output = utils.system_output('./check %s' % test,
241 ignore_status=True,
242 retain_output=True)
243@@ -135,12 +125,12 @@ class ubuntu_xfstests_ext4(test.test):
244
245
246 def _run_suite(self):
247- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
248- exclusion = os.path.join(self.srcdir, 'xfstests-bld', 'kvm-xfstests',
249- 'test-appliance', 'files', 'root', 'fs', 'ext4', 'exclude')
250- output = utils.system_output('./check -E %s -g auto -x dangerous' % exclusion,
251- ignore_status=True,
252- retain_output=True)
253+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld', 'xfstests-dev'))
254+ exclusion = os.path.join(self.srcdir, 'xfstests-bld', 'test-appliance', 'files',
255+ 'root', 'fs', 'ext4', 'exclude')
256+ utils.system_output('./check -E %s -g auto -x dangerous' % exclusion,
257+ ignore_status=True,
258+ retain_output=True)
259
260 def initialize(self):
261 pass
262@@ -154,22 +144,6 @@ class ubuntu_xfstests_ext4(test.test):
263 utils.system_output('useradd -m fsgqa || true', retain_output=True)
264 utils.system_output('grep -q fsgqa /etc/sudoers || echo \"fsgqa ALL=(ALL)NOPASSWD: ALL\" >> /etc/sudoers', retain_output=True)
265
266- #
267- # Anticipate failures due to missing devel tools, libraries, headers
268- # and xfs commands
269- #
270- os_dep.command('autoconf')
271- os_dep.command('autoheader')
272- os_dep.command('libtool')
273- os_dep.library('libuuid.so.1')
274- #os_dep.header('xfs/xfs.h')
275- #os_dep.header('attr/xattr.h')
276- #os_dep.header('sys/acl.h')
277- os_dep.command('mkfs.xfs')
278- os_dep.command('xfs_db')
279- os_dep.command('xfs_bmap')
280- os_dep.command('xfsdump')
281-
282 self.job.require_gcc()
283
284 canonical.setup_proxy()
285@@ -178,34 +152,16 @@ class ubuntu_xfstests_ext4(test.test):
286 os.chdir(self.srcdir)
287 shutil.rmtree('xfstests-bld', ignore_errors=True)
288 utils.system('git clone https://github.com/tytso/xfstests-bld')
289+
290 os.chdir(os.path.join(self.srcdir, 'xfstests-bld'))
291- commit_bld = 'a4df7d7b31125901cb1fe9b092f495b6aa950448'
292+ commit_bld = '8672804daa67855739592070e1732991179c2ba9'
293 print("Using head commit for xfstests-bld " + commit_bld)
294 utils.system('git reset --hard ' + commit_bld)
295- # print("Patching xfstests-bld to add ARM64 xattr syscall support")
296- # utils.system('patch -p1 < %s/0004-Add-syscalls-for-ARM64-platforms-LP-1755499.patch' % self.bindir)
297- #
298- # Fix build link issues with newer toolchains (this is an ugly hack)
299- #
300- if float(platform.linux_distribution()[1]) > 18.04:
301- print("Patching xfstest-blkd to fix static linking issue")
302- utils.system('patch -p1 < %s/0005-build-all-remove-static-linking-flags-to-fix-build-i.patch' % self.bindir)
303- print("Fetching all repos..")
304- utils.system('./get-all')
305
306- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
307- commit = '82eda8820ddd68dab0bc35199a53a08f58b1d26c'
308- print("Using xfs from known stable commit point " + commit)
309- utils.system('git reset --hard ' + commit)
310- print("Patching xfstests..")
311- os.chdir(os.path.join(self.srcdir, 'xfstests-bld'))
312- print("Building xfstests")
313- utils.system('pwd')
314- try:
315- nprocs = '-j' + str(multiprocessing.cpu_count())
316- except:
317- nprocs = ''
318- utils.make(nprocs)
319+ print("Building tests...")
320+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld'))
321+ utils.system('./get-all')
322+ utils.system('./build-all')
323
324 logging.debug("Available tests in srcdir: %s" %
325 ", ".join(self._get_available_tests()))
326@@ -215,7 +171,7 @@ class ubuntu_xfstests_ext4(test.test):
327 return utils.system('/bin/bash %s/create-test-partitions %s %s' % (self.bindir, os.environ['XFSTESTS_TEST_DRIVE'], filesystem))
328
329 def unmount_partitions(self):
330- for mnt_point in [ os.environ['SCRATCH_MNT'], os.environ['TEST_DIR'] ]:
331+ for mnt_point in [os.environ['SCRATCH_MNT'], os.environ['TEST_DIR']]:
332 utils.system('umount %s' % mnt_point, ignore_status=True)
333
334 def run_once(self, test_name, filesystem='ext4', test_number='000', single=False, skip_dangerous=True):
335diff --git a/ubuntu_xfstests_xfs/ubuntu_xfstests_xfs.py b/ubuntu_xfstests_xfs/ubuntu_xfstests_xfs.py
336index 7e0d9a0..8d695b0 100644
337--- a/ubuntu_xfstests_xfs/ubuntu_xfstests_xfs.py
338+++ b/ubuntu_xfstests_xfs/ubuntu_xfstests_xfs.py
339@@ -1,9 +1,11 @@
340-import multiprocessing
341-import os, re, glob, logging
342+import os
343+import re
344+import glob
345+import logging
346 import platform
347 import shutil
348 from autotest.client.shared import error
349-from autotest.client import test, utils, os_dep
350+from autotest.client import test, utils
351 from autotest.client import canonical
352
353 class ubuntu_xfstests_xfs(test.test):
354@@ -25,7 +27,7 @@ class ubuntu_xfstests_xfs(test.test):
355 return tests_list
356
357 def install_required_pkgs(self):
358- arch = platform.processor()
359+ arch = platform.processor()
360 try:
361 series = platform.dist()[2]
362 except AttributeError:
363@@ -39,28 +41,18 @@ class ubuntu_xfstests_xfs(test.test):
364 'autopoint',
365 'bc',
366 'build-essential',
367- 'dbench',
368 'dump',
369- 'fio',
370 'gettext',
371- 'git',
372- 'keyutils',
373- 'kpartx',
374- 'libacl1-dev',
375- 'libaio-dev',
376- 'libattr1-dev',
377 'libblkid-dev',
378+ 'libicu-dev',
379 'libssl-dev',
380 'libtool',
381 'patchutils',
382- 'pkg-config',
383+ 'pkgconf',
384 'quota',
385- 'texinfo',
386- 'texlive',
387- 'thin-provisioning-tools',
388- 'xfsdump',
389- 'xfslibs-dev'
390+ 'uuid-dev'
391 ]
392+
393 gcc = 'gcc' if arch in ['ppc64le', 'aarch64', 's390x', 'riscv64'] else 'gcc-multilib'
394 pkgs.append(gcc)
395
396@@ -74,7 +66,7 @@ class ubuntu_xfstests_xfs(test.test):
397 self.results = utils.system_output(cmd, retain_output=True)
398
399 def _run_sub_test(self, test):
400- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
401+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld', 'xfstests-dev'))
402 output = utils.system_output('./check %s' % test,
403 ignore_status=True,
404 retain_output=True)
405@@ -135,10 +127,11 @@ class ubuntu_xfstests_xfs(test.test):
406
407
408 def _run_suite(self):
409- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
410- output = utils.system_output('./check -g auto -x dangerous',
411- ignore_status=True,
412- retain_output=True)
413+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld', 'xfstests-dev'))
414+ # Unlike btrfs and ext4, thers is no exclusion file for xfs
415+ utils.system_output('./check -g auto -x dangerous',
416+ ignore_status=True,
417+ retain_output=True)
418
419 def initialize(self):
420 pass
421@@ -152,22 +145,6 @@ class ubuntu_xfstests_xfs(test.test):
422 utils.system_output('useradd -m fsgqa || true', retain_output=True)
423 utils.system_output('grep -q fsgqa /etc/sudoers || echo \"fsgqa ALL=(ALL)NOPASSWD: ALL\" >> /etc/sudoers', retain_output=True)
424
425- #
426- # Anticipate failures due to missing devel tools, libraries, headers
427- # and xfs commands
428- #
429- os_dep.command('autoconf')
430- os_dep.command('autoheader')
431- os_dep.command('libtool')
432- os_dep.library('libuuid.so.1')
433- #os_dep.header('xfs/xfs.h')
434- #os_dep.header('attr/xattr.h')
435- #os_dep.header('sys/acl.h')
436- os_dep.command('mkfs.xfs')
437- os_dep.command('xfs_db')
438- os_dep.command('xfs_bmap')
439- os_dep.command('xfsdump')
440-
441 self.job.require_gcc()
442
443 canonical.setup_proxy()
444@@ -176,34 +153,16 @@ class ubuntu_xfstests_xfs(test.test):
445 os.chdir(self.srcdir)
446 shutil.rmtree('xfstests-bld', ignore_errors=True)
447 utils.system('git clone https://github.com/tytso/xfstests-bld')
448+
449 os.chdir(os.path.join(self.srcdir, 'xfstests-bld'))
450- commit_bld = 'a4df7d7b31125901cb1fe9b092f495b6aa950448'
451+ commit_bld = '8672804daa67855739592070e1732991179c2ba9'
452 print("Using head commit for xfstests-bld " + commit_bld)
453 utils.system('git reset --hard ' + commit_bld)
454- # print("Patching xfstests-bld to add ARM64 xattr syscall support")
455- # utils.system('patch -p1 < %s/0004-Add-syscalls-for-ARM64-platforms-LP-1755499.patch' % self.bindir)
456- #
457- # Fix build link issues with newer toolchains (this is an ugly hack)
458- #
459- if float(platform.linux_distribution()[1]) > 18.04:
460- print("Patching xfstest-blkd to fix static linking issue")
461- utils.system('patch -p1 < %s/0005-build-all-remove-static-linking-flags-to-fix-build-i.patch' % self.bindir)
462- print("Fetching all repos..")
463- utils.system('./get-all')
464
465- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
466- commit = '82eda8820ddd68dab0bc35199a53a08f58b1d26c'
467- print("Using xfs from known stable commit point " + commit)
468- utils.system('git reset --hard ' + commit)
469- print("Patching xfstests..")
470- os.chdir(os.path.join(self.srcdir, 'xfstests-bld'))
471- print("Building xfstests")
472- utils.system('pwd')
473- try:
474- nprocs = '-j' + str(multiprocessing.cpu_count())
475- except:
476- nprocs = ''
477- utils.make(nprocs)
478+ print("Building tests...")
479+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld'))
480+ utils.system('./get-all')
481+ utils.system('./build-all')
482
483 logging.debug("Available tests in srcdir: %s" %
484 ", ".join(self._get_available_tests()))
485@@ -213,10 +172,10 @@ class ubuntu_xfstests_xfs(test.test):
486 return utils.system('/bin/bash %s/create-test-partitions %s %s' % (self.bindir, os.environ['XFSTESTS_TEST_DRIVE'], filesystem))
487
488 def unmount_partitions(self):
489- for mnt_point in [ os.environ['SCRATCH_MNT'], os.environ['TEST_DIR'] ]:
490+ for mnt_point in [os.environ['SCRATCH_MNT'], os.environ['TEST_DIR']]:
491 utils.system('umount %s' % mnt_point, ignore_status=True)
492
493- def run_once(self, test_name, filesystem='ext4', test_number='000', single=False, skip_dangerous=True):
494+ def run_once(self, test_name, filesystem='xfs', test_number='000', single=False, skip_dangerous=True):
495 if test_name == 'setup':
496 return
497
498diff --git a/ubuntu_zfs_xfs_generic/0001-xfstests-add-minimal-support-for-zfs.patch b/ubuntu_zfs_xfs_generic/0001-xfstests-add-minimal-support-for-zfs.patch
499index ca4a5eb..94fd488 100644
500--- a/ubuntu_zfs_xfs_generic/0001-xfstests-add-minimal-support-for-zfs.patch
501+++ b/ubuntu_zfs_xfs_generic/0001-xfstests-add-minimal-support-for-zfs.patch
502@@ -1,10 +1,10 @@
503-From 4d06185605e6c99c7b51ede23390b7fc268fc748 Mon Sep 17 00:00:00 2001
504+From 42147099e0c628882cab36127bd09d371ffd74ab Mon Sep 17 00:00:00 2001
505 From: Po-Hsu Lin <po-hsu.lin@canonical.com>
506-Date: Wed, 18 Sep 2019 16:28:42 +0000
507+Date: Thu, 16 Mar 2023 16:10:48 +0000
508 Subject: [PATCH] xfstests: add minimal support for zfs
509
510 Patch created based on Colin Ian King's commit bb18b1b9 in autotest-client-tests.
511-Reworked to make it comply with the lastest xfstest-dev commit 204860fa.
512+Reworked to make it comply with the lastest xfstest-dev commit b90914df.
513
514 Currently the following tests work:
515
516@@ -155,34 +155,35 @@ common/* scripts:
517
518 Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
519 ---
520- check | 2 ++
521- common/attr | 7 +++++--
522+ check | 3 ++-
523+ common/attr | 3 +++
524 common/config | 4 ++++
525 common/rc | 22 ++++++++++++++++++++++
526- 4 files changed, 33 insertions(+), 2 deletions(-)
527+ 4 files changed, 31 insertions(+), 1 deletion(-)
528
529 diff --git a/check b/check
530-index 3d6a64cd..5970bf16 100755
531+index 0bf5b22e..e9979475 100755
532 --- a/check
533 +++ b/check
534-@@ -60,6 +60,7 @@ check options
535- -pvfs2 test PVFS2
536- -tmpfs test TMPFS
537- -ubifs test ubifs
538-+ -zfs test zfs
539+@@ -66,6 +66,7 @@ check options
540+ -pvfs2 test PVFS2
541+ -tmpfs test TMPFS
542+ -ubifs test ubifs
543++ -zfs test zfs
544 -l line mode diff
545 -udiff show unified diff (default)
546 -n show me, do not run tests
547-@@ -272,6 +273,7 @@ while [ $# -gt 0 ]; do
548- -pvfs2) FSTYP=pvfs2 ;;
549- -tmpfs) FSTYP=tmpfs ;;
550- -ubifs) FSTYP=ubifs ;;
551-+ -zfs) FSTYP=zfs ;;
552+@@ -280,7 +281,7 @@ while [ $# -gt 0 ]; do
553+ case "$1" in
554+ -\? | -h | --help) usage ;;
555
556- -g) group=$2 ; shift ;
557- GROUP_LIST="$GROUP_LIST ${group//,/ }"
558+- -nfs|-glusterfs|-cifs|-9p|-fuse|-virtiofs|-pvfs2|-tmpfs|-ubifs)
559++ -nfs|-glusterfs|-cifs|-9p|-fuse|-virtiofs|-pvfs2|-tmpfs|-ubifs|-zfs)
560+ FSTYP="${1:1}"
561+ ;;
562+ -overlay)
563 diff --git a/common/attr b/common/attr
564-index 20049de0..d6e543b9 100644
565+index cce4d1b2..b89d17b7 100644
566 --- a/common/attr
567 +++ b/common/attr
568 @@ -25,6 +25,9 @@ _acl_get_max()
569@@ -193,62 +194,35 @@ index 20049de0..d6e543b9 100644
570 + echo 1024
571 + ;;
572 f2fs)
573- _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1
574- if [ $? -eq 0 ]; then
575-@@ -238,7 +241,7 @@ _getfattr()
576-
577- # set maximum total attr space based on fs type
578- case "$FSTYP" in
579--xfs|udf|pvfs2|9p|ceph)
580-+xfs|udf|pvfs2|9p|ceph|zfs)
581- MAX_ATTRS=1000
582- ;;
583- *)
584-@@ -252,7 +255,7 @@ export MAX_ATTRS
585-
586- # Set max attr value size based on fs type
587- case "$FSTYP" in
588--xfs|udf|btrfs)
589-+xfs|udf|btrfs|zfs)
590- MAX_ATTRVAL_SIZE=64
591- ;;
592- pvfs2)
593+ # If noinline_xattr is enabled, max xattr size should be:
594+ # (4096 - 24) - (24 + 4) = 4044
595 diff --git a/common/config b/common/config
596-index 4c86a492..97dc96e9 100644
597+index 6c8cb3a5..a987d4a3 100644
598 --- a/common/config
599 +++ b/common/config
600-@@ -362,6 +362,8 @@ _test_mount_opts()
601- # acls & xattrs aren't turned on by default on older ext$FOO
602- export TEST_FS_MOUNT_OPTS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
603+@@ -391,6 +391,8 @@ _common_mount_opts()
604+ ubifs)
605+ echo $UBIFS_MOUNT_OPTIONS
606 ;;
607 + zfs)
608 + ;;
609 *)
610 ;;
611 esac
612-@@ -478,6 +480,8 @@ _check_device()
613+@@ -588,6 +590,8 @@ _check_device()
614 fi
615
616 case "$FSTYP" in
617 + zfs)
618-+ ;;
619- 9p|tmpfs)
620- # 9p mount tags are just plain strings, so anything is allowed
621++ ;;
622+ 9p|fuse|tmpfs|virtiofs)
623+ # 9p, fuse and virtiofs mount tags are just plain strings, so anything is allowed
624 # tmpfs doesn't use mount source, ignore
625 diff --git a/common/rc b/common/rc
626-index 66c7fd4d..51c4f36e 100644
627+index 6852af79..600b0617 100644
628 --- a/common/rc
629 +++ b/common/rc
630-@@ -153,6 +153,8 @@ case "$FSTYP" in
631- reiser4)
632- [ "$MKFS_REISER4_PROG" = "" ] && _fatal "mkfs.reiser4 not found"
633- ;;
634-+ zfs)
635-+ ;;
636- pvfs2)
637- ;;
638- ubifs)
639-@@ -624,6 +626,9 @@ _test_mkfs()
640+@@ -602,6 +602,9 @@ _test_mkfs()
641 ext2|ext3|ext4)
642 $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
643 ;;
644@@ -258,17 +232,17 @@ index 66c7fd4d..51c4f36e 100644
645 *)
646 yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
647 ;;
648-@@ -656,6 +661,9 @@ _mkfs_dev()
649- $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* \
650- 2>$tmp.mkfserr 1>$tmp.mkfsstd
651+@@ -638,6 +641,9 @@ _try_mkfs_dev()
652+ ext2|ext3|ext4)
653+ $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $*
654 ;;
655 + zfs)
656 + # do nothing for zfs
657 + ;;
658 xfs)
659- $MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* \
660- 2>$tmp.mkfserr 1>$tmp.mkfsstd
661-@@ -757,6 +765,10 @@ _scratch_mkfs()
662+ $MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $*
663+ ;;
664+@@ -741,6 +747,10 @@ _scratch_mkfs()
665 mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --"
666 mkfs_filter="grep -v -e ^mkfs\.ocfs2"
667 ;;
668@@ -279,7 +253,16 @@ index 66c7fd4d..51c4f36e 100644
669 *)
670 mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --"
671 mkfs_filter="cat"
672-@@ -1534,6 +1546,8 @@ _require_scratch_nocheck()
673+@@ -1034,6 +1044,8 @@ _scratch_mkfs_sized()
674+ bcachefs)
675+ $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS --fs_size=$fssize --block_size=$blocksize $SCRATCH_DEV
676+ ;;
677++ zfs)
678++ ;;
679+ *)
680+ _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
681+ ;;
682+@@ -1663,6 +1675,8 @@ _require_scratch_nocheck()
683 _notrun "this test requires a valid \$SCRATCH_MNT"
684 fi
685 ;;
686@@ -288,7 +271,7 @@ index 66c7fd4d..51c4f36e 100644
687 *)
688 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev "$SCRATCH_DEV"`" = "" ]
689 then
690-@@ -1640,6 +1654,11 @@ _require_test()
691+@@ -1847,6 +1861,11 @@ _require_test()
692 _notrun "this test requires a valid \$TEST_DIR"
693 fi
694 ;;
695@@ -300,7 +283,7 @@ index 66c7fd4d..51c4f36e 100644
696 tmpfs)
697 if [ -z "$TEST_DEV" -o ! -d "$TEST_DIR" ];
698 then
699-@@ -2712,6 +2731,9 @@ _check_test_fs()
700+@@ -3171,6 +3190,9 @@ _check_test_fs()
701 tmpfs)
702 # no way to check consistency for tmpfs
703 ;;
704@@ -312,3 +295,4 @@ index 66c7fd4d..51c4f36e 100644
705 ;;
706 --
707 2.17.1
708+
709diff --git a/ubuntu_zfs_xfs_generic/blacklist.vivid b/ubuntu_zfs_xfs_generic/blacklist.vivid
710deleted file mode 100644
711index d00491f..0000000
712--- a/ubuntu_zfs_xfs_generic/blacklist.vivid
713+++ /dev/null
714@@ -1 +0,0 @@
715-1
716diff --git a/ubuntu_zfs_xfs_generic/ubuntu_zfs_xfs_generic.py b/ubuntu_zfs_xfs_generic/ubuntu_zfs_xfs_generic.py
717index 8fff91a..0d3b8f2 100644
718--- a/ubuntu_zfs_xfs_generic/ubuntu_zfs_xfs_generic.py
719+++ b/ubuntu_zfs_xfs_generic/ubuntu_zfs_xfs_generic.py
720@@ -11,7 +11,7 @@ class ubuntu_zfs_xfs_generic(test.test):
721 version = 5
722
723 def install_required_pkgs(self):
724- arch = platform.processor()
725+ arch = platform.processor()
726 try:
727 series = platform.dist()[2]
728 except AttributeError:
729@@ -22,33 +22,20 @@ class ubuntu_zfs_xfs_generic(test.test):
730 'acl',
731 'attr',
732 'autoconf',
733- 'automake',
734 'autopoint',
735 'bc',
736 'build-essential',
737- 'dbench',
738- 'dump',
739- 'e2fsprogs',
740- 'fio',
741- 'gawk',
742- 'gdb',
743+ 'debootstrap',
744 'gettext',
745- 'git',
746- 'kpartx',
747- 'ksh',
748- 'libtool',
749- 'patchutils',
750- 'pax',
751- 'pkg-config',
752- 'texinfo',
753- 'texlive',
754- 'quota',
755- 'git',
756 'libblkid-dev',
757+ 'libicu-dev',
758 'libssl-dev',
759- 'xfsprogs'
760+ 'libtool',
761+ 'patchutils',
762+ 'pkgconf',
763+ 'uuid-dev'
764 ]
765- gcc = 'gcc' if arch in ['ppc64le', 'aarch64', 's390x', 'riscv64' ] else 'gcc-multilib'
766+ gcc = 'gcc' if arch in ['ppc64le', 'aarch64', 's390x', 'riscv64'] else 'gcc-multilib'
767 pkgs.append(gcc)
768
769 if series in ['precise', 'trusty']:
770@@ -83,49 +70,41 @@ class ubuntu_zfs_xfs_generic(test.test):
771 utils.system('git clone https://github.com/tytso/xfstests-bld')
772
773 os.chdir(os.path.join(self.srcdir, 'xfstests-bld'))
774- commit_bld = 'a4df7d7b31125901cb1fe9b092f495b6aa950448'
775+ commit_bld = '8672804daa67855739592070e1732991179c2ba9'
776 print("Using head commit for xfstests-bld " + commit_bld)
777 utils.system('git reset --hard ' + commit_bld)
778
779- # print("Patching xfstests-bld to add ARM64 xattr syscall support")
780- # utils.system('patch -p1 < %s/0004-Add-syscalls-for-ARM64-platforms-LP-1755499.patch' % self.bindir)
781- print("Fetching all repos..")
782+ print("Building tests...")
783+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld'))
784 utils.system('./get-all')
785+ utils.system('./build-all')
786
787- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
788- commit = "82eda8820ddd68dab0bc35199a53a08f58b1d26c"
789- print("Using xfs from known stable commit point " + commit)
790- utils.system('git reset --hard ' + commit)
791+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld', 'xfstests-dev'))
792 print("Patching xfstests-dev to add minimal support for ZFS")
793 utils.system('patch -p1 < %s/0001-xfstests-add-minimal-support-for-zfs.patch' % self.bindir)
794- print("Patching xfstests-dev: fix warning with Awk 5.0.1")
795- utils.system('patch -p1 < %s/0006-generic-001-remove-unnecessary-backslash.patch' % self.bindir)
796- print("Running autoreconf --install")
797- utils.system('autoreconf --install')
798-
799- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfsprogs-dev'))
800- print("Patching xfstests-dev: fix linker issues with modern gcc")
801- utils.system('patch -p1 < %s/0007-Fix-linker-issues-with-clashing-objects.patch' % self.bindir)
802-
803- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fio'))
804- print("Patching fio: fix linker issues with modern gcc")
805- utils.system('patch -p1 < %s/0008-Fix-linker-issues-by-making-tsc_reliable-a-weak-refe.patch' % self.bindir)
806- print("Patch out raw support")
807- utils.system('patch -p1 < %s/382975557e632efb506836bc1709789e615c9094.patch' % self.bindir)
808-
809-# os.chdir(os.path.join(self.srcdir, 'xfstests-bld'))
810-# print("getting xfs tests source")
811-# utils.system('./get-all')
812-
813-# os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfsprogs-dev'))
814-# print("Patching xfsprogs-dev to disable blkid")
815-# utils.system('patch -p1 < %s/0005-Disable-blkid-by-setting-enable_blkid-no.patch' % self.bindir)
816-#
817- os.chdir(os.path.join(self.srcdir, 'xfstests-bld'))
818- print("Building xfstests")
819- utils.system('./build-all')
820+
821 utils.system('modprobe zfs')
822
823+# os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
824+# commit = "82eda8820ddd68dab0bc35199a53a08f58b1d26c"
825+# print("Using xfs from known stable commit point " + commit)
826+# utils.system('git reset --hard ' + commit)
827+# print("Patching xfstests-dev: fix warning with Awk 5.0.1")
828+# utils.system('patch -p1 < %s/0006-generic-001-remove-unnecessary-backslash.patch' % self.bindir)
829+# print("Running autoreconf --install")
830+# utils.system('autoreconf --install')
831+#
832+# os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfsprogs-dev'))
833+# print("Patching xfstests-dev: fix linker issues with modern gcc")
834+# utils.system('patch -p1 < %s/0007-Fix-linker-issues-with-clashing-objects.patch' % self.bindir)
835+#
836+# os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fio'))
837+# print("Patching fio: fix linker issues with modern gcc")
838+# utils.system('patch -p1 < %s/0008-Fix-linker-issues-by-making-tsc_reliable-a-weak-refe.patch' % self.bindir)
839+# print("Patch out raw support")
840+# utils.system('patch -p1 < %s/382975557e632efb506836bc1709789e615c9094.patch' % self.bindir)
841+
842+
843 def run_once(self, test_name):
844 #
845 # We need to call setup first to trigger setup() being
846@@ -133,7 +112,7 @@ class ubuntu_zfs_xfs_generic(test.test):
847 #
848 if test_name == 'setup':
849 return
850- elif test_name == 'post-test-zfs-cleanup':
851+ if test_name == 'post-test-zfs-cleanup':
852 # Make sure there is no ZFS in use by any filesystem
853 try:
854 utils.system('df -t zfs &> /dev/null') # return 1 if not found
855@@ -149,11 +128,9 @@ class ubuntu_zfs_xfs_generic(test.test):
856 utils.system(cmd)
857 return
858
859- os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'xfstests-dev'))
860+ os.chdir(os.path.join(self.srcdir, 'xfstests-bld', 'fstests-bld', 'xfstests-dev'))
861 cmd = '%s/ubuntu_zfs_xfs_generic.sh %s %s' % (self.bindir, test_name, self.srcdir)
862 print("Running: " + cmd)
863 self.results = utils.system_output(cmd, retain_output=True)
864- print(self.results)
865- print("Done!")
866
867 # vi:set ts=4 sw=4 expandtab syntax=python:

Subscribers

People subscribed via source and target branches

to all changes: