0001-tests-cp_files-ignore-if-SEEK_DATA-is-not-defined.patch 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. From 93e7f8889072047276da11fe6a525d3f0ea16205 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Jos=C3=A9=20Luis=20Salvador=20Rufo?=
  3. <salvador.joseluis@gmail.com>
  4. Date: Sat, 11 May 2024 22:40:12 +0200
  5. Subject: [PATCH] tests/cp_files: ignore if SEEK_DATA is not defined
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. Not all C libraries support SEEK_DATA (e.g., uClibc). Skip the test case
  10. cp_files if SEEK_DATA is not defined.
  11. Signed-off-by: José Luis Salvador Rufo <salvador.joseluis@gmail.com>
  12. Upstream: https://github.com/openzfs/zfs/pull/16169
  13. ---
  14. config/user-unistd.m4 | 24 ++++++++++++++++++++++++
  15. config/user.m4 | 1 +
  16. config/zfs-build.m4 | 1 +
  17. tests/test-runner/bin/zts-report.py.in | 1 +
  18. tests/zfs-tests/Makefile.am | 2 ++
  19. tests/zfs-tests/cmd/Makefile.am | 6 +++++-
  20. tests/zfs-tests/tests/Makefile.am | 14 +++++++++-----
  21. 7 files changed, 43 insertions(+), 6 deletions(-)
  22. create mode 100644 config/user-unistd.m4
  23. diff --git a/config/user-unistd.m4 b/config/user-unistd.m4
  24. new file mode 100644
  25. index 000000000..302bc0bde
  26. --- /dev/null
  27. +++ b/config/user-unistd.m4
  28. @@ -0,0 +1,24 @@
  29. +dnl #
  30. +dnl # Check for SEEK_DATA - only used for cp_files/seekflood test case.
  31. +dnl #
  32. +AC_DEFUN([ZFS_AC_CONFIG_USER_UNISTD_SEEK_DATA], [
  33. + AC_MSG_CHECKING(whether host toolchain supports SEEK_DATA)
  34. +
  35. + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  36. + #ifndef _GNU_SOURCE
  37. + #define _GNU_SOURCE
  38. + #endif
  39. + #include <unistd.h>
  40. + #if defined(SEEK_DATA)
  41. + int ok;
  42. + #else
  43. + error fail
  44. + #endif
  45. + ]])], [
  46. + user_unistd_seek_data=yes
  47. + AC_MSG_RESULT([yes])
  48. + ], [
  49. + user_unistd_seek_data=no
  50. + AC_MSG_RESULT([no])
  51. + ])
  52. +])
  53. diff --git a/config/user.m4 b/config/user.m4
  54. index 6ec27a5b2..2326a44be 100644
  55. --- a/config/user.m4
  56. +++ b/config/user.m4
  57. @@ -23,6 +23,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
  58. ZFS_AC_CONFIG_USER_LIBAIO
  59. ZFS_AC_CONFIG_USER_LIBATOMIC
  60. ZFS_AC_CONFIG_USER_LIBFETCH
  61. + ZFS_AC_CONFIG_USER_UNISTD_SEEK_DATA
  62. ZFS_AC_CONFIG_USER_AIO_H
  63. ZFS_AC_CONFIG_USER_CLOCK_GETTIME
  64. ZFS_AC_CONFIG_USER_PAM
  65. diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
  66. index bb5a85d81..578692676 100644
  67. --- a/config/zfs-build.m4
  68. +++ b/config/zfs-build.m4
  69. @@ -294,6 +294,7 @@ AC_DEFUN([ZFS_AC_CONFIG], [
  70. [test "x$qatsrc" != x ])
  71. AM_CONDITIONAL([WANT_DEVNAME2DEVID], [test "x$user_libudev" = xyes ])
  72. AM_CONDITIONAL([WANT_MMAP_LIBAIO], [test "x$user_libaio" = xyes ])
  73. + AM_CONDITIONAL([WANT_UNISTD_SEEK_DATA], [test "x$user_unistd_seek_data" = xyes ])
  74. AM_CONDITIONAL([PAM_ZFS_ENABLED], [test "x$enable_pam" = xyes])
  75. ])
  76. diff --git a/tests/test-runner/bin/zts-report.py.in b/tests/test-runner/bin/zts-report.py.in
  77. index ecc50f487..3a00345ed 100755
  78. --- a/tests/test-runner/bin/zts-report.py.in
  79. +++ b/tests/test-runner/bin/zts-report.py.in
  80. @@ -162,6 +162,7 @@ known = {
  81. ['FAIL', rewind_reason],
  82. 'cli_user/misc/zfs_share_001_neg': ['SKIP', na_reason],
  83. 'cli_user/misc/zfs_unshare_001_neg': ['SKIP', na_reason],
  84. + 'cp_files/cp_stress': ['SKIP', 16169],
  85. 'pool_checkpoint/checkpoint_discard_busy': ['SKIP', 12053],
  86. 'privilege/setup': ['SKIP', na_reason],
  87. 'refreserv/refreserv_004_pos': ['FAIL', known_reason],
  88. diff --git a/tests/zfs-tests/Makefile.am b/tests/zfs-tests/Makefile.am
  89. index 3dd1a6452..8ae790057 100644
  90. --- a/tests/zfs-tests/Makefile.am
  91. +++ b/tests/zfs-tests/Makefile.am
  92. @@ -13,8 +13,10 @@ scripts_zfs_tests_functional_hkdf_PROGRAMS = %D%/tests/functional/hkdf/hkdf_test
  93. %C%_tests_functional_hkdf_hkdf_test_LDADD = \
  94. libzpool.la
  95. +if WANT_UNISTD_SEEK_DATA
  96. scripts_zfs_tests_functional_cp_filesdir = $(datadir)/$(PACKAGE)/zfs-tests/tests/functional/cp_files
  97. scripts_zfs_tests_functional_cp_files_PROGRAMS = %D%/tests/functional/cp_files/seekflood
  98. +endif
  99. if BUILD_LINUX
  100. scripts_zfs_tests_functional_tmpfiledir = $(datadir)/$(PACKAGE)/zfs-tests/tests/functional/tmpfile
  101. diff --git a/tests/zfs-tests/cmd/Makefile.am b/tests/zfs-tests/cmd/Makefile.am
  102. index 23848a82f..69bba3039 100644
  103. --- a/tests/zfs-tests/cmd/Makefile.am
  104. +++ b/tests/zfs-tests/cmd/Makefile.am
  105. @@ -5,7 +5,6 @@ scripts_zfs_tests_bin_PROGRAMS = %D%/chg_usr_exec
  106. scripts_zfs_tests_bin_PROGRAMS += %D%/clonefile
  107. scripts_zfs_tests_bin_PROGRAMS += %D%/clone_mmap_cached
  108. scripts_zfs_tests_bin_PROGRAMS += %D%/clone_mmap_write
  109. -scripts_zfs_tests_bin_PROGRAMS += %D%/cp_files
  110. scripts_zfs_tests_bin_PROGRAMS += %D%/ctime
  111. scripts_zfs_tests_bin_PROGRAMS += %D%/dir_rd_update
  112. scripts_zfs_tests_bin_PROGRAMS += %D%/dosmode_readonly_write
  113. @@ -16,6 +15,11 @@ scripts_zfs_tests_bin_PROGRAMS += %D%/truncate_test
  114. scripts_zfs_tests_bin_PROGRAMS += %D%/zfs_diff-socket
  115. +if WANT_UNISTD_SEEK_DATA
  116. +scripts_zfs_tests_bin_PROGRAMS += %D%/cp_files
  117. +endif
  118. +
  119. +
  120. scripts_zfs_tests_bin_PROGRAMS += %D%/badsend
  121. %C%_badsend_LDADD = \
  122. libzfs_core.la \
  123. diff --git a/tests/zfs-tests/tests/Makefile.am b/tests/zfs-tests/tests/Makefile.am
  124. index cc66d762f..1e9f06a7e 100644
  125. --- a/tests/zfs-tests/tests/Makefile.am
  126. +++ b/tests/zfs-tests/tests/Makefile.am
  127. @@ -1394,11 +1394,6 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
  128. functional/compression/l2arc_encrypted.ksh \
  129. functional/compression/l2arc_encrypted_no_compressed_arc.ksh \
  130. functional/compression/setup.ksh \
  131. - functional/cp_files/cleanup.ksh \
  132. - functional/cp_files/cp_files_001_pos.ksh \
  133. - functional/cp_files/cp_files_002_pos.ksh \
  134. - functional/cp_files/cp_stress.ksh \
  135. - functional/cp_files/setup.ksh \
  136. functional/crtime/cleanup.ksh \
  137. functional/crtime/crtime_001_pos.ksh \
  138. functional/crtime/setup.ksh \
  139. @@ -2108,3 +2103,12 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
  140. functional/idmap_mount/idmap_mount_003.ksh \
  141. functional/idmap_mount/idmap_mount_004.ksh \
  142. functional/idmap_mount/idmap_mount_005.ksh
  143. +
  144. +if WANT_UNISTD_SEEK_DATA
  145. +nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
  146. + functional/cp_files/cleanup.ksh \
  147. + functional/cp_files/cp_files_001_pos.ksh \
  148. + functional/cp_files/cp_files_002_pos.ksh \
  149. + functional/cp_files/cp_stress.ksh \
  150. + functional/cp_files/setup.ksh
  151. +endif
  152. --
  153. 2.45.2