diff options
author | Brian Behlendorf <[email protected]> | 2020-07-19 09:56:21 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-19 09:56:21 -0700 |
commit | e862b7ecfc6049df19cf0d439510f385a7707b8b (patch) | |
tree | 0522c698a48c711d37e3a1c0e7bbbb222f9e7c53 /tests | |
parent | 8fbf432ae274fc227c38012230c3bf23bda64d64 (diff) |
Linux 4.10 compat: has_capability()
Stock kernels older than 4.10 do not export the has_capability()
function which is required by commit e59a377. To avoid breaking
the build on older kernels revert to the safe legacy behavior and
return EACCES when privileges cannot be checked.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Matt Ahrens <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #10565
Closes #10573
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test-runner/bin/zts-report.py.in | 2 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/limits/filesystem_limit.ksh | 12 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/limits/snapshot_limit.ksh | 12 |
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/test-runner/bin/zts-report.py.in b/tests/test-runner/bin/zts-report.py.in index a2d81ceda..51e6e52db 100755 --- a/tests/test-runner/bin/zts-report.py.in +++ b/tests/test-runner/bin/zts-report.py.in @@ -263,6 +263,8 @@ elif sys.platform.startswith('linux'): 'cli_root/zpool_expand/zpool_expand_001_pos': ['FAIL', known_reason], 'cli_root/zpool_expand/zpool_expand_005_pos': ['FAIL', known_reason], 'cli_root/zpool_reopen/zpool_reopen_003_pos': ['FAIL', known_reason], + 'limits/filesystem_limit': ['SKIP', known_reason], + 'limits/snapshot_limit': ['SKIP', known_reason], 'refreserv/refreserv_raidz': ['FAIL', known_reason], 'rsend/rsend_007_pos': ['FAIL', known_reason], 'rsend/rsend_010_pos': ['FAIL', known_reason], diff --git a/tests/zfs-tests/tests/functional/limits/filesystem_limit.ksh b/tests/zfs-tests/tests/functional/limits/filesystem_limit.ksh index cd1e054bf..fbfc141be 100755 --- a/tests/zfs-tests/tests/functional/limits/filesystem_limit.ksh +++ b/tests/zfs-tests/tests/functional/limits/filesystem_limit.ksh @@ -30,6 +30,18 @@ verify_runnable "both" +# +# The has_capability() function was first exported in the 4.10 Linux kernel +# then backported to some LTS kernels. Prior to this change there was no +# mechanism to perform the needed permission check. Therefore, this test +# is expected to fail on older kernels and is skipped. +# +if is_linux; then + if [[ $(linux_version) -lt $(linux_version "4.10") ]]; then + log_unsupported "Requires has_capability() kernel function" + fi +fi + function setup { # We can't delegate 'mount' privs under Linux: to avoid issues with diff --git a/tests/zfs-tests/tests/functional/limits/snapshot_limit.ksh b/tests/zfs-tests/tests/functional/limits/snapshot_limit.ksh index 860a0da92..62f14466e 100755 --- a/tests/zfs-tests/tests/functional/limits/snapshot_limit.ksh +++ b/tests/zfs-tests/tests/functional/limits/snapshot_limit.ksh @@ -31,6 +31,18 @@ verify_runnable "both" +# +# The has_capability() function was first exported in the 4.10 Linux kernel +# then backported to some LTS kernels. Prior to this change there was no +# mechanism to perform the needed permission check. Therefore, this test +# is expected to fail on older kernels and is skipped. +# +if is_linux; then + if [[ $(linux_version) -lt $(linux_version "4.10") ]]; then + log_unsupported "Requires has_capability() kernel function" + fi +fi + function setup { # We can't delegate 'mount' privs under Linux: to avoid issues with |