public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP]  [PATCH 1/1] Two added files for common criteria evaluation
@ 2011-08-17 22:42 James Czyzak
  2011-08-25 15:08 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: James Czyzak @ 2011-08-17 22:42 UTC (permalink / raw)
  To: Shubham, ltp-list; +Cc: debora


[-- 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

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

* Re: [LTP] [PATCH 1/1] Two added files for common criteria evaluation
  2011-08-17 22:42 [LTP] [PATCH 1/1] Two added files for common criteria evaluation James Czyzak
@ 2011-08-25 15:08 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2011-08-25 15:08 UTC (permalink / raw)
  To: James Czyzak; +Cc: ltp-list, debora

Hi!
> 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.

Could you please explain more specifically what are these scripts used
for? Seems to be some certification.

> +#                            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)

This part apparently got mangled by your email client.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2011-08-25 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-17 22:42 [LTP] [PATCH 1/1] Two added files for common criteria evaluation James Czyzak
2011-08-25 15:08 ` Cyril Hrubis

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