[Fuego] [PATCH 14/18] LTP: skip tests depending on the target kernel config

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Tue Jan 30 09:59:32 UTC 2018


Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
 engine/tests/Functional.LTP/fuego_test.sh | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/engine/tests/Functional.LTP/fuego_test.sh b/engine/tests/Functional.LTP/fuego_test.sh
index d54b299..43d007d 100755
--- a/engine/tests/Functional.LTP/fuego_test.sh
+++ b/engine/tests/Functional.LTP/fuego_test.sh
@@ -93,6 +93,21 @@ function skip_tests {
     done
 }
 
+# $1: string with kernel config options separated by spaces
+# $2: string with LTP test names separated by spaces
+function skip_if_kconfig_differs {
+    set -f
+    local KCONFIGS=($1)
+    set +f
+    local TESTS="$2"
+
+    for cfg in ${KCONFIGS[@]}; do
+        if ! check_kconfig "$cfg"; then
+            skip_tests "${TESTS}"
+        fi
+    done
+}
+
 function test_pre_check {
     if [ -n "${FUNCTIONAL_LTP_HOMEDIR}" ] ; then
         # user or spec has specified a home directory for LTP.
@@ -163,6 +178,12 @@ function test_pre_check {
     skip_tests "inotify06" # will loop/crash kernels that dont have commit 8f2f3eb59dff (<4.2)
     skip_tests "ptrace03" # Only works for <2.6.26, above that the kernel allows to trace init
 
+    # Tests skipped depending on the configuration of the target kernel
+    skip_if_kconfig_differs "CONFIG_INOTIFY_USER=y" "inotify_init1_01 inotify_init1_02 inotify01 inotify02 inotify03 inotify04 inotify05 inotify06"
+    skip_if_kconfig_differs "CONFIG_FANOTIFY=y CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y" "fanotify01 fanotify02 fanotify03 fanotify04 fanotify05 fanotify06"
+    skip_if_kconfig_differs "CONFIG_EXT4_FS=y CONFIG_EXT4DEV_COMPAT=y CONFIG_EXT4_FS_XATTR=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y" "ext4-nsec-timestamps"
+    skip_if_kconfig_differs "CONFIG_CHECKPOINT_RESTORE=y" "kcmp01 kcmp02 kcmp03"
+
     # Tests skipped depending on the architecture
     if [ "$ARCHITECTURE" = "x86_64" ]; then
         skip_tests "chown01_16 chown02_16 chown03_16 chown04_16 chown05_16"
-- 
2.7.4




More information about the Fuego mailing list