From: "Serge E. Hallyn" <serue@us.ibm.com>
To: LTP list <ltp-list@lists.sourceforge.net>
Subject: [LTP] [PATCH ltp] p9auth: add missing checkp9auth.sh script
Date: Sun, 3 Jan 2010 18:43:55 -0600 [thread overview]
Message-ID: <20100104004355.GA760@us.ibm.com> (raw)
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
next reply other threads:[~2010-01-04 0:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-04 0:43 Serge E. Hallyn [this message]
2010-01-04 8:46 ` [LTP] [PATCH ltp] p9auth: add missing checkp9auth.sh script Garrett Cooper
2010-01-04 15:38 ` Serge E. Hallyn
2010-01-04 23:34 ` Garrett Cooper
2010-01-06 6:10 ` Garrett Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100104004355.GA760@us.ibm.com \
--to=serue@us.ibm.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox