[Fuego] [PATCH 16/18] LTP: skip tests depending on the config.h generated by LTP
Daniel Sangorrin
daniel.sangorrin at toshiba.co.jp
Tue Jan 30 09:59:34 UTC 2018
Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
engine/tests/Functional.LTP/fuego_test.sh | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/engine/tests/Functional.LTP/fuego_test.sh b/engine/tests/Functional.LTP/fuego_test.sh
index 2a6f7d7..84e62d7 100755
--- a/engine/tests/Functional.LTP/fuego_test.sh
+++ b/engine/tests/Functional.LTP/fuego_test.sh
@@ -107,6 +107,25 @@ function skip_if_command_unavailable {
fi
}
+# $1: a HAVE_xxx option to grep from ltp's include/config.h (after ./configure)
+# $2: string with LTP test names separated by spaces
+# $3: optional message
+# [Note] can only be called after the configure step has finished
+function skip_if_config_unavailable {
+ local CONFIG="$1"
+ local TESTS="$2"
+ local MSG="$3"
+
+ if ! grep "#define $CONFIG" ${WORKSPACE}/${JOB_BUILD_DIR}/include/config.h; then
+ echo "WARNING: $CONFIG is not available."
+ skip_tests "${TESTS}"
+ if [ -n "$MSG" ]; then
+ echo "$MSG"
+ fi
+ fi
+
+}
+
# $1: string with kernel config options separated by spaces
# $2: string with LTP test names separated by spaces
function skip_if_kconfig_differs {
@@ -254,6 +273,12 @@ function test_build {
--with-open-posix-testsuite --with-realtime-testsuite --without-perl --without-python --target=$PREFIX --host=$PREFIX \
--prefix=`pwd`/target_bin --build=`uname -m`-unknown-linux-gnu
+ # Skip tests depending on the results of configure (e.g.: SDK requirements)
+ skip_if_config_unavailable "HAVE_XFS_QUOTA" "quotactl02" "Try adding xfslibs-dev to your SDK"
+ skip_if_config_unavailable "HAVE_QUOTAV" "quotactl01 quotactl02" "Try adding libc6-dev to your SDK"
+ skip_if_config_unavailable "HAVE_NUMA" "get_mempolicy01 mbind01 migrate_pages01 migrate_pages02 move_pages01 move_pages02 move_pages03 move_pages04 move_pages05 move_pages06 move_pages07 move_pages08 move_pages09 move_pages10 move_pages11" "No NUMA support"
+ skip_if_config_unavailable "HAVE_MODIFY_LDT" "modify_ldt01 modify_ldt02 modify_ldt03" "Add modify_ldt support"
+
# save build results in build.log
set -o pipefail
make CC="${CC}" 2>&1 | tee build.log
--
2.7.4
More information about the Fuego
mailing list