public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH ltp] p9auth: add missing checkp9auth.sh script
@ 2010-01-04  0:43 Serge E. Hallyn
  2010-01-04  8:46 ` Garrett Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Serge E. Hallyn @ 2010-01-04  0:43 UTC (permalink / raw)
  To: LTP list

This was in my original patch submission but somehow didn't make its way into
the ltp tree.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
---
 testcases/kernel/security/p9auth/checkp9auth.sh |   70 +++++++++++++++++++++++
 1 files changed, 70 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/security/p9auth/checkp9auth.sh

diff --git a/testcases/kernel/security/p9auth/checkp9auth.sh b/testcases/kernel/security/p9auth/checkp9auth.sh
new file mode 100644
index 0000000..f917ce6
--- /dev/null
+++ b/testcases/kernel/security/p9auth/checkp9auth.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+################################################################################
+##                                                                            ##
+## Copyright (c) International Business Machines  Corp., 2009                 ##
+##                                                                            ##
+## 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    ##
+##                                                                            ##
+################################################################################
+
+yesno=0
+if [ "$1" = "yesno" ]; then
+	yesno=1
+fi
+
+# check for openssl
+rm -f /tmp/ab
+echo ab > /tmp/ab
+openssl sha1 -hmac "ab" /tmp/ab > /dev/null
+ret=$?
+if [ $ret -ne 0 ]; then
+	if [ $yesno -eq 1 ]; then echo
+		"no"
+	else
+		echo "openssl not installed, skipping p9auth tests."
+	fi
+	exit 1
+fi
+
+majfile=/sys/module/p9auth/parameters/cap_major
+minfile=/sys/module/p9auth/parameters/cap_minor
+if [ ! -f "$majfile" ]; then
+	if [ $yesno -eq 1 ]; then echo
+		"no"
+	else
+		echo "p9auth not detected.  Skipping p9auth tests."
+	fi
+	exit 1
+fi
+
+if [ ! -c "/dev/caphash" ]; then
+	rm -f /dev/caphash
+	maj=`cat $majfile`
+	mknod /dev/caphash c $maj 0
+fi
+
+if [ ! -c "/dev/capuse" ]; then
+	rm -f /dev/capuse
+	min=`cat $minfile`
+	mknod /dev/capuse c $maj 1
+fi
+chmod ugo+w /dev/capuse
+
+if [ $yesno -eq 1 ]; then
+	echo "yes"
+else
+	echo "p9auth ready for testing"
+fi
+exit 0
-- 
1.6.1.1


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2010-01-06  6:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-04  0:43 [LTP] [PATCH ltp] p9auth: add missing checkp9auth.sh script Serge E. Hallyn
2010-01-04  8:46 ` Garrett Cooper
2010-01-04 15:38   ` Serge E. Hallyn
2010-01-04 23:34     ` Garrett Cooper
2010-01-06  6:10       ` Garrett Cooper

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