diff options
author | Arvind Sankar <[email protected]> | 2020-07-11 19:35:58 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2020-07-14 17:33:44 -0700 |
commit | 38e2e9ce8327284b2d516874308300aa96102fe9 (patch) | |
tree | 0761f7f696e4da7888a0c99ffb3a91a63ecefdd4 /tests | |
parent | bdb518c13abb9eca8d6f8f1d9e2096dc5163a9e7 (diff) |
Centralize variable substitution
A bunch of places need to edit files to incorporate the configured paths
i.e. bindir, sbindir etc. Move this logic into a common file.
Create arc_summary by copying arc_summary[23] as appropriate at build
time instead of install time.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Arvind Sankar <[email protected]>
Closes #10559
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-runner/bin/.gitignore | 2 | ||||
-rw-r--r-- | tests/test-runner/bin/Makefile.am | 17 | ||||
-rwxr-xr-x | tests/test-runner/bin/test-runner.py.in (renamed from tests/test-runner/bin/test-runner.py) | 2 | ||||
-rwxr-xr-x | tests/test-runner/bin/zts-report.py.in (renamed from tests/test-runner/bin/zts-report.py) | 3 | ||||
-rw-r--r-- | tests/zfs-tests/include/Makefile.am | 12 | ||||
-rw-r--r-- | tests/zfs-tests/include/commands.cfg | 1 | ||||
-rw-r--r-- | tests/zfs-tests/tests/functional/pyzfs/Makefile.am | 16 |
7 files changed, 15 insertions, 38 deletions
diff --git a/tests/test-runner/bin/.gitignore b/tests/test-runner/bin/.gitignore new file mode 100644 index 000000000..ff7e2f8fc --- /dev/null +++ b/tests/test-runner/bin/.gitignore @@ -0,0 +1,2 @@ +test-runner.py +zts-report.py diff --git a/tests/test-runner/bin/Makefile.am b/tests/test-runner/bin/Makefile.am index 09032ba68..e11e55fff 100644 --- a/tests/test-runner/bin/Makefile.am +++ b/tests/test-runner/bin/Makefile.am @@ -1,15 +1,8 @@ +include $(top_srcdir)/config/Substfiles.am + pkgdatadir = $(datadir)/@PACKAGE@/test-runner/bin -dist_pkgdata_SCRIPTS = \ +pkgdata_SCRIPTS = \ test-runner.py \ zts-report.py -# -# These scripts are compatible with both Python 2.6 and 3.4. As such the -# python 3 shebang can be replaced at install time when targeting a python -# 2 system. This allows us to maintain a single version of the source. -# -if USING_PYTHON_2 -install-data-hook: - $(SED) ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \ - $(DESTDIR)$(pkgdatadir)/test-runner.py \ - $(DESTDIR)$(pkgdatadir)/zts-report.py -endif + +SUBSTFILES += $(pkgdata_SCRIPTS) diff --git a/tests/test-runner/bin/test-runner.py b/tests/test-runner/bin/test-runner.py.in index 7740739dd..bbabf247c 100755 --- a/tests/test-runner/bin/test-runner.py +++ b/tests/test-runner/bin/test-runner.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env @PYTHON_SHEBANG@ # # This file and its contents are supplied under the terms of the diff --git a/tests/test-runner/bin/zts-report.py b/tests/test-runner/bin/zts-report.py.in index 78ce291b7..c68325a15 100755 --- a/tests/test-runner/bin/zts-report.py +++ b/tests/test-runner/bin/zts-report.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env @PYTHON_SHEBANG@ # # This file and its contents are supplied under the terms of the @@ -205,7 +205,6 @@ maybe = { 'cli_root/zpool_import/zpool_import_missing_003_pos': ['SKIP', '6839'], 'cli_root/zpool_trim/setup': ['SKIP', trim_reason], 'cli_root/zpool_upgrade/zpool_upgrade_004_pos': ['FAIL', '6141'], - 'cli_user/misc/arc_summary3_001_pos': ['SKIP', python_reason], 'delegate/setup': ['SKIP', exec_reason], 'history/history_004_pos': ['FAIL', '7026'], 'history/history_005_neg': ['FAIL', '6680'], diff --git a/tests/zfs-tests/include/Makefile.am b/tests/zfs-tests/include/Makefile.am index 5e9a4f386..16cdf2c81 100644 --- a/tests/zfs-tests/include/Makefile.am +++ b/tests/zfs-tests/include/Makefile.am @@ -1,3 +1,5 @@ +include $(top_srcdir)/config/Substfiles.am + pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/include dist_pkgdata_DATA = \ blkdev.shlib \ @@ -8,13 +10,5 @@ dist_pkgdata_DATA = \ tunables.cfg \ zpool_script.shlib -EXTRA_DIST = default.cfg.in - nodist_pkgdata_DATA = default.cfg - -$(nodist_pkgdata_DATA): %: %.in - -$(SED) -e 's,@zfsexecdir\@,$(zfsexecdir),g' \ - -e 's,@sysconfdir\@,$(sysconfdir),g' \ - $< >'$@' - -CLEANFILES = default.cfg +SUBSTFILES += $(nodist_pkgdata_DATA) diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg index b27b8d5c6..21fe0df9e 100644 --- a/tests/zfs-tests/include/commands.cfg +++ b/tests/zfs-tests/include/commands.cfg @@ -178,7 +178,6 @@ export ZFS_FILES='zdb ztest raidz_test arc_summary - arc_summary3 arcstat dbufstat zed diff --git a/tests/zfs-tests/tests/functional/pyzfs/Makefile.am b/tests/zfs-tests/tests/functional/pyzfs/Makefile.am index f7aa56b95..26c5ac595 100644 --- a/tests/zfs-tests/tests/functional/pyzfs/Makefile.am +++ b/tests/zfs-tests/tests/functional/pyzfs/Makefile.am @@ -1,17 +1,7 @@ +include $(top_srcdir)/config/Substfiles.am + pkgpyzfsdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/pyzfs pkgpyzfs_SCRIPTS = \ pyzfs_unittest.ksh -EXTRA_DIST = \ - pyzfs_unittest.ksh.in - -# -# The pyzfs module is built either for Python 2 or Python 3. In order -# to properly test it the unit tests must be updated to the matching version. -# -$(pkgpyzfs_SCRIPTS):%:%.in - -$(SED) -e 's,@PYTHON\@,$(PYTHON),g' \ - $< >'$@' - -chmod 775 $@ - -CLEANFILES = $(pkgpyzfs_SCRIPTS) +SUBSTFILES += $(pkgpyzfs_SCRIPTS) |