public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] realtime: add realtime tests to the default
@ 2013-10-31 11:10 Xiaoguang Wang
  2013-10-31 17:49 ` chrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaoguang Wang @ 2013-10-31 11:10 UTC (permalink / raw)
  To: ltp-list


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 <wangxg.fnst@cn.fujitsu.com>
---
 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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] realtime: add realtime tests to the default
  2013-10-31 11:10 [LTP] [PATCH] realtime: add realtime tests to the default Xiaoguang Wang
@ 2013-10-31 17:49 ` chrubis
  0 siblings, 0 replies; 2+ messages in thread
From: chrubis @ 2013-10-31 17:49 UTC (permalink / raw)
  To: Xiaoguang Wang; +Cc: ltp-list

Hi!
> 
> modify run.sh to check whether the kernel support RT PREEMPT
> 
> modify configure.ac to make the realtime tests default

I do not like the realtime runtest file. The reason is that all the
tests are executed by a single script, which makes it hard (if not
impossible) to figure out what exactly has failed. We are working hard
on getting rid of such runtest files. The runtest file should have only
one entry per test.

Also adding it into the default scenario is IMHO not good choice, most
of the systems out there are not RT systems.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-31 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31 11:10 [LTP] [PATCH] realtime: add realtime tests to the default Xiaoguang Wang
2013-10-31 17:49 ` chrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox