modify run.sh to check whether the kernel support RT PREEMPT

modify configure.ac to make the realtime tests default

Signed-off-by: Xiaoguang Wang <[email protected]>
---
 configure.ac                        | 10 ++++++----
 runtest/realtime                    |  1 +
 scenario_groups/default             |  1 +
 testcases/realtime/run.sh           | 20 ++++++++++++++++++++
 testcases/realtime/scripts/Makefile |  2 +-
 5 files changed, 29 insertions(+), 5 deletions(-)
 create mode 100644 runtest/realtime

diff --git a/configure.ac b/configure.ac
index 940f4f7..c4d63b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,14 +128,16 @@ else
 fi
 
 # testcases/realtime requires bash and python.
-if test "x$with_bash" = xyes && test "x$with_python" = xyes; then
+AC_CHECK_PROG(bash_exist, bash, [yes], [no])
+AC_CHECK_PROG(python_exist, python, [yes], [no])
+if test "x$bash_exist" = xyes && test "x$python_exist" = xyes; then
     AC_ARG_WITH([realtime-testsuite],
-      [AC_HELP_STRING([--with-realtime-testsuite],
+      [AC_HELP_STRING([--without-realtime-testsuite],
         [compile and install the realtime testsuite (default=no)])],
-      [with_realtime_testsuite=yes]
+      [without_realtime_testsuite=yes],[without_realtime_testsuite=no]
     )
 fi
-if test "x$with_realtime_testsuite" = xyes; then
+if test "x$without_realtime_testsuite" = xno; then
     AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
     # Run configure on testcases/realtime as well.
     AC_CONFIG_SUBDIRS([testcases/realtime])
diff --git a/runtest/realtime b/runtest/realtime
new file mode 100644
index 0000000..ca6023c
--- /dev/null
+++ b/runtest/realtime
@@ -0,0 +1 @@
+realtime cd $LTPROOT/testcases/realtime/ && ./run.sh
diff --git a/scenario_groups/default b/scenario_groups/default
index 9eca8ad..f29e817 100644
--- a/scenario_groups/default
+++ b/scenario_groups/default
@@ -25,3 +25,4 @@ hugetlb
 commands
 hyperthreading
 kernel_misc
+realtime
diff --git a/testcases/realtime/run.sh b/testcases/realtime/run.sh
index a66e4e5..e4943b6 100755
--- a/testcases/realtime/run.sh
+++ b/testcases/realtime/run.sh
@@ -62,6 +62,17 @@ check_error()
                exit 1
        fi
 }
+
+check_kernel_config()
+{
+       local kernel_release=$(uname -r)
+       local config_file="/boot/config-${kernel_release}"
+
+       local is_exist=$(cat $config_file | grep "$1=y" -c)
+
+       return $is_exist
+}
+
 list_tests()
 {
        echo
@@ -180,6 +191,15 @@ find_test()
 SCRIPTS_DIR="$(readlink -f "$(dirname "$0")")/scripts"
 source $SCRIPTS_DIR/setenv.sh
 
+# check whether the kernel support RT PREEMPT
+check_kernel_config "CONFIG_PREEMPT_RT"
+
+if [ $? -lt 1 ];then
+       echo "realtime      TCONF  Kernel don't support RT PREEMPT."
+       echo "see wiki <http://rt.wiki.kernel.org> for more information"
+       exit 0
+fi
+
 if [ $# -lt 1 ]; then
        usage
 fi
diff --git a/testcases/realtime/scripts/Makefile 
b/testcases/realtime/scripts/Makefile
index 28bf88e..5dda3a7 100644
--- a/testcases/realtime/scripts/Makefile
+++ b/testcases/realtime/scripts/Makefile
@@ -22,5 +22,5 @@ top_srcdir            ?= ../../..
 
 include $(top_srcdir)/include/mk/env_pre.mk
 include $(abs_srcdir)/../config.mk
-INSTALL_TARGETS                := run_c_files.sh setenv.sh __init__.py 
parser.py
+INSTALL_TARGETS                := run_all_test.sh run_c_files.sh setenv.sh 
__init__.py parser.py ../run.sh
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
-- 
1.8.2.1

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to