Re: [LTP] [PATCH] Numa-testcases: Return TCONF if NUMA is not available

2009-09-16 Thread Subrata Modak
On Tue, 2009-09-15 at 17:29 +0200, Geert Uytterhoeven wrote: 
 Currently the test just fails if NUMA is not available.
 
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com

Thanks.

Regards--
Subrata

 ---
  testcases/kernel/numa/numa01.sh |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/testcases/kernel/numa/numa01.sh b/testcases/kernel/numa/numa01.sh
 index 419d0b2..6cc0754 100644
 --- a/testcases/kernel/numa/numa01.sh
 +++ b/testcases/kernel/numa/numa01.sh
 @@ -239,9 +239,9 @@ init()
  
  if [ $max_node -eq 1 ]
  then 
 -tst_resm TWARN non-NUMA aware kernel is running or your machine 
 does not support numa policy or 
 +tst_resm TCONF non-NUMA aware kernel is running or your machine 
 does not support numa policy or 
  your machine is not a NUMA machine
 -return 1
 +exit 0
  fi
  
  RC=0


--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] quotactl01: Fix tst_resm() format causing crash

2009-09-16 Thread Subrata Modak
On Tue, 2009-09-15 at 17:28 +0200, Geert Uytterhoeven wrote: 
 When the quotactl syscall fails, quotactl01 crashes with a segmentation fault
 due to an incorrect printf()-style format.
 
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com

Thanks.

Regards--
Subrata

 --
 v2: Use TTERRNO
 
  testcases/kernel/syscalls/quotactl/quotactl01.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c 
 b/testcases/kernel/syscalls/quotactl/quotactl01.c
 index 6800a25..fe8df33 100644
 --- a/testcases/kernel/syscalls/quotactl/quotactl01.c
 +++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
 @@ -147,7 +147,7 @@ int main(int ac, char **av) {
  for (i = 0; i = 7; i++){
  TEST(retval = syscall(__NR_quotactl, cmd[i], (const 
 char *)NULL, id, (caddr_t)NULL));
   if(TEST_RETURN != 0){
 - tst_resm(TFAIL, %s failed - errno = %d : %s 
 ...cmderror=%s, TCID, TEST_ERRNO, strerror(TEST_ERRNO),cmd[i]);
 + tst_resm(TFAIL|TTERRNO, %s failed, cmd=0x%x, 
 TCID, cmd[i]);
  }else{
   tst_resm(TPASS, quotactl call succeeded);
  }


--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] quotactl01: Replace hardcoded 258 by __NR_set_tid_address

2009-09-16 Thread Subrata Modak
On Tue, 2009-09-15 at 17:29 +0200, Geert Uytterhoeven wrote: 
 The call signature seems to match the set_tid_address() syscall.
 Also remove the comment about calling quotactl, as it's obviously bogus.
 
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com

Thanks.

Regards--
Subrata

 ---
  testcases/kernel/syscalls/quotactl/quotactl01.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c 
 b/testcases/kernel/syscalls/quotactl/quotactl01.c
 index fe8df33..f410948 100644
 --- a/testcases/kernel/syscalls/quotactl/quotactl01.c
 +++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
 @@ -152,7 +152,7 @@ int main(int ac, char **av) {
   tst_resm(TPASS, quotactl call succeeded);
  }
  }
 -  TEST(result = syscall(258, newtid)); //call quotactl()
 +  TEST(result = syscall(__NR_set_tid_address, newtid));
   if(TEST_RETURN == getpid()) {
  cleanup();
   }


--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] smt_smp: Return TCONF if SMT/SMP is not supported

2009-09-16 Thread Subrata Modak
On Tue, 2009-09-15 at 17:30 +0200, Geert Uytterhoeven wrote: 
 Currently the tests just fails if SMT/SMP is not supported.
 
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com

Thanks.

Regards--
Subrata

 ---
  .../hyperthreading/ht_affinity/smt_smp_affinity.sh |3 +--
  .../hyperthreading/ht_enabled/smt_smp_enabled.sh   |3 +--
  2 files changed, 2 insertions(+), 4 deletions(-)
 
 diff --git 
 a/testcases/kernel/sched/hyperthreading/ht_affinity/smt_smp_affinity.sh 
 b/testcases/kernel/sched/hyperthreading/ht_affinity/smt_smp_affinity.sh
 index 109800d..0a33f51 100755
 --- a/testcases/kernel/sched/hyperthreading/ht_affinity/smt_smp_affinity.sh
 +++ b/testcases/kernel/sched/hyperthreading/ht_affinity/smt_smp_affinity.sh
 @@ -44,8 +44,7 @@ if [ -f ./ht_enabled ];then
   if [ $ret_value -ne 0 ];then
   tst_resm TCONF SMT/SMP is not supported
   tst_resm TINFO End: SMT/SMP Affinity
 - TFAILCNT=$(( $TFAILCNT+1 ))
 - exit $TFAILCNT
 + exit 0
   fi
  else
   tst_resm TBROK ht_enabled:File not found
 diff --git 
 a/testcases/kernel/sched/hyperthreading/ht_enabled/smt_smp_enabled.sh 
 b/testcases/kernel/sched/hyperthreading/ht_enabled/smt_smp_enabled.sh
 index 8b8a909..e234ea4 100755
 --- a/testcases/kernel/sched/hyperthreading/ht_enabled/smt_smp_enabled.sh
 +++ b/testcases/kernel/sched/hyperthreading/ht_enabled/smt_smp_enabled.sh
 @@ -41,8 +41,7 @@ if [ -f ./ht_enabled ];then
   if [ $ret_value -ne 0 ];then
   tst_resm TCONF SMT/SMP is not supported
   tst_resm TINFO End: SMT/SMP Enabled
 - TFAILCNT=$(( $TFAILCNT+1 ))
 - exit $TFAILCNT
 + exit 0
   fi
  else
   tst_resm TBROK ht_enabled:File not found


--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[LTP] [LTP PATCH] Create testcase for p9auth kernel module

2009-09-16 Thread Serge E. Hallyn
The p9auth module is a driver in the staging/ directory, which
implements kernel functionality supporting plan 9-style setuid.
Programs can be completely unprivileged, authorize themselves
to a privileged server, and obtain a token which they can use to
authorize a single setuid to a single specified new uid.

This testcase runs three tests:
1. make sure we can't setuid without a hash
(this is actually short-cut in the kernel code
so it might be worthwhile having a separate
test for having a hash, but an invalid one)
2. make sure we can setuid when there is a valid hash
3. make sure we cannot setuid if there is a valid hash,
but our original uid isn't the one specified
in the token.

Run the testcase using

./runltp -f p9auth

Signed-off-by: Serge E. Hallyn se...@us.ibm.com
---
 runtest/p9auth  |2 +
 testcases/kernel/security/Makefile  |2 +-
 testcases/kernel/security/p9auth/Makefile   |   40 
 testcases/kernel/security/p9auth/checkp9auth.sh |   58 
 testcases/kernel/security/p9auth/p9priv.sh  |  111 +++
 testcases/kernel/security/p9auth/p9unpriv.sh|   51 +++
 testcases/kernel/security/p9auth/unhex.c|   47 ++
 7 files changed, 310 insertions(+), 1 deletions(-)
 create mode 100644 runtest/p9auth
 create mode 100644 testcases/kernel/security/p9auth/Makefile
 create mode 100644 testcases/kernel/security/p9auth/checkp9auth.sh
 create mode 100644 testcases/kernel/security/p9auth/p9priv.sh
 create mode 100644 testcases/kernel/security/p9auth/p9unpriv.sh
 create mode 100644 testcases/kernel/security/p9auth/unhex.c

diff --git a/runtest/p9auth b/runtest/p9auth
new file mode 100644
index 000..17b1550
--- /dev/null
+++ b/runtest/p9auth
@@ -0,0 +1,2 @@
+#DESCRIPTION:p9auth /dev/caphash module
+p9auth runp9auth.sh
diff --git a/testcases/kernel/security/Makefile 
b/testcases/kernel/security/Makefile
index 862691a..3a26b22 100644
--- a/testcases/kernel/security/Makefile
+++ b/testcases/kernel/security/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS = mmc_security filecaps integrity cap_bound
+SUBDIRS = mmc_security filecaps integrity cap_bound p9auth
 
 all:
@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
diff --git a/testcases/kernel/security/p9auth/Makefile 
b/testcases/kernel/security/p9auth/Makefile
new file mode 100644
index 000..8bf7613
--- /dev/null
+++ b/testcases/kernel/security/p9auth/Makefile
@@ -0,0 +1,40 @@
+
+##
##
+## Copyright (c) International Business Machines  Corp., 2008 
##
+##
##
+## This program is free software;  you can redistribute it and#or modify  
##
+## it under the terms of the GNU General Public License as published by   
##
+## the Free Software Foundation; either version 2 of the License, or  
##
+## (at your option) any later version.
##
+##
##
+## This program is distributed in the hope that it will be useful, but
##
+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
##
+## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   
##
+## for more details.  
##
+##
##
+## You should have received a copy of the GNU General Public License  
##
+## along with this program;  if not, write to the Free Software   
##
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
+##
##
+
+
+HAVE_P9AUTH := $(shell sh checkp9auth.sh yesno)
+
+SCRIPTS = runp9auth.sh checkp9auth.sh p9priv.sh p9unpriv.sh
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp -lcap
+
+ifeq ($(HAVE_P9AUTH),yes)
+SRCS= $(wildcard *.c)
+TARGETS+= $(patsubst %.c,%,$(SRCS))
+endif
+
+all: $(TARGETS)
+
+INSTALLTARGETS = $(TARGETS) $(SCRIPTS)
+install: $(INSTALLTARGETS)
+   @set -e; for i in $(INSTALLTARGETS); do ln -f $$i ../../../bin/$$i ; 
chmod +x ../../../bin/$$i; done
+
+clean:
+   rm -f $(TARGETS) *.o
diff --git a/testcases/kernel/security/p9auth/checkp9auth.sh 
b/testcases/kernel/security/p9auth/checkp9auth.sh
new file mode 100644
index 000..25c5518
--- /dev/null
+++ b/testcases/kernel/security/p9auth/checkp9auth.sh
@@ -0,0 +1,58 @@
+#!/bin/sh