p9auth: add missing checkp9auth.sh script
PATCH 1/1 p9auth: add missing checkp9auth.sh script
This was in my original patch submission but somehow didn't make its way into the ltp tree.
--- testcases/kernel/security/p9auth/checkp9auth.sh | 70 +++++++++++++++++++++++ 1 files changed, 70 insertions(+), 0 deletions(-) create mode 100644 testcases/kernel/security/p9auth/checkp9auth.sh
testcases/kernel/security/p9auth/checkp9auth.sh new file +70 -0
@@ -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
Signature · 13 lines
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 [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Sent from my iPhone
Quoted 130 lines · Serge E. Hallyn
This was in my original patch submission but somehow didn't make its way into
the ltp tree.Signed-off-by Serge E. Hallyn <[email protected]>---
testcases/kernel/security/p9auth/checkp9auth.sh| 70 ++++++++++++++
+++++++++1 files changed, 70 insertions(+), 0 deletions(-)create mode 100644
testcases/kernel/security/p9auth/checkp9auth.sh(quoted diff) renamed from testcases/kernel/security/p9auth/checkp9auth.sh +0
-0
testcases/kernel/security/p9auth/checkp9auth.sh
new file mode 100644
index 0000000..f917ce6testcases/kernel/security/p9auth/checkp9auth.sh new file +2
-0@@ -0,0 +1,70 @@ +#!/bin/sh +#####
###
###
#####################################################################testcases/kernel/security/p9auth/checkp9auth.sh new file +2
-0+## ## +## Copyright (c) International Business Machines Corp.,2009 ##
testcases/kernel/security/p9auth/checkp9auth.sh new file +2
-0+## ## +## This program is free software; you can redistribute it and#ormodify ##
+## 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. ##testcases/kernel/security/p9auth/checkp9auth.sh new file +2
-0+## ## +## 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. ##testcases/kernel/security/p9auth/checkp9auth.sh new file +2
-0+## ## +## You should have received a copy of the GNU General PublicLicense ##
+## along with this program; if not, write to the Free
Software ##
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA ##testcases/kernel/security/p9auth/checkp9auth.sh new file +2
-0+## ## +#####
###
###
#####################################################################testcases/kernel/security/p9auth/checkp9auth.sh new file +50
-0+ +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 0Signature · 1 line
1.6.1.1
Hi Serge,
When do this script need to be run? Before compiling or before /
while running?
-Garrett
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 4 lines · Garrett Cooper
Hi Serge,
When do this script need to be run? Before compiling or before /
while running?
-Garrett
Hi,
Either could do, but there's reason to do it at both. It doesn't need to be run before each test, but has to load the module and set up devices after each boot. So I originally had it both in the makefile, as a condition for doing the compilation (and especially installation), as well as before the test, in case the system was rebooted after compilation and before running.
-serge
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Sent from my iPhone
Quoted 18 lines · Serge E. Hallyn
Quoted 4 lines · Garrett Cooper
Hi Serge,
When do this script need to be run? Before compiling or before /
while running?
-GarrettHi,
Either could do, but there's reason to do it at both. It doesn't need to be
run before each test, but has to load the module and set up devices after each
boot. So I originally had it both in the makefile, as a condition for doing
the compilation (and especially installation), as well as before the test, in
case the system was rebooted after compilation and before running.
Quoted 1 line
-serge
Ok, that's why I yanked it. Here's what we should do then:
1. Take code required for compile and put it in an autoconf test.
2. Take code required for execution (loading modules, etc) and move it into a separate script.
3. Take all sourceable code and move it into a separate script that gets sourced in both places.
I'll add it back into the repo when I get back tomorrow, but we need to get a proper plan as far as how we are going to enable / disable features and tests that require interpreters, special system configs, etc.
Thanks!
-Garrett
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 33 lines · Garrett Cooper
Sent from my iPhone
Quoted 19 lines · Serge E. Hallyn
Quoted 5 lines · Garrett Cooper
Hi Serge,
When do this script need to be run? Before compiling or before / while running?
-GarrettHi,
Either could do, but there's reason to do it at both. It doesn't need to be
run before each test, but has to load the module and set up devices after each
boot. So I originally had it both in the makefile, as a condition for doing
the compilation (and especially installation), as well as before the test, in
case the system was rebooted after compilation and before running.Quoted 1 line
-serge
Ok, that's why I yanked it. Here's what we should do then:
1. Take code required for compile and put it in an autoconf test.
2. Take code required for execution (loading modules, etc) and move it into a separate script.
3. Take all sourceable code and move it into a separate script that gets sourced in both places.
Quoted 3 lines
I'll add it back into the repo when I get back tomorrow, but we need to get a proper plan as far as how we are going to enable / disable features and tests that require interpreters, special system configs, etc.
File revived.
Thanks,
-Garrett
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list