From 9ca25e709b904ab9669724d53eb50ee074c09705 Mon Sep 17 00:00:00 2001 From: LOLi Date: Wed, 7 Feb 2018 21:43:24 +0100 Subject: [PATCH] Verify ZFS Test Suite scripts executability This change adds a make target 'testscheck' which verifies all ksh test scripts, part of the ZFS Test Suite, have their executable bit set: this should avoid adding new test scripts that cannot be executed by the test-runner.py which would result in the following warning message: Warning: Test removed from TestGroup because it failed verification. This also verifies both *.cfg and *.kshlib files used in the ZFS Test Suite are not executable. Reviewed-by: Brian Behlendorf Reviewed-by: Giuseppe Di Natale Signed-off-by: loli10K Closes #7131 --- Makefile.am | 10 +++++++++- .../tests/functional/casenorm/casenorm.kshlib | 0 .../cli_root/zpool_events/zpool_events.kshlib | 0 .../functional/cli_root/zpool_reopen/zpool_reopen.cfg | 0 .../tests/functional/events/events_common.kshlib | 0 .../tests/functional/rsend/send_encrypted_files.ksh | 0 .../functional/zvol/zvol_misc/zvol_misc_common.kshlib | 0 7 files changed, 9 insertions(+), 1 deletion(-) mode change 100755 => 100644 tests/zfs-tests/tests/functional/casenorm/casenorm.kshlib mode change 100755 => 100644 tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events.kshlib mode change 100755 => 100644 tests/zfs-tests/tests/functional/cli_root/zpool_reopen/zpool_reopen.cfg mode change 100755 => 100644 tests/zfs-tests/tests/functional/events/events_common.kshlib mode change 100644 => 100755 tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh mode change 100755 => 100644 tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib diff --git a/Makefile.am b/Makefile.am index a4dccdda6a9f..07d583fdf4e4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,7 +41,7 @@ dist-hook: sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \ $(distdir)/META -checkstyle: cstyle shellcheck flake8 commitcheck mancheck +checkstyle: cstyle shellcheck flake8 commitcheck mancheck testscheck commitcheck: @if git rev-parse --git-dir > /dev/null 2>&1; then \ @@ -68,6 +68,14 @@ mancheck: xargs mandoc -Tlint -Werror; \ fi +testscheck: + @find ${top_srcdir}/tests/zfs-tests/tests -type f \ + \( -name '*.ksh' -not -executable \) -o \ + \( -name '*.kshlib' -executable \) -o \ + \( -name '*.cfg' -executable \) | \ + xargs -r stat -c '%A %n' | \ + awk '{c++; print} END {if(c>0) exit 1}' + lint: cppcheck paxcheck cppcheck: diff --git a/tests/zfs-tests/tests/functional/casenorm/casenorm.kshlib b/tests/zfs-tests/tests/functional/casenorm/casenorm.kshlib old mode 100755 new mode 100644 diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events.kshlib b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events.kshlib old mode 100755 new mode 100644 diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_reopen/zpool_reopen.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_reopen/zpool_reopen.cfg old mode 100755 new mode 100644 diff --git a/tests/zfs-tests/tests/functional/events/events_common.kshlib b/tests/zfs-tests/tests/functional/events/events_common.kshlib old mode 100755 new mode 100644 diff --git a/tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh b/tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh old mode 100644 new mode 100755 diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib old mode 100755 new mode 100644