From: James Czyzak <czyzak2@linux.vnet.ibm.com>
To: Shubham <shubham@linux.vnet.ibm.com>, ltp-list@lists.sourceforge.net
Cc: debora@linux.vnet.ibm.com
Subject: [LTP] [PATCH 1/1] Two added files for common criteria evaluation
Date: Wed, 17 Aug 2011 17:42:17 -0500 [thread overview]
Message-ID: <4E4C43C9.2040303@linux.vnet.ibm.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 6797 bytes --]
Two files I would like to add for the purpose of running some tests that
are required for a common criteria evaluation against the ospp
protection policy that are not currently included in other test suites.
These become specific to the security target they are run against so
possibly if these cannot be included in the LTP git tree maybe there is
somewhere on the LTP site they could be made available? Also please let
me know if this patch has trouble with extra unseen characters. I have
had reports from some other groups that that has occurred. It's possible
that the mozilla Thunderbird mail client I'm running on a windows
machine is the culprit. In the past when this has occurred I have been
able to submit the patches as an attachment which seems to eliminate the
problem at least for those that have reported this problem to me.
Signed-off-by James Czyzak <czyzak2@linux.vnet.ibm.com>
<mailto:czyzak2@linux.vnet.ibm.com>
diff --git a/testscripts/cc_ospp.sh b/testscripts/cc_ospp.sh
new file mode 100755
index 0000000..69feb80
--- /dev/null
+++ b/testscripts/cc_ospp.sh
@@ -0,0 +1,168 @@
+#!/bin/sh
+
+
+#
+# 08/17/11 - Jim Czyzak - This script is based upon runEALtests.sh
script.
+# It has been modified to use the command file
+# cc_commands and only include arguments
that might
+# be useful for the common criteria testing
against
+# the ospp in conjunction with the
audit-test suite.
+# Also includes code to turn off screen in
+# /etc/profile for the test run as screen
interferes
+# with the su tests (screen is turned on in the
+# in some evaluated configurations for
purposes of
+# securing display devices)
+
+cd `dirname $0`
+export LTPROOT=${PWD}
+export TMPBASE="/tmp"
+export TMP="${TMPBASE}/runalltests-$$"
+export PATH="${PATH}:${LTPROOT}/../testcases/bin"
+cmdfile="${LTPROOT}/../runtest/cc_commands"
+pretty_prt=" "
+alt_dir=0
+quiet_mode=" "
+
+usage()
+{
+ cat <<-END >&2
+ usage: ./${0##*/} -c [-d tmpdir] [-f cmdfile ] [ -l logfile ]
+ -q [ -r ltproot ] [ -t duration ] [ -x instances ]
+
+ -c Run LTP under additional background CPU load.
+ -d tmpdir Directory where temporary files will be created.
+ -f cmdfile Execute user defined list of testcases.
+ -h Help. Prints all available options.
+ -l logfile Log results of test in a logfile.
+ -p Human readable format logfiles.
+ -q Print less verbose output to screen.
+ -r ltproot Fully qualified path where testsuite is installed.
+ -t duration Execute the testsuite for given duration in hours.
+ -x instances Run multiple instances of this testsuite.
+
+ example: ./${0##*/} -i 1024 -m 128 -p -q -l /tmp/resultlog.$$ -d
${PWD}
+ END
+exit
+}
+
+mkdir -p ${TMP}
+
+cd ${TMP}
+if [ $? -ne 0 ]; then
+ echo "could not cd ${TMP} ... exiting"
+ exit
+fi
+
+while getopts cd:f:h:l:pqr:t:x arg
+do case $arg in
+ c)
+ $LTPROOT/../testcases/bin/genload --cpu 1 2>&1 1>/dev/null &
+ GenLoad=1 ;;
+
+ d) # append $$ to TMP, as it is recursively
+ # removed at end of script.
+ TMPBASE=$OPTARG;;
+ f) # Execute user defined set of testcases.
+ cmdfile=$OPTARG;;
+
+ h) usage;;
+
+ l)
+ if [ ${OPTARG:0:1} != "/" ]
+ then
+ if [ -d $LTPROOT/results ]
+ then
+ logfile="-l
$LTPROOT/results/$OPTARG"
+ else
+ mkdir -p $LTPROOT/results
+ if [ $? -ne 0 ]
+ then
+ echo "ERROR: failed to
create $
+ exit 1
+ fi
+ logfile="-l
$LTPROOT/results/$OPTARG"
+ fi
+ alt_dir=1
+ else
+ logfile="-l $OPTARG"
+ fi ;;
+
+ p) pretty_prt=" -p ";;
+
+ q) quiet_mode=" -q ";;
+
+ r) LTPROOT=$OPTARG;;
+
+ t) # In case you want to specify the time
+ # to run from the command line
+ # (2m = two minutes, 2h = two hours, etc)
+ duration="-t $OPTARG" ;;
+
+ x) # number of ltp's to run
+ instances="-x $OPTARG";;
+
+ \?) usage;;
+ esac
+done
+
+if [ -z $PASSWD ]
+then
+ echo " "
+ echo "ERROR:"
+ echo "Please export enviroment variable PASSWD"
+ echo "INFO: export PASSWD = 'root's password'"
+ exit 1
+fi
+
+if [ -n "$instances" ]; then
+ instances="$instances -O ${TMP}"
+fi
+
+
+# If user does not provide a command file select a default set of testcases
+# to execute.
+if [ -z $cmdfile ]
+then
+ cat ${LTPROOT}/../runtest/admin_tools > ${TMP}/alltests
+else
+ cat $cmdfile > ${TMP}/alltests
+fi
+
+# The fsx-linux tests use the SCRATCHDEV environment variable as a location
+# that can be reformatted and run on. Set SCRATCHDEV if you want to run
+# these tests. As a safeguard, this is disabled.
+unset SCRATCHDEV
+if [ -n "$SCRATCHDEV" ]; then
+ cat ${LTPROOT}/../runtest/fsx >> ${TMP}/alltests
+fi
+
+# turn off screen in /etc/profile
+tmpbkup=$(mktemp "/etc/profile.XXXXXX") || exit 1
+cp -a /etc/profile $tmpbkup || exit 1
+sed -i 's/\[ -w $(tty) \]/false/' /etc/profile
+
+# display versions of installed software
+${LTPROOT}/../ver_linux
+
+${LTPROOT}/../bin/ltp-pan $quiet_mode -e -S $instances $duration -a $$
-n $$ $pretty_
+
+if [ $? -eq 0 ]; then
+ echo ltp-pan reported PASS
+else
+ echo ltp-pan reported FAIL
+fi
+
+if [ $alt_dir -eq 1 ]
+then
+ echo " "
+ echo
"###############################################################"
+ echo " "
+ echo " result log is in the $LTPROOT/results directory"
+ echo " "
+ echo
"###############################################################"
+ echo " "
+fi
+# restore /etc/profile
+mv -f $tmpbkup /etc/profile
+
+rm -rf ${TMP}
diff --git a/runtest/cc_commands b/runtest/cc_commands
new file mode 100644
index 0000000..2ba85c7
--- /dev/null
+++ b/runtest/cc_commands
@@ -0,0 +1,5 @@
+ping export LTPROOT; ping01
+ssh01 ssh01
+ssh02 ssh02
+ssh03 ssh03
+su01 export TCbin=$LTPROOT/../testcases/bin;su01
[-- Attachment #1.2: Type: text/html, Size: 15103 bytes --]
[-- Attachment #2: Type: text/plain, Size: 332 bytes --]
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next reply other threads:[~2011-08-17 22:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-17 22:42 James Czyzak [this message]
2011-08-25 15:08 ` [LTP] [PATCH 1/1] Two added files for common criteria evaluation Cyril Hrubis
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=4E4C43C9.2040303@linux.vnet.ibm.com \
--to=czyzak2@linux.vnet.ibm.com \
--cc=debora@linux.vnet.ibm.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=shubham@linux.vnet.ibm.com \
/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