public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] cpuset_syscall_testset.sh: check TCONF for test 15, 16
@ 2014-10-17  9:29 Jan Stancek
  2014-10-30 13:16 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Stancek @ 2014-10-17  9:29 UTC (permalink / raw)
  To: ltp-list; +Cc: jbeckenbach

If HAVE_DECL_MPOL_F_MEMS_ALLOWED is not defined, test 15 and 16,
returns -1, which is evaluted as failure.

Treat it as TCONF, but don't break the execution, cpuset_syscall_testset.sh
script is expecting to handle stopping/waiting for children by itself.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 .../cpuset_syscall_test/cpuset_syscall_test.c      |    6 +++---
 .../cpuset_syscall_test/cpuset_syscall_testset.sh  |   14 ++++++++++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c
index e202295..407b8c9 100644
--- a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c
+++ b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c
@@ -128,7 +128,7 @@ void sigint_handler(int __attribute__ ((unused)) signo)
 void test_setaffinity(void)
 {
 	cpu_set_t tmask;
-	int i;
+	unsigned int i;
 	CPU_ZERO(&tmask);
 	for (i = 0; i < 8 * sizeof(mask); i++) {
 		if ((1 << i) & mask)
@@ -140,7 +140,7 @@ void test_setaffinity(void)
 void test_getaffinity(void)
 {
 	cpu_set_t tmask;
-	int i;
+	unsigned int i;
 	CPU_ZERO(&tmask);
 	ret = sched_getaffinity(0, sizeof(tmask), &tmask);
 	for (i = 0; i < 8 * sizeof(mask); i++) {
@@ -190,7 +190,7 @@ void test_get_mempolicy(void)
 	ret = get_mempolicy(NULL, bitmask_mask(nmask), bitmask_nbits(nmask), 0,
 			    MPOL_F_MEMS_ALLOWED);
 #else
-	ret = -1;
+	tst_resm(TCONF, "don't have MPOL_F_MEMS_ALLOWED");
 #endif
 
 	bitmask_displaylist(str, 256, nmask);
diff --git a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
index 561c3b9..bf1ec6c 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
@@ -299,7 +299,12 @@ test14()
 
 test15()
 {
-	do_syscall_test 0 0 --get_mempolicy 0 || return 1
+	do_syscall_test 0 0 --get_mempolicy 0
+	ret=$?
+
+	grep "TCONF" "$TEST_OUTPUT" && return 0
+	[ $ret -ne 0 ] && return 1
+
 	allowed_list="$(awk '/Mems_allowed_list:/{print $2}' $TEST_PROCSTATUS )"
 	test "$(cat "$TEST_OUTPUT")" = "0"
 	if [ $? -ne 0 ]; then
@@ -316,7 +321,12 @@ test15()
 
 test16()
 {
-	do_syscall_test 0 0-1 --get_mempolicy 0 || return 1
+	do_syscall_test 0 0-1 --get_mempolicy 0
+	ret=$?
+
+	grep "TCONF" "$TEST_OUTPUT" && return 0
+	[ $ret -ne 0 ] && return 1
+
 	allowed_list="$(awk '/Mems_allowed_list:/{print $2}' $TEST_PROCSTATUS )"
 	test "$(cat "$TEST_OUTPUT")" = "0-1"
 	if [ $? -ne 0 ]; then
-- 
1.7.1


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
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

end of thread, other threads:[~2014-10-30 13:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17  9:29 [LTP] [PATCH v2] cpuset_syscall_testset.sh: check TCONF for test 15, 16 Jan Stancek
2014-10-30 13:16 ` Cyril Hrubis

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