corredor-commits Mailing List for Corredor Automation Test Suite
Status: Pre-Alpha
Brought to you by:
brlcad
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
|
Nov
|
Dec
|
---|
From: <br...@us...> - 2006-09-24 20:07:57
|
Revision: 13 http://svn.sourceforge.net/corredor/?rev=13&view=rev Author: brlcad Date: 2006-09-24 13:07:46 -0700 (Sun, 24 Sep 2006) Log Message: ----------- add some initial corredor self-tests for basic functionality. add usual header/footer too. Modified Paths: -------------- corredor/trunk/Documentation/TODO corredor/trunk/Resources/Testing/Testing corredor/trunk/Resources/library corredor/trunk/TestBucket/Shell/Shell corredor/trunk/TestBucket/Template/Template Added Paths: ----------- corredor/trunk/TestBucket/Logging/Logging corredor/trunk/TestBucket/Running/ corredor/trunk/TestBucket/Running/Running corredor/trunk/TestBucket/Variables/Variables Removed Paths: ------------- corredor/trunk/TestBucket/Input/ corredor/trunk/TestBucket/Locking/ Modified: corredor/trunk/Documentation/TODO =================================================================== --- corredor/trunk/Documentation/TODO 2006-09-24 06:37:30 UTC (rev 12) +++ corredor/trunk/Documentation/TODO 2006-09-24 20:07:46 UTC (rev 13) @@ -20,7 +20,10 @@ * remote operation +* rewrite library so that resources may be individually + loaded and unloaded, with single use statements (e.g. use Output) + THESE ARE FOR FUTURE RELEASES ----------------------------- Modified: corredor/trunk/Resources/Testing/Testing =================================================================== --- corredor/trunk/Resources/Testing/Testing 2006-09-24 06:37:30 UTC (rev 12) +++ corredor/trunk/Resources/Testing/Testing 2006-09-24 20:07:46 UTC (rev 13) @@ -47,6 +47,13 @@ # run # main automation function for executing tasks # +# VARIABLES +# +# TEST +# the short name of the item currently being executed +# TEST_WITH_PATH +# the invocation path to the item currently being run +# ### # Modified: corredor/trunk/Resources/library =================================================================== --- corredor/trunk/Resources/library 2006-09-24 06:37:30 UTC (rev 12) +++ corredor/trunk/Resources/library 2006-09-24 20:07:46 UTC (rev 13) @@ -574,7 +574,7 @@ done __TO_BE_SOURCED="$__new_to_be" - [ ! "x$__DEBUG" = x ] && echo "REMAINING TO BE SOURCED: $__TO_BE_SOURCED" + [ ! "x$__DEBUG" = x ] && echo "REMAINING TO BE SOURCED: $__TO_BE_SOURCED" 1>&2 done # done iterating over resources to be sourced @@ -789,7 +789,7 @@ registerInvalidResource "$__resource_name" "$__resource" continue - # if we did process files, register accordingly + # if we're processing files, register accordingly if [ -x "$__resource" ] ; then case "x$__resource_name" in x*~ | x\.* | x*.o | x*.lo | x*.la | x\#* ) @@ -826,6 +826,10 @@ fi for __resource_dir_to_load in $__resource_dirs ; do + if [ ! -d $__resource_dir_to_load ] ; then + continue + fi + __resources_to_load="" for __dir in `ls $__resource_dir_to_load` ; do __resources_to_load="$__resource_dir_to_load/$__dir $__resources_to_load" Added: corredor/trunk/TestBucket/Logging/Logging =================================================================== --- corredor/trunk/TestBucket/Logging/Logging (rev 0) +++ corredor/trunk/TestBucket/Logging/Logging 2006-09-24 20:07:46 UTC (rev 13) @@ -0,0 +1,49 @@ +#!/bin/sh +# L O G G I N G +# Corredor +# +# Copyright (c) 2006 Christopher Sean Morrison +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +### + +LIBRARY="`dirname $0`/../../automation library" +eval "`$LIBRARY`" + +log "Logging seems to work" + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Property changes on: corredor/trunk/TestBucket/Logging/Logging ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/TestBucket/Running/Running =================================================================== --- corredor/trunk/TestBucket/Running/Running (rev 0) +++ corredor/trunk/TestBucket/Running/Running 2006-09-24 20:07:46 UTC (rev 13) @@ -0,0 +1,84 @@ +#!/bin/sh +# T E M P L A T E +# Corredor +# +# Copyright (c) 2006 Christopher Sean Morrison +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +### + +LIBRARY="`dirname $0`/../../automation library" +eval "`$LIBRARY`" + +ACTION="$1" + +DUMMY=0 + +# start variables don't share environment, so should be unset +start ( ) { + unset DUMMY + initializeVariable DUMMY 1 + if ! variableIsTrue DUMMY ; then + log "start action did not initialize the DUMMY variable" + return 1 + fi + export DUMMY + + return 0 +} + +run "$ACTION" +ret=$? + +exit +case "x$ACTION" in + x[sS][tT][aA][rR][tT] ) + if [ "x$ret" != "x0" ] ; then + log "run returned non-zero ($ret) result" + exit 1 + fi + + if variableIsTrue DUMMY ; then + log "start action initialization of DUMMY variable should not be shared with parent" + exit 2 + fi + ;; +esac + +exit $ret + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Property changes on: corredor/trunk/TestBucket/Running/Running ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: corredor/trunk/TestBucket/Shell/Shell =================================================================== --- corredor/trunk/TestBucket/Shell/Shell 2006-09-24 06:37:30 UTC (rev 12) +++ corredor/trunk/TestBucket/Shell/Shell 2006-09-24 20:07:46 UTC (rev 13) @@ -1,9 +1,52 @@ #!/bin/sh +# S H E L L +# Corredor +# +# Copyright (c) 2006 Christopher Sean Morrison +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +### -LIBRARY="`dirname $0`/../../corredor library" +LIBRARY="`dirname $0`/../../automation library" eval "`$LIBRARY`" -# if we get this far, the shell works... let's make sure +/bin/sh <<EOF +echo "/bin/sh seems to work" +EOF +# if we got this far, the shell probably works... -log "shell works" - +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/TestBucket/Template/Template =================================================================== --- corredor/trunk/TestBucket/Template/Template 2006-09-24 06:37:30 UTC (rev 12) +++ corredor/trunk/TestBucket/Template/Template 2006-09-24 20:07:46 UTC (rev 13) @@ -1,13 +1,46 @@ #!/bin/sh +# T E M P L A T E +# Corredor # -# t e m p l a t e +# Copyright (c) 2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +### +# # This is a test template that does nothing of utility. There is a stub for -# the start function, which is the only function that must be defined. +# the start function, which is the only function that should be defined. # ### # Source function library -. `dirname $0`/library +LIBRARY="`dirname $0`/../../automation library" +eval "`$LIBRARY`" # see library for a list of variables available for use in your script @@ -22,6 +55,15 @@ return 0 } -execute $1 +run $1 exit $? + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Added: corredor/trunk/TestBucket/Variables/Variables =================================================================== --- corredor/trunk/TestBucket/Variables/Variables (rev 0) +++ corredor/trunk/TestBucket/Variables/Variables 2006-09-24 20:07:46 UTC (rev 13) @@ -0,0 +1,65 @@ +#!/bin/sh +# T E M P L A T E +# Corredor +# +# Copyright (c) 2006 Christopher Sean Morrison +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +### + +LIBRARY="`dirname $0`/../../automation library" +eval "`$LIBRARY`" + +initializeVariable VARIABLE test + +if [ ! "x$VARIABLE" = "xtest" ] ; then + log "VARIABLE is not initialized correctly" + exit 1 +fi + +initializeOption OPTION yes "__BOOLEAN__" "Example Option" + +if ! variableIsTrue OPTION ; then + log "OPTION is not initialized correctly" + exit 1 +fi + +log "Variable tests succeeded" + +exit 0 + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Property changes on: corredor/trunk/TestBucket/Variables/Variables ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/plain Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2006-09-24 06:37:51
|
Revision: 12 http://svn.sourceforge.net/corredor/?rev=12&view=rev Author: brlcad Date: 2006-09-23 23:37:30 -0700 (Sat, 23 Sep 2006) Log Message: ----------- add bsd license header and style footer to all the scripts, and add doc file on current behavior of the benchmarking in terms of percentages of I/O related to the various commands (not a count of invocations, but a rough estimate of time spent with each command (captured from fs_usage)). Modified Paths: -------------- corredor/trunk/Resources/Compression/Compression corredor/trunk/Resources/Environment/Environment corredor/trunk/Resources/Filesystem/Filesystem corredor/trunk/Resources/Input/Input corredor/trunk/Resources/Locking/Locking corredor/trunk/Resources/Mail/Mail corredor/trunk/Resources/Output/Output corredor/trunk/Resources/Platform/Platform corredor/trunk/Resources/ResourceFile/ResourceFile corredor/trunk/Resources/RevisionControl/RevisionControl corredor/trunk/Resources/Testing/Testing Added Paths: ----------- corredor/trunk/Documentation/benchmark_notes.txt Removed Paths: ------------- corredor/trunk/Resources/Source/ Added: corredor/trunk/Documentation/benchmark_notes.txt =================================================================== --- corredor/trunk/Documentation/benchmark_notes.txt (rev 0) +++ corredor/trunk/Documentation/benchmark_notes.txt 2006-09-24 06:37:30 UTC (rev 12) @@ -0,0 +1,21 @@ +BENCHMARK TOOL UTILIZATION + +awk results: 4524 .01447 +basename results: 20200 .06462 +cat results: 33824 .10820 +cut results: 3864 .01236 +date results: 1456 .00465 +dc results: 92 .00029 +dirname results: 1160 .00371 +expr results: 2300 .00735 +grep results: 90 .00028 +head results: 67 .00021 +ls results: 4368 .01397 +sed results: 2736 .00875 +sh results: 226820 .72560 +tail results: 71 .00022 +tr results: 9821 .03141 +uname results: 1100 .00351 +wc results: 82 .00026 +whoami results: 20 .00006 +TOTAL: 312595 .99992 Property changes on: corredor/trunk/Documentation/benchmark_notes.txt ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: corredor/trunk/Resources/Compression/Compression =================================================================== --- corredor/trunk/Resources/Compression/Compression 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/Compression/Compression 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# C O M P R E S S I O N +# Corredor # -# C o m p r e s s i o n +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # unpackArchive @@ -50,3 +80,12 @@ return $? } + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/Environment/Environment =================================================================== --- corredor/trunk/Resources/Environment/Environment 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/Environment/Environment 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# E N V I R O N M E N T +# Corredor # -# E n v i r o n m e n t +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # initializeVariable @@ -696,3 +726,12 @@ # this is to avoid a freebsd /bin/sh pwd problem over nfs # initializeVariable PWD "`pwd`" __library + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/Filesystem/Filesystem =================================================================== --- corredor/trunk/Resources/Filesystem/Filesystem 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/Filesystem/Filesystem 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# F I L E S Y S T E M +# Corredor # -# F i l e s y s t e m +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # directoryEqualsDirectory @@ -74,3 +104,12 @@ return 0 } + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/Input/Input =================================================================== --- corredor/trunk/Resources/Input/Input 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/Input/Input 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# I N P U T +# Corredor # -# I n p u t +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # ask @@ -52,3 +82,12 @@ return 1 } + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/Locking/Locking =================================================================== --- corredor/trunk/Resources/Locking/Locking 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/Locking/Locking 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# L O C K I N G +# Corredor # -# L o c k i n g +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # acquireLock @@ -318,3 +348,12 @@ #__ACQUIRED_LOCKS="" #__ACQUIRED_SEMAPHORES="" + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/Mail/Mail =================================================================== --- corredor/trunk/Resources/Mail/Mail 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/Mail/Mail 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# M A I L +# Corredor # -# M a i l +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # mail @@ -195,3 +225,12 @@ return 0 } + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/Output/Output =================================================================== --- corredor/trunk/Resources/Output/Output 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/Output/Output 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# O U T P U T +# Corredor # -# O u t p u t +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # log @@ -568,3 +598,12 @@ # here we turn DEBUG back on if it was initially set [ ! "x$__DEBUG_WAS_SET" = "x" ] && DEBUG="$__DEBUG_WAS_SET" && unset __DEBUG_WAS_SET + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/Platform/Platform =================================================================== --- corredor/trunk/Resources/Platform/Platform 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/Platform/Platform 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# P L A T F O R M +# Corredor # -# P l a t f o r m +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # getPlatform @@ -27,3 +57,12 @@ initializeVariable ARCHITECTURE "`uname -s`" __library + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/ResourceFile/ResourceFile =================================================================== --- corredor/trunk/Resources/ResourceFile/ResourceFile 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/ResourceFile/ResourceFile 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# R E S O U R C E F I L E +# Corredor # -# E x e c u t i o n +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # loadSourceFile @@ -113,3 +143,12 @@ unset _SM _RLINES _LIB _THIS_FILE } + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/RevisionControl/RevisionControl =================================================================== --- corredor/trunk/Resources/RevisionControl/RevisionControl 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/RevisionControl/RevisionControl 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# R E V I S I O N C O N T R O L +# Corredor # -# R e v i s i o n C o n t r o l +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # cvsExport @@ -60,3 +90,12 @@ return 0 } + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Modified: corredor/trunk/Resources/Testing/Testing =================================================================== --- corredor/trunk/Resources/Testing/Testing 2006-09-23 06:16:38 UTC (rev 11) +++ corredor/trunk/Resources/Testing/Testing 2006-09-24 06:37:30 UTC (rev 12) @@ -1,7 +1,37 @@ #!/bin/sh +# T E S T I N G +# Corredor # -# T e s t i n g +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### # # logSuccess @@ -413,3 +443,12 @@ return $? } + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2006-09-23 06:17:07
|
Revision: 11 http://svn.sourceforge.net/corredor/?rev=11&view=rev Author: brlcad Date: 2006-09-22 23:16:38 -0700 (Fri, 22 Sep 2006) Log Message: ----------- major library restructuring, moving the Sources down a directory so that they're just Resources now. additionally, beef up the resource checking in the library loader so that it checks more thoroughly for validity. rework how callers of the library will function, requiring RESOURCE_LIBRARY to be set or to go through the automation tool. Modified Paths: -------------- corredor/trunk/Documentation/TODO corredor/trunk/Resources/ResourceFile/ResourceFile corredor/trunk/Resources/library corredor/trunk/automation Added Paths: ----------- corredor/trunk/Documentation/example.sh corredor/trunk/Resources/Compression/ corredor/trunk/Resources/Environment/ corredor/trunk/Resources/Filesystem/ corredor/trunk/Resources/Input/ corredor/trunk/Resources/Locking/ corredor/trunk/Resources/Mail/ corredor/trunk/Resources/Output/ corredor/trunk/Resources/Platform/ corredor/trunk/Resources/ResourceFile/ corredor/trunk/Resources/RevisionControl/ corredor/trunk/Resources/Testing/ corredor/trunk/Resources/Transport/ Removed Paths: ------------- corredor/trunk/Resources/Source/Compression/ corredor/trunk/Resources/Source/Environment/ corredor/trunk/Resources/Source/Filesystem/ corredor/trunk/Resources/Source/Input/ corredor/trunk/Resources/Source/Locking/ corredor/trunk/Resources/Source/Mail/ corredor/trunk/Resources/Source/Output/ corredor/trunk/Resources/Source/Platform/ corredor/trunk/Resources/Source/ResourceFile/ corredor/trunk/Resources/Source/RevisionControl/ corredor/trunk/Resources/Source/Testing/ corredor/trunk/Resources/Source/Transport/ corredor/trunk/Resources/test.sh Modified: corredor/trunk/Documentation/TODO =================================================================== --- corredor/trunk/Documentation/TODO 2006-09-22 14:00:10 UTC (rev 10) +++ corredor/trunk/Documentation/TODO 2006-09-23 06:16:38 UTC (rev 11) @@ -12,9 +12,7 @@ * basic local operation respecting test dependencies -* basic documentation on installation and setup - THESE SHOULD HAPPEN WITHIN TWO RELEASE ITERATIONS ------------------------------------------------- @@ -35,7 +33,7 @@ * modules for system characteristics (cpu, architecture, OS, versions, memory, disks, network, etc) -* modules for various command tools (posix or otherwise) +* modules for checking for various command tools (posix or otherwise) * ability to step through scripts one statement at a time for debugging and testing support Copied: corredor/trunk/Documentation/example.sh (from rev 10, corredor/trunk/Resources/test.sh) =================================================================== --- corredor/trunk/Documentation/example.sh (rev 0) +++ corredor/trunk/Documentation/example.sh 2006-09-23 06:16:38 UTC (rev 11) @@ -0,0 +1,15 @@ +#!/bin/sh + +echo "0: $0 1: $1 #: $# *: $*" +. "`dirname $0`/../automation library" + +use Output +use Transport + +log "looping from 0 to 9" +x=0 +while [ $x -lt 10 ] ; do + isLocalhost asdf.asdfasdf + x=`expr $x + 1` +done +log "done looping" \ No newline at end of file Copied: corredor/trunk/Resources/Compression (from rev 10, corredor/trunk/Resources/Source/Compression) Copied: corredor/trunk/Resources/Environment (from rev 10, corredor/trunk/Resources/Source/Environment) Copied: corredor/trunk/Resources/Filesystem (from rev 10, corredor/trunk/Resources/Source/Filesystem) Copied: corredor/trunk/Resources/Input (from rev 10, corredor/trunk/Resources/Source/Input) Copied: corredor/trunk/Resources/Locking (from rev 10, corredor/trunk/Resources/Source/Locking) Copied: corredor/trunk/Resources/Mail (from rev 10, corredor/trunk/Resources/Source/Mail) Copied: corredor/trunk/Resources/Output (from rev 10, corredor/trunk/Resources/Source/Output) Copied: corredor/trunk/Resources/Platform (from rev 10, corredor/trunk/Resources/Source/Platform) Copied: corredor/trunk/Resources/ResourceFile (from rev 10, corredor/trunk/Resources/Source/ResourceFile) Modified: corredor/trunk/Resources/ResourceFile/ResourceFile =================================================================== --- corredor/trunk/Resources/Source/ResourceFile/ResourceFile 2006-09-22 14:00:10 UTC (rev 10) +++ corredor/trunk/Resources/ResourceFile/ResourceFile 2006-09-23 06:16:38 UTC (rev 11) @@ -33,7 +33,7 @@ if [ ! "x$?" = "x0" ] ; then warn "Unable to properly load resource file" -p return 1 + return 1 fi return 0 Copied: corredor/trunk/Resources/RevisionControl (from rev 10, corredor/trunk/Resources/Source/RevisionControl) Copied: corredor/trunk/Resources/Testing (from rev 10, corredor/trunk/Resources/Source/Testing) Copied: corredor/trunk/Resources/Transport (from rev 10, corredor/trunk/Resources/Source/Transport) Modified: corredor/trunk/Resources/library =================================================================== --- corredor/trunk/Resources/library 2006-09-22 14:00:10 UTC (rev 10) +++ corredor/trunk/Resources/library 2006-09-23 06:16:38 UTC (rev 11) @@ -1,44 +1,74 @@ #!/bin/sh +# L I B R A R Y +# Corredor # -# l i b r a r y +# Copyright (c) 2003-2006 Christopher Sean Morrison # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ### -# this is a general purpose bourne shell utility library that provides a set -# of environment variables and function calls. the primary intended usage is -# is as the manager for loading and running modules of run-time functionality. # -# do not copy the routines found here or those in submodules. instead, -# load this library into scripts: +# this is a general purpose bourne shell utility library that +# provides a set of environment variables and function calls. the +# primary intended usage is is as the manager for loading and +# running modules of run-time functionality. # -# . `dirname $0`/library +# do not copy the routines found here or those in submodules. +# instead, load this library into scripts: # -# dirname is used so that the including scripts may be called from any path -# and the library script will be found and included regardless of the script -# or shell behavior. +# RESOURCE_LIBRARY=/path/to/library +# . "$RESOURCE_LIBRARY" # -# alternatively, and recommended for automation test scripts, include this -# library via the automation "library" command: +# alternatively, and recommended for automation test scripts, +# include this library via the automation "library" command: # -# LIBRARY="`dirname $0`/../../automation library" -# eval "`$LIBRARY`" +# eval "`/path/to/automation library`" # -# the contents of this library as well as all available resources are -# evaluated and made available to the running test. this includes providing -# additional automation-specific test-run functionality to future tests. +# the contents of this library as well as all available resources +# are evaluated and made available to the running test. this +# includes providing additional automation-specific test-run +# functionality to future tests. # -# listed below are the core functions and variables that are provided by -# sourcing this script. see the respective function for more details on what -# arguments are accepted and how the function behaves. +# listed below are the core functions and variables that are +# provided by sourcing this script. see the respective function for +# more details on what arguments are accepted and how the function +# behaves. # ### # # FUNCTIONS # -# loadResource resource [catalog] -# loads an individual resource into the current environment +# use Resource [catalog] +# loads an individual Resource into the current environment # -# loadAllResources [catalog] -# loads all resources available +# load [catalog] +# loads all resources available in a given catalog # # INTERNAL FUNCTIONS # @@ -46,26 +76,28 @@ # loads registered resources into the executing environment # # registerResource resourceName resource [description] [provides] [requires] [uses] [orderPreference] -# registers a resource, making note of its dependancies and execution ordering +# registers a resource, making note of its dependancies and +# execution ordering # # registerInvalidResource resourceName resource -# registers a resource as invalid to denote that it should be skipped during sourcing +# registers a resource as invalid to denote that it should be +# skipped during sourcing # ### # # VARIABLES # # LIBRARY_VERSION -# version of this library file being used (majorRelease.minorRelease[.patch]) -# LIBRARY_RESOURCE_DIR -# location of the library resource bundle -# PSD -# path to the directory where this library was sourced FROM (not where it is) +# version of this library file being used (major.minor[.patch]) # +# RESOURCE_LIBRARY +# users of the library should set this variable to the path of the +# resource directory ### # # INTERNAL VARIABLES (do not use or rely on) # +# __DEBUG # __SOURCE_LIBRARY # __* # @@ -100,508 +132,564 @@ # capture any command line args just in case they get clobbered some[how|where] -__DOLLAR_ZERO="$0" -__DOLLAR_ONE="$1" +__ARGS="$*" +__ARG0="$0" +__ARG1="$1" +__ARGC="$#" # version of this library script file -LIBRARY_VERSION=0.2.0 ; export LIBRARY_VERSION +LIBRARY_VERSION=0.3.0 ; export LIBRARY_VERSION +# [ ! "x$__DEBUG" = x ] && echo "0: $__ARG0 1: $__ARG1 #: $__ARGC *: $__ARGS" 1>&2 -# set PSD to the directory where this library file was SOURCED IN FROM. -# this is not usually where this library file actually resides, unless the -# library is being run directly from the command line (e.g. sh library). -case "$__DOLLAR_ZERO" in - # hard path to sourcing script - /* ) - PSD="`dirname $__DOLLAR_ZERO`" ;; - # relative path to sourcing script - */* ) - PSD="`pwd`/`dirname $__DOLLAR_ZERO`" ;; - # sourcing script is in the path - * ) - PSD="`pwd`" ;; -esac - - -if [ "x`basename $__DOLLAR_ZERO`" = "xlibrary" ] ; then - # this should be the more common case for the automation suite where - # library is contained in a resources directory. - LIBRARY_RESOURCE_DIR="`dirname $__DOLLAR_ZERO`/Source" +if [ ! "x$RESOURCE_LIBRARY" = "x" ] ; then + __PATH_TO_LIBRARY="`dirname $RESOURCE_LIBRARY`" + __NAME_OF_LIBRARY="`basename $RESOURCE_LIBRARY`" else - # this case should only happen when the library file is run explicitly - LIBRARY_RESOURCE_DIR="`dirname $__DOLLAR_ZERO`/Resources/Source" + __PATH_TO_LIBRARY="`dirname -- $__ARG0`" + __NAME_OF_LIBRARY="`basename -- $__ARG0`" fi -[ ! -d "$LIBRARY_RESOURCE_DIR" ] && echo "Resource directory was not found" +__LIBRARY="$__PATH_TO_LIBRARY/$__NAME_OF_LIBRARY" +if [ ! -f "$__LIBRARY" ] ; then + echo "INTERNAL ERROR: $__LIBRARY does not exist" 1>&2 + if [ ! "x$__ARG0" = "x$__LIBRARY" ] ; then + echo "INTERNAL ERROR: dirname/basename inconsistency: $__ARG0 != $__LIBRARY" 1>&2 + fi +fi +[ ! -d "$__PATH_TO_LIBRARY" ] && echo "Resource directory was not found" 1>&2 # # sourceResource [resource] [...] # -# loads registered resources into the executing environment. the resources -# must have been previously registered via registerResource() in order for the -# sourcing to be recorded and loaded properly. dependancies are taken into -# account, and they will be loaded if they are available. the args should be -# just the resource names, not the full path +# loads registered resources into the executing environment. the +# resources must have been previously registered via +# registerResource() in order for the sourcing to be recorded and +# loaded properly. dependancies are taken into account, and they will +# be loaded if they are available. the args should be just the +# resource names, not the full path # sourceResource ( ) { - __SOURCED="" - __TO_BE_SOURCED="$@" - while [ ! "x$__TO_BE_SOURCED" = "x" ] ; do + [ ! "x$__DEBUG" = x ] && echo "" 1>&2 + [ ! "x$__DEBUG" = x ] && echo "BEGIN sourceResource $*" 1>&2 + [ ! "x$__DEBUG" = x ] && echo "" 1>&2 - # generate a list of everything now provided - __AVAILABLE_RESOURCES="" - for __resource_name in $__SOURCED ; do - __prov_var="echo \$__${__resource_name}__PROVIDES" - __prov=`eval "$__prov_var"` - __AVAILABLE_RESOURCES="$__AVAILABLE_RESOURCES $__prov" - done + __SOURCED="" + __TO_BE_SOURCED="$@" + while [ ! "x$__TO_BE_SOURCED" = "x" ] ; do - # figure out who is ready to be sourced - __ELIGIBLE_RESOURCES="" - for __resource_name in $__TO_BE_SOURCED ; do + # generate a list of everything now provided + __AVAILABLE_RESOURCES="" + for __resource_name in $__SOURCED ; do + __prov_var="echo \$__${__resource_name}__PROVIDES" + __prov=`eval "$__prov_var"` + __AVAILABLE_RESOURCES="$__AVAILABLE_RESOURCES $__prov" + done - __pref_var="echo \$__${__resource_name}__REQUIRES" - __requires="`eval $__pref_var`" - if [ "x$__requires" = "x" ] ; then - __ELIGIBLE_RESOURCES="$__ELIGIBLE_RESOURCES $__resource_name" - else - # see if all requirements are fulfilled - __still_pending="" - for __need_req in $__requires ; do - __found=0 - for __avail_req in $__AVAILABLE_RESOURCES ; do - if [ "x$__need_req" = "x$__avail_req" ] ; then - __found=1 - break - fi - done - # if the resource was not available, we can stop right - # away since we only need one requirement - if [ "x$__found" = "x0" ] ; then - __still_pending="$__still_pending $__need_req" - break - fi - done - # if we got through all of that and nothing was still pending, - # we are eligible to process - if [ "x$__still_pending" = "x" ] ; then - __ELIGIBLE_RESOURCES="$__ELIGIBLE_RESOURCES $__resource_name" - fi + # figure out who is ready to be sourced + __ELIGIBLE_RESOURCES="" + for __resource_name in $__TO_BE_SOURCED ; do + # make sure it is registered + __path_var="echo \$__${__resource_name}" + __path=`eval "$__path_var"` + [ ! "x$__DEBUG" = x ] && echo "looking at $__resource_name (path=$__path)" 1>&2 + + if [ "x$__path" = "x" ] ; then + [ ! "x$__DEBUG" = x ] && echo "$__resource_name is NOT REGISTERED" 1>&2 + __SOURCED="$__SOURCED $__resource_name" + continue; + fi + + __pref_var="echo \$__${__resource_name}__REQUIRES" + __requires="`eval $__pref_var`" + if [ "x$__requires" = "x" ] ; then + __ELIGIBLE_RESOURCES="$__ELIGIBLE_RESOURCES $__resource_name" + else + # see if all requirements are fulfilled + __still_pending="" + for __need_req in $__requires ; do + __found=0 + for __avail_req in $__AVAILABLE_RESOURCES ; do + if [ "x$__need_req" = "x$__avail_req" ] ; then + __found=1 + break fi + done + # if the resource was not available, we can stop right + # away since we only need one requirement + if [ "x$__found" = "x0" ] ; then + __still_pending="$__still_pending $__need_req" + break + fi done + # if we got through all of that and nothing was still pending, + # we are eligible to process + if [ "x$__still_pending" = "x" ] ; then + __ELIGIBLE_RESOURCES="$__ELIGIBLE_RESOURCES $__resource_name" + fi + fi + done - # of everyone eligible to go, refer to their order preferance, and - # source in their order preference + # of everyone eligible to go, refer to their order preferance, and + # source in their order preference - __to_source="" - for __resource_name in $__ELIGIBLE_RESOURCES ; do - __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" - __pref=`eval "$__pref_var"` - case "$__pref" in - First | first ) + ######### + # FIRST # + ######### + __to_source="" + for __resource_name in $__ELIGIBLE_RESOURCES ; do + __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" + __pref=`eval "$__pref_var"` + case "x$__pref" in + x[fF][iI][rR][sS][tT] ) __to_source="$__to_source $__resource_name" - continue - ;; - esac - done - for __resource_name in $__to_source ; do - __path_var="echo \$__${__resource_name}" - __path=`eval "$__path_var"` - if [ -f "$__path/$__resource_name" ] ; then -# echo "SOURCING $__path/$__resource_name" - if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then - cat $__path/$__resource_name - else - eval "`cat $__path/$__resource_name`" - fi - elif [ -d "$__path/$__resource_name" ] ; then -# echo "SOURCING DIR $__path/$__resource_name" + continue + ;; + esac + done + for __resource_name in $__to_source ; do + __path_var="echo \$__${__resource_name}" + __path=`eval "$__path_var"` + [ ! "x$__DEBUG" = x ] && echo "PROCESSING FIRST $__resource_name (path=$__path)" 1>&2 + if [ "x$__path" = "x" ] ; then + [ ! "x$__DEBUG" = x ] && echo "$__resource_name is NOT REGISTERED" 1>&2 + __SOURCED="$__SOURCED $__resource_name" + continue + elif [ -f "$__path/$__resource_name" ] ; then + [ ! "x$__DEBUG" = x ] && echo "SOURCING $__path/$__resource_name" 1>&2 + if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then + cat $__path/$__resource_name + else + eval "`cat $__path/$__resource_name`" + fi + elif [ -d "$__path/$__resource_name" ] ; then + [ ! "x$__DEBUG" = x ] && echo "SOURCING DIR $__path/$__resource_name" 1>&2 - __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" - eval "$__save" - __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" - eval "$__save" - __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" - eval "$__save" - __LOADING_STACK="$__resource_name $__LOADING_STACK" - loadAllResources "$__path/$__resource_name" - __resource_name="" - __new_stack="" - for __res in $__LOADING_STACK ; do - if [ "x$__resource_name" = "x" ] ; then - __resource_name="$__res" - continue - fi - __new_stack="$__new_stack $__res" - done - __LOADING_STACK="$__new_stack" - __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" - eval "$__restore" - __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" - eval "$__restore" - __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" - eval "$__restore" - else - echo "UNABLE TO FIND $__path/$__resource_name" - exit - fi - __SOURCED="$__SOURCED $__resource_name" + __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" + eval "$__save" + __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" + eval "$__save" + __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" + eval "$__save" + __LOADING_STACK="$__resource_name $__LOADING_STACK" + load "$__path/$__resource_name" + __resource_name="" + __new_stack="" + for __res in $__LOADING_STACK ; do + if [ "x$__resource_name" = "x" ] ; then + __resource_name="$__res" + continue + fi + __new_stack="$__new_stack $__res" done + __LOADING_STACK="$__new_stack" + __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" + eval "$__restore" + __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" + eval "$__restore" + __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" + eval "$__restore" + else + [ ! "x$__DEBUG" = x ] && echo "UNABLE TO FIND $__path/$__resource_name" 1>&2 + exit + fi + __SOURCED="$__SOURCED $__resource_name" + done - __to_source="" - for __resource_name in $__ELIGIBLE_RESOURCES ; do - __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" - __pref=`eval "$__pref_var"` - case "$__pref" in - Early | early ) + ######### + # EARLY # + ######### + __to_source="" + for __resource_name in $__ELIGIBLE_RESOURCES ; do + __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" + __pref=`eval "$__pref_var"` + case "x$__pref" in + x[eE][aA][rR][lL][yY] ) __to_source="$__to_source $__resource_name" - continue - ;; - esac - done - for __resource_name in $__to_source ; do - __path_var="echo \$__${__resource_name}" - __path=`eval "$__path_var"` - if [ -f "$__path/$__resource_name" ] ; then -# echo "SOURCING $__path/$__resource_name" - if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then - cat $__path/$__resource_name - else - eval "`cat $__path/$__resource_name`" - fi - elif [ -d "$__path/$__resource_name" ] ; then -# echo "SOURCING DIR $__path/$__resource_name" + continue + ;; + esac + done + for __resource_name in $__to_source ; do + __path_var="echo \$__${__resource_name}" + __path=`eval "$__path_var"` + [ ! "x$__DEBUG" = x ] && echo "PROCESSING EARLY $__resource_name (path=$__path)" 1>&2 + if [ "x$__path" = "x" ] ; then + [ ! "x$__DEBUG" = x ] && echo "$__resource_name is NOT REGISTERED" 1>&2 + __SOURCED="$__SOURCED $__resource_name" + continue + elif [ -f "$__path/$__resource_name" ] ; then + [ ! "x$__DEBUG" = x ] && echo "SOURCING $__path/$__resource_name" 1>&2 + if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then + cat $__path/$__resource_name + else + eval "`cat $__path/$__resource_name`" + fi + elif [ -d "$__path/$__resource_name" ] ; then + [ ! "x$__DEBUG" = x ] && echo "SOURCING DIR $__path/$__resource_name" 1>&2 - __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" - eval "$__save" - __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" - eval "$__save" - __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" - eval "$__save" - __LOADING_STACK="$__resource_name $__LOADING_STACK" - loadAllResources "$__path/$__resource_name" - __resource_name="" - __new_stack="" - for __res in $__LOADING_STACK ; do - if [ "x$__resource_name" = "x" ] ; then - __resource_name="$__res" - continue - fi - __new_stack="$__new_stack $__res" - done - __LOADING_STACK="$__new_stack" - __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" - eval "$__restore" - __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" - eval "$__restore" - __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" - eval "$__restore" - else - echo "UNABLE TO FIND $__path/$__resource_name" - exit - fi - __SOURCED="$__SOURCED $__resource_name" + __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" + eval "$__save" + __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" + eval "$__save" + __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" + eval "$__save" + __LOADING_STACK="$__resource_name $__LOADING_STACK" + load "$__path/$__resource_name" + __resource_name="" + __new_stack="" + for __res in $__LOADING_STACK ; do + if [ "x$__resource_name" = "x" ] ; then + __resource_name="$__res" + continue + fi + __new_stack="$__new_stack $__res" done + __LOADING_STACK="$__new_stack" + __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" + eval "$__restore" + __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" + eval "$__restore" + __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" + eval "$__restore" + else + [ ! "x$__DEBUG" = x ] && echo "UNABLE TO FIND $__path/$__resource_name" 1>&2 + exit + fi + __SOURCED="$__SOURCED $__resource_name" + done - __to_source="" - for __resource_name in $__ELIGIBLE_RESOURCES ; do - __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" - __pref=`eval "$__pref_var"` - [ "x$__pref" = "x" ] && __pref="None" - case "$__pref" in - None | none ) + ######## + # NONE # + ######## + __to_source="" + for __resource_name in $__ELIGIBLE_RESOURCES ; do + __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" + __pref=`eval "$__pref_var"` + [ "x$__pref" = "x" ] && __pref="None" + case "x$__pref" in + x[nN][oO][nN][eE] ) __to_source="$__to_source $__resource_name" - continue - ;; - esac + continue + ;; + esac + done + for __resource_name in $__to_source ; do + __path_var="echo \$__${__resource_name}" + __path=`eval "$__path_var"` + [ ! "x$__DEBUG" = x ] && echo "PROCESSING NONE $__resource_name (path=$__path)" 1>&2 + if [ "x$__path" = "x" ] ; then + [ ! "x$__DEBUG" = x ] && echo "$__resource_name is NOT REGISTERED" 1>&2 + __SOURCED="$__SOURCED $__resource_name" + continue + elif [ "x$__path" = "x__INVALID__" ] ; then + # invalid resources handled here, since they should + # have no no order preference set.. + [ ! "x$__DEBUG" = x ] && echo "$__resource_name is INVALID" 1>&2 + __SOURCED="$__SOURCED $__resource_name" + continue + elif [ -f "$__path/$__resource_name" ] ; then + [ ! "x$__DEBUG" = x ] && echo "SOURCING $__path/$__resource_name" 1>&2 + if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then + cat $__path/$__resource_name + else + eval "`cat $__path/$__resource_name`" + fi + elif [ -d "$__path/$__resource_name" ] ; then + [ ! "x$__DEBUG" = x ] && echo "SOURCING DIR $__path/$__resource_name" 1>&2 + + __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" + eval "$__save" + __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" + eval "$__save" + __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" + eval "$__save" + __LOADING_STACK="$__resource_name $__LOADING_STACK" + load "$__path/$__resource_name" + __resource_name="" + __new_stack="" + for __res in $__LOADING_STACK ; do + if [ "x$__resource_name" = "x" ] ; then + __resource_name="$__res" + continue + fi + __new_stack="$__new_stack $__res" done - for __resource_name in $__to_source ; do - __path_var="echo \$__${__resource_name}" - __path=`eval "$__path_var"` - if [ -f "$__path/$__resource_name" ] ; then -# echo "SOURCING $__path/$__resource_name" - if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then - cat $__path/$__resource_name - else - eval "`cat $__path/$__resource_name`" - fi - elif [ -d "$__path/$__resource_name" ] ; then -# echo "SOURCING DIR $__path/$__resource_name" + __LOADING_STACK="$__new_stack" + __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" + eval "$__restore" + __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" + eval "$__restore" + __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" + eval "$__restore" - __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" - eval "$__save" - __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" - eval "$__save" - __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" - eval "$__save" - __LOADING_STACK="$__resource_name $__LOADING_STACK" - loadAllResources "$__path/$__resource_name" - __resource_name="" - __new_stack="" - for __res in $__LOADING_STACK ; do - if [ "x$__resource_name" = "x" ] ; then - __resource_name="$__res" - continue - fi - __new_stack="$__new_stack $__res" - done - __LOADING_STACK="$__new_stack" - __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" - eval "$__restore" - __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" - eval "$__restore" - __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" - eval "$__restore" + else + [ ! "x$__DEBUG" = x ] && echo "UNABLE TO FIND $__path/$__resource_name" 1>&2 + exit + fi + __SOURCED="$__SOURCED $__resource_name" + done - # invalid resources handled here, since they should have no - # no order preference set.. - elif [ "x$__path" = "x__INVALID__" ] ; then -# echo "$__resource_name is INVALID" - __SOURCED="$__SOURCED $__resource_name" - continue - else - echo "UNABLE TO FIND $__path/$__resource_name" - exit - fi - __SOURCED="$__SOURCED $__resource_name" - done - - __to_source="" - for __resource_name in $__ELIGIBLE_RESOURCES ; do - __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" - __pref=`eval "$__pref_var"` - case "$__pref" in - Late | late ) + ######## + # LATE # + ######## + __to_source="" + for __resource_name in $__ELIGIBLE_RESOURCES ; do + __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" + __pref=`eval "$__pref_var"` + case "x$__pref" in + x[lL][aA][tT][eE] ) __to_source="$__to_source $__resource_name" - continue - ;; - esac - done - for __resource_name in $__to_source ; do - __path_var="echo \$__${__resource_name}" - __path=`eval "$__path_var"` - if [ -f "$__path/$__resource_name" ] ; then -# echo "SOURCING $__path/$__resource_name" - if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then - cat $__path/$__resource_name - else - eval "`cat $__path/$__resource_name`" - fi - elif [ -d "$__path/$__resource_name" ] ; then -# echo "SOURCING DIR $__path/$__resource_name" + continue + ;; + esac + done + for __resource_name in $__to_source ; do + __path_var="echo \$__${__resource_name}" + __path=`eval "$__path_var"` + [ ! "x$__DEBUG" = x ] && echo "PROCESSING LATE $__resource_name (path=$__path)" 1>&2 + if [ "x$__path" = "x" ] ; then + [ ! "x$__DEBUG" = x ] && echo "$__resource_name is NOT REGISTERED" 1>&2 + __SOURCED="$__SOURCED $__resource_name" + continue + elif [ -f "$__path/$__resource_name" ] ; then +# [ ! "x$__DEBUG" = x ] && echo "SOURCING $__path/$__resource_name" 1>&2 + if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then + cat $__path/$__resource_name + else + eval "`cat $__path/$__resource_name`" + fi + elif [ -d "$__path/$__resource_name" ] ; then +# [ ! "x$__DEBUG" = x ] && echo "SOURCING DIR $__path/$__resource_name" 1>&2 - __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" - eval "$__save" - __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" - eval "$__save" - __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" - eval "$__save" - __LOADING_STACK="$__resource_name $__LOADING_STACK" - loadAllResources "$__path/$__resource_name" - __resource_name="" - __new_stack="" - for __res in $__LOADING_STACK ; do - if [ "x$__resource_name" = "x" ] ; then - __resource_name="$__res" - continue - fi - __new_stack="$__new_stack $__res" - done - __LOADING_STACK="$__new_stack" - __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" - eval "$__restore" - __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" - eval "$__restore" - __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" - eval "$__restore" - else - echo "UNABLE TO FIND $__path/$__resource_name" - exit - fi - __SOURCED="$__SOURCED $__resource_name" + __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" + eval "$__save" + __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" + eval "$__save" + __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" + eval "$__save" + __LOADING_STACK="$__resource_name $__LOADING_STACK" + load "$__path/$__resource_name" + __resource_name="" + __new_stack="" + for __res in $__LOADING_STACK ; do + if [ "x$__resource_name" = "x" ] ; then + __resource_name="$__res" + continue + fi + __new_stack="$__new_stack $__res" done + __LOADING_STACK="$__new_stack" + __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" + eval "$__restore" + __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" + eval "$__restore" + __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" + eval "$__restore" + else + [ ! "x$__DEBUG" = x ] && echo "UNABLE TO FIND $__path/$__resource_name" 1>&2 + exit + fi + __SOURCED="$__SOURCED $__resource_name" + done - __to_source="" - for __resource_name in $__ELIGIBLE_RESOURCES ; do - __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" - __pref=`eval "$__pref_var"` - case "$__pref" in - Last | last ) + ######## + # LAST # + ######## + __to_source="" + for __resource_name in $__ELIGIBLE_RESOURCES ; do + __pref_var="echo \$__${__resource_name}__ORDERPREFERENCE" + __pref=`eval "$__pref_var"` + case "x$__pref" in + x[lL][aA][sS][tT] ) __to_source="$__to_source $__resource_name" - continue - ;; - esac - done - for __resource_name in $__to_source ; do - __path_var="echo \$__${__resource_name}" - __path=`eval "$__path_var"` - if [ -f "$__path/$__resource_name" ] ; then -# echo "SOURCING $__path" - if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then - cat $__path/$__resource_name - else - eval "`cat $__path/$__resource_name`" - fi - elif [ -d "$__path/$__resource_name" ] ; then -# echo "SOURCING DIR $__path/$__resource_name" + continue + ;; + esac + done + for __resource_name in $__to_source ; do + __path_var="echo \$__${__resource_name}" + __path=`eval "$__path_var"` + [ ! "x$__DEBUG" = x ] && echo "PROCESSING LAST $__resource_name (path=$__path)" 1>&2 + if [ "x$__path" = "x" ] ; then + [ ! "x$__DEBUG" = x ] && echo "$__resource_name is NOT REGISTERED" 1>&2 + __SOURCED="$__SOURCED $__resource_name" + continue + elif [ -f "$__path/$__resource_name" ] ; then +# [ ! "x$__DEBUG" = x ] && echo "SOURCING $__path" 1>&2 + if [ "x$__SOURCE_LIBRARY" = "x1" ] ; then + cat $__path/$__resource_name + else + eval "`cat $__path/$__resource_name`" + fi + elif [ -d "$__path/$__resource_name" ] ; then +# [ ! "x$__DEBUG" = x ] && echo "SOURCING DIR $__path/$__resource_name" 1>&2 - __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" - eval "$__save" - __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" - eval "$__save" - __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" - eval "$__save" - __LOADING_STACK="$__resource_name $__LOADING_STACK" - loadAllResources "$__path/$__resource_name" - __resource_name="" - __new_stack="" - for __res in $__LOADING_STACK ; do - if [ "x$__resource_name" = "x" ] ; then - __resource_name="$__res" - continue - fi - __new_stack="$__new_stack $__res" - done - __LOADING_STACK="$__new_stack" - __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" - eval "$__restore" - __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" - eval "$__restore" - __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" - eval "$__restore" - else - echo "UNABLE TO FIND $__path/$__resource_name" - exit - fi - __SOURCED="$__SOURCED $__resource_name" + __save="__ELIGIBLE_RESOURCES_${__resource_name}=\"$__ELIGIBLE_RESOURCES\"" + eval "$__save" + __save="__SOURCED_${__resource_name}=\"$__SOURCED\"" + eval "$__save" + __save="__TO_BE_SOURCED_${__resource_name}=\"$__TO_BE_SOURCED\"" + eval "$__save" + __LOADING_STACK="$__resource_name $__LOADING_STACK" + load "$__path/$__resource_name" + __resource_name="" + __new_stack="" + for __res in $__LOADING_STACK ; do + if [ "x$__resource_name" = "x" ] ; then + __resource_name="$__res" + continue + fi + __new_stack="$__new_stack $__res" done + __LOADING_STACK="$__new_stack" + __restore="__ELIGIBLE_RESOURCES=\"\$__ELIGIBLE_RESOURCES_${__resource_name}\"" + eval "$__restore" + __restore="__SOURCED=\"\$__SOURCED_${__resource_name}\"" + eval "$__restore" + __restore="__TO_BE_SOURCED=\"\$__TO_BE_SOURCED_${__resource_name}\"" + eval "$__restore" + else + [ ! "x$__DEBUG" = x ] && echo "UNABLE TO FIND $__path/$__resource_name" 1>&2 + exit + fi + __SOURCED="$__SOURCED $__resource_name" + done - # update iteration counter -- remove completed items - __new_to_be="" - for __resource_name in $__TO_BE_SOURCED ; do - __found=0 - for __sourced_name in $__SOURCED ; do - if [ "x$__sourced_name" = "x$__resource_name" ] ; then - __found=1 - break - fi - done - if [ "x$__found" = "x0" ] ; then - __new_to_be="$__new_to_be $__resource_name" - fi - done - __TO_BE_SOURCED="$__new_to_be" - + # update iteration counter -- remove completed items + __new_to_be="" + for __resource_name in $__TO_BE_SOURCED ; do + __found=0 + for __sourced_name in $__SOURCED ; do + if [ "x$__sourced_name" = "x$__resource_name" ] ; then + __found=1 + break + fi + done + if [ "x$__found" = "x0" ] ; then + __new_to_be="$__new_to_be $__resource_name" + fi done - # done iterating over resources to be sourced + __TO_BE_SOURCED="$__new_to_be" - return 0 + [ ! "x$__DEBUG" = x ] && echo "REMAINING TO BE SOURCED: $__TO_BE_SOURCED" + done + # done iterating over resources to be sourced + + [ ! "x$__DEBUG" = x ] && echo "" 1>&2 + [ ! "x$__DEBUG" = x ] && echo "END sourceResource $*" 1>&2 + [ ! "x$__DEBUG" = x ] && echo "" 1>&2 + + return 0 } + # # registerResource resourceName resource [description] [provides] [requires] [uses] [orderPreference] # -# registers the given resource using the provided attributes. -# "resource/resourceName" should be the path to the actual resource executable. -# "description" is a short textual description of the resource. provides is a -# list of resources that the resource provides (a resource may provide multiple -# resources). "requires" is a list of resources that must be loaded before -# this resource may be loaded. "uses" is denoted to describe an optional -# resource that may be utilized either during sourcing or during execution, but -# is not strictly required. "orderPreference" may be one of "First", "Early", -# "None", "Late", "Last" or left null/empty (which implies "None") -- the order -# preference is used to denote source ordering of available resources that have -# equivalent run-time priority. +# registers the given resource using the provided attributes. +# "resource/resourceName" should be the path to the actual resource +# executable. "description" is a short textual description of the +# resource. provides is a list of resources that the resource +# provides (a resource may provide multiple resources). "requires" is +# a list of resources that must be loaded before this resource may be +# loaded. "uses" is denoted to describe an optional resource that may +# be utilized either during sourcing or during execution, but is not +# strictly required. "orderPreference" may be one of "First", +# "Early", "None", "Late", "Last" or left null/empty (which implies +# "None") -- the order preference is used to denote source ordering of +# available resources that have equivalent run-time priority. # registerResource ( ) { - [ "x$1" = "x" ] && return 0 || __resource_name="$1" - [ "x$2" = "x" ] && return 0 || __resource="$2" - [ "x$3" = "x" ] && __description="$__resource_name" || __description="$3" - [ "x$4" = "x" ] && __provides="$__resource_name" || __provides="$4" - [ "x$5" = "x" ] && __requires="" || __requires="$5" - [ "x$6" = "x" ] && __uses="" || __uses="$6" - [ "x$7" = "x" ] && __orderpreference="" || __orderpreference="$7" + [ "x$1" = "x" ] && return 0 || __resource_name="$1" + [ "x$2" = "x" ] && return 0 || __resource="$2" + [ "x$3" = "x" ] && __description="$__resource_name" || __description="$3" + [ "x$4" = "x" ] && __provides="$__resource_name" || __provides="$4" + [ "x$5" = "x" ] && __requires="" || __requires="$5" + [ "x$6" = "x" ] && __uses="" || __uses="$6" + [ "x$7" = "x" ] && __orderpreference="" || __orderpreference="$7" - # echo "Registering $__resource ($__description)" + [ ! "x$__DEBUG" = x ] && echo "Registering $__resource ($__description)" 1>&2 - # trim out the backslashes and dots + # trim out the backslashes and dots # this is nice for unique naming, but a bit too expensive # __resource="`echo $__resource | tr -d \/ | tr -d . `" - # echo "resource is $__resource" + # echo "resource is $__resource" 1>&2 - __path_var="echo \$__${__resource_name}" - if [ ! "x`eval $__path_var`" = "x" ] ; then -# echo "Resource $__resource_name is already registered" 1>&2 - return 0 - fi + __path_var="echo \$__${__resource_name}" + if [ ! "x`eval $__path_var`" = "x" ] ; then +# [ ! "x$__DEBUG" = x ] && echo "Resource $__resource_name is already registered" 1>&2 + return 0 + fi - __path_var="__${__resource_name}=\"$__resource\"" - eval "$__path_var" - __desc_var="__${__resource_name}__DESCRIPTION=\"$__description\"" - eval "$__desc_var" - __prov_var="__${__resource_name}__PROVIDES=\"$__provides\"" - eval "$__prov_var" - __requ_var="__${__resource_name}__REQUIRES=\"$__requires\"" - eval "$__requ_var" - __uses_var="__${__resource_name}__USES=\"$__uses\"" - eval "$__uses_var" - __pref_var="__${__resource_name}__ORDERPREFERENCE=\"$__orderpreference\"" - eval "$__pref_var" + __path_var="__${__resource_name}=\"$__resource\"" + eval "$__path_var" + __desc_var="__${__resource_name}__DESCRIPTION=\"$__description\"" + eval "$__desc_var" + __prov_var="__${__resource_name}__PROVIDES=\"$__provides\"" + eval "$__prov_var" + __requ_var="__${__resource_name}__REQUIRES=\"$__requires\"" + eval "$__requ_var" + __uses_var="__${__resource_name}__USES=\"$__uses\"" + eval "$__uses_var" + __pref_var="__${__resource_name}__ORDERPREFERENCE=\"$__orderpreference\"" + eval "$__pref_var" - return 0 + return 0 } # # registerInvalidResource resourceName resource # # makes note that a resource is not valid and should be skipped during -# sourcing. a resource is generally considered invalid if its execution -# bundle is not readable, not runable, or does not exist. +# sourcing. a resource is generally considered invalid if its +# execution bundle is not readable, not runable, or does not exist. # registerInvalidResource ( ) { - [ "x$1" = "x" ] && return 0 || __resource_name="$1" - [ "x$2" = "x" ] && return 0 || __resource="$2" + [ "x$1" = "x" ] && return 0 || __resource_name="$1" + [ "x$2" = "x" ] && return 0 || __resource="$2" - # echo "Registering IVNALID $__resource ($__description)" + [ ! "x$__DEBUG" = x ] && echo "Registering INVALID $__resource ($__description)" 1>&2 - __path_var="echo \$__${__resource_name}" - if [ ! "x`eval $__path_var`" = "x" ] ; then -# echo "Resource $__resource_name is already registered" - return 0 - fi + __path_var="echo \$__${__resource_name}" - __path_var="__${__resource_name}=\"__INVALID__\"" - eval "$__path_var" - + if [ ! "x`eval $__path_var`" = "x" ] ; then +# [ ! "x$__DEBUG" = x ] && echo "Resource $__resource_name is already registered" 1>&2 return 0 + fi - # trim out the backslashes and dots + __path_var="__${__resource_name}=\"__INVALID__\"" + eval "$__path_var" + + return 0 + + # trim out the backslashes and dots # this is nice for unique naming, but a bit too expensive # __resource="`echo $__resource | tr -d \/ | tr -d . `" - # echo "resource is $__resource" - - return 0 + # [ ! "x$__DEBUG" = x ] && echo "resource is $__resource" 1>&2 + # return 0 } # -# loadResource [resource] [...] +# use [resource] [...] # # loads a list of resources into the current running environment. the # resources are first registered, then then are sourced in. # -# resources are expected to have an executable file in the directory that -# is the same name as the resource directory's name. the resource may provide -# a "ExecutionParameters.plist" file (in the same directory) to provide a -# textual description, a list of provided resources (resource may provide more -# than one resource), a list of dependant resources that must be loaded -# beforehand, a list of other resources this resource may use but does not -# require, as well as an order preference. +# resources are expected to have an executable file in the directory +# that is the same name as the resource directory's name. the +# resource may provide a "ExecutionParameters.plist" file (in the same +# directory) to provide a textual description, a list of provided +# resources (resource may provide more than one resource), a list of +# dependant resources that must be loaded beforehand, a list of other +# resources this resource may use but does not require, as well as an +# order preference. # -# XXX as it currently stands implemented, the exec params file is simply -# sourced in and is not checked or limited. the file should be a simple -# listing of bourne shell variables. +# XXX as it currently stands implemented, the exec params file is +# simply sourced in and is not checked or limited. the file should be +# a simple listing of bourne shell variables. # # Example ExecutionParameters.plist from the Environment resource: # @@ -613,135 +701,174 @@ # # Done Example # -# "OrderPreference" may be either "First", "Early", "None", "Late", "Last", or -# unset/empty (which implies "None"). There may be multiple resource names -# listed for "Uses", "Requires", and "Provides". By convention, at least one -# of the "Provides" resources should be the name of the resource itself. -# "Description" should be a short one-line description of the resource. +# "OrderPreference" may be either "First", "Early", "None", "Late", +# "Last", or unset/empty (which implies "None"). There may be +# multiple resource names listed for "Uses", "Requires", and +# "Provides". By convention, at least one of the "Provides" resources +# should be the name of the resource itself. "Description" should be +# a short one-line description of the resource. # -loadResource ( ) { +use ( ) { + __resources_to_source="" + for __resource in $@ ; do - __resources_to_source="" - for __resource in $@ ; do + __resource_name=`basename $__resource` + [ ! "x$__DEBUG" = x ] && echo "Loading $__resource_name ($__resource)" 1>&2 - __resource_name=`basename $__resource` -# echo "Loading $__resource_name" - __resources_to_source="$__resources_to_source $__resource_name" + # make sure it's not an unsupported file name + # __unsupported="`echo $__resource_name | sed 's/[a-zA-Z_-]//g'`" + case "x$__resource_name" in + x*~* | x*\.* | x*\#* ) + [ ! "x$__DEBUG" = x ] && echo "Skipping $__resource_name due to invalid characters in the name" 1>&2 + continue + ;; + esac - if [ -d "$__resource" ] ; then + __resources_to_source="$__resources_to_source $__resource_name" - __resource_exec="$__resource/$__resource_name" - if [ -f "$__resource_exec" ] ; then + if [ -d "$__resource" ] ; then + # it's a directory + __resource_exec="$__resource/$__resource_name" + if [ -f "$__resource_exec" ] ; then - if [ -r "$__resource/ExecutionParameters.plist" ] ; then - # need to check execution parameters for order and dependancies - __Description="$Description" - __Provides="$Provides" - __Requires="$Requires" - __Uses="$Uses" - __OrderPreference="$OrderPreference" - unset Description Provides Requires Uses OrderPreference - __RSRC="`cat $__resource/ExecutionParameters.plist`" - eval "$__RSRC" + if [ -r "$__resource/ExecutionParameters.plist" ] ; then + # need to check execution parameters for order and + # dependancies. + __Description="$Description" + __Provides="$Provides" + __Requires="$Requires" + __Uses="$Uses" + __OrderPreference="$OrderPreference" + unset Description Provides Requires Uses OrderPreference + __RSRC="`cat $__resource/ExecutionParameters.plist`" + eval "$__RSRC" - registerResource "$__resource_name" "$__resource" "$Description" "$Provides" "$Requires" "$Uses" "$OrderPreference" + registerResource "$__resource_name" "$__resource" "$Description" "$Provides" "$Requires" "$Uses" "$OrderPreference" - Description="$__Description" - Provides="$__Provides" - Requires="$__Requires" - Uses="$__Uses" - OrderPreference="$__OrderPreference" - - else - registerResource "$__resource_name" "$__resource" - fi + Description="$__Description" + Provides="$__Provides" + Requires="$__Requires" + Uses="$__Uses" + OrderPreference="$__OrderPreference" + + else + registerResource "$__resource_name" "$__resource" + fi - elif [ -d "$__resource_exec" ] ; then - - if [ -r "$__resource/ExecutionParameters.plist" ] ; then - # need to check execution parameters for order and dependancies - __Description="$Description" - __Provides="$Provides" - __Requires="$Requires" - __Uses="$Uses" - __OrderPreference="$OrderPreference" - unset Description Provides Requires Uses OrderPreference - __RSRC="`cat $__resource/ExecutionParameters.plist`" - eval "$__RSRC" + elif [ -d "$__resource_exec" ] ; then + + if [ -r "$__resource/ExecutionParameters.plist" ] ; then + # need to check execution parameters for order and + # dependancies. + __Description="$Description" + __Provides="$Provides" + __Requires="$Requires" + __Uses="$Uses" + __OrderPreference="$OrderPreference" + unset Description Provides Requires Uses OrderPreference + __RSRC="`cat $__resource/ExecutionParameters.plist`" + eval "$__RSRC" - registerResource "$__resource_name" "$__resource" "$Description" "$Provides" "$Requires" "$Uses" "$OrderPreference" + registerResource "$__resource_name" "$__resource" "$Description" "$Provides" "$Requires" "$Uses" "$OrderPreference" - Description="$__Description" - Provides="$__Provides" - Requires="$__Requires" - Uses="$__Uses" - OrderPreference="$__OrderPreference" - else - registerResource "$__resource_name" "$__resource" - fi - else - registerInvalidResource "$__resource_name" "$__resource" - fi - # end check if resource contains an execution file or directory + Description="$__Description" + Provides="$__Provides" + Requires="$__Requires" + Uses="$__Uses" + OrderPreference="$__OrderPreference" + else + registerResource "$__resource_name" "$__resource" fi - # end check if resource is a directory + else + registerInvalidResource "$__resource_name" "$__resource" + fi + # end check if resource contains an execution file or directory - done - # done processing all resource names given + else + # it's a file + registerInvalidResource "$__resource_name" "$__resource" + continue -# echo "sourcing $__resources_to_source" - sourceResource $__resources_to_source + # if we did process files, register accordingly + if [ -x "$__resource" ] ; then + case "x$__resource_name" in + x*~ | x\.* | x*.o | x*.lo | x*.la | x\#* ) + registerInvalidResource "$__resource_name" "$__resource" ;; + x* ) + registerResource "$__resource_name" "$__resource" ;; + esac + else + registerInvalidResource "$__resource_name" "$__resource" + fi + fi + # end check if resource is a directory - return 0 + done + # done processing all resource names given + + sourceResource $__resources_to_source + + return 0 } # -# loadAllResources [directory] [...] +# load [directory] [...] # -# loads an entire directory of resources into the current environment. it -# is assumed that all subdirectories of each directory argument should contain -# a resource. +# loads an entire directory of resources into the current environment. +# it is assumed that all subdirectories of each directory argument +# should contain a resource. # -loadAllResources ( ) { - [ "x$1" = "x" ] && __resource_dirs="$LIBRARY_RESOURCE_DIR" || __resource_dirs="$@" +load ( ) { + if [ $# -gt 0 ] ; then + __resource_dirs="$@" + else + __resource_dirs="$__PATH_TO_LIBRARY" + fi - for __resource_dir_to_load in $__resource_dirs ; do - __resources_to_load="" - for __dir in `ls $__resource_dir_to_load` ; do - __resources_to_load="$__resource_dir_to_load/$__dir $__resources_to_load" - done + for __resource_dir_to_load in $__resource_dirs ; do + __resources_to_load="" + for __dir in `ls $__resource_dir_to_load` ; do + __resources_to_load="$__resource_dir_to_load/$__dir $__resources_to_load" + done -# echo "loading resources $__resources_to_load" - loadResource $__resources_to_load + use $__resources_to_load done - return 0 + return 0 } -# The library may be asked to load in different ways for different needs. +# The library may be utilized in different ways for different needs: # -# "library load" will load all resources available in the default resource -# directory. this is what most programs directly calling the library will -# want to invoke to get all resources loaded. +# "library load" will load all resources available in the default +# resource directory. this is what most programs directly calling +# the library will want to invoke to get all resources loaded. # -# "library source" will output the contents of the default resource -# directory to stdout. this is useful for programs that pass the contents -# of the library on to other scripts. automation test scripts will use this. +# "library source" will output the sources of all resources +# available to stdout. this is useful for programs that pass the +# contents of the library on to other scripts. # # "library" without any arguments will simply ensure that there are -# mechanisms in place for loading resources. this is useful for scripts -# that may only want certain functionality to be loaded. +# mechanisms in place for loading resources. this is useful for +# scripts that may only want certain functionality to be loaded. # __SOURCE_LIBRARY="0" -case "$__DOLLAR_ONE" in - s[oO][uU][rR][cC][eE] | S[oO][uU][rR][cC][eE] | -[sS][oO][uU][rR][cC][eE] | --[sS][oO][uU][rR][cC][eE] ) - __SOURCE_LIBRARY="1" - loadAllResources $LIBRARY_RESOURCE_DIR +case "x$__ARG1" in + x[sS][oO][uU][rR][cC][eE] | x-[sS][oO][uU][rR][cC][eE] | x--[sS][oO][uU][rR][cC][eE] ) + __SOURCE_LIBRARY="1" + load $__PATH_TO_LIBRARY ;; - l[oO][aA][dD] | L[oO][aA][dD] | -[lL][oO][aA][dD] | --[lL][oO][aA][dD] ) - loadAllResources $LIBRARY_RESOURCE_DIR + x[lL][oO][aA][dD] | x-[lL][oO][aA][dD] | x--[lL][oO][aA][dD] ) + load $__PATH_TO_LIBRARY ;; esac -# lock and load.. we are done here. + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Deleted: corredor/trunk/Resources/test.sh =================================================================== --- corredor/trunk/Resources/test.sh 2006-09-22 14:00:10 UTC (rev 10) +++ corredor/trunk/Resources/test.sh 2006-09-23 06:16:38 UTC (rev 11) @@ -1,9 +0,0 @@ -#!/bin/sh - -. ./library - -x=0 -while [ $x -lt 300 ] ; do - isLocalhost asdf.asdfasdf - x=`expr $x + 1` -done Modified: corredor/trunk/automation =================================================================== --- corredor/trunk/automation 2006-09-22 14:00:10 UTC (rev 10) +++ corredor/trunk/automation 2006-09-23 06:16:38 UTC (rev 11) @@ -42,6 +42,8 @@ # easier to set up, maintain, and run scripts, supporting symmetric, # simultaneous, and distributed exectution. # +# Corredor assumes IEEE Std 1003.1-2001 (``POSIX.1'') conformance. +# # Author: # Christopher Sean Morrison # cor...@in... @@ -51,13 +53,18 @@ # echo "use nl for line numbering..." # keep track of how we were invoked in case dollar-zero is reused -ARGUMENTS="$*" +ARGS="$*" ARG0="$0" +ARG1="$1" # force locale setting to C so things like date output as expected # XXX necessary? should be in plugin? (probably) LC_ALL=C +# sometimes necessary setting for non-posix-compliant /bin/sh shells +# (for proper $0 expansion, etc, on SGIs) +_XPG=1 + # commands that are required for basic functionality for __cmd in echo head tail wc basename dirname ; do echo "test" | $__cmd "test" > /dev/null 2>&1 @@ -87,7 +94,7 @@ PATH_TO_CORREDOR="`dirname $ARG0`" NAME_OF_CORREDOR="`basename $ARG0`" -PATH_TO_LIBRARY="${PATH_TO_CORREDOR}/Resources/library" +RESOURCE_LIBRARY="${PATH_TO_CORREDOR}/Resources/library" # sanity check # XXX would be good to delay running dirname/basename until the @@ -95,8 +102,8 @@ CORREDOR="$PATH_TO_CORREDOR/$NAME_OF_CORREDOR" if [ ! -f "$CORREDOR" ] ; then echo "INTERNAL ERROR: $CORREDOR does not exist" - if [ ! "x$0" = "x$CORREDOR" ] ; then - echo "INTERNAL ERROR: dirname/basename inconsistency: $0 != $CORREDOR" + if [ ! "x$ARG0" = "x$CORREDOR" ] ; then + echo "INTERNAL ERROR: dirname/basename inconsistency: $ARG0 != $CORREDOR" fi exit 1 fi @@ -109,14 +116,10 @@ # itself is bypassed. # -if [ "x$1" = "xlibrary" ] ; then - # necessary setting for non-posix-compliant /bin/sh shells - # (for proper $0 expansion, etc, on SGIs) - _XPG=1 - /bin/sh "${PATH_TO_LIBRARY}" $@ - +if [ "x$ARG1" = "xlibrary" ] ; then + . "$RESOURCE_LIBRARY" source exit $? -elif [ "x$1" = "xself-test" ] ; then +elif [ "x$ARG1" = "xself-test" ] ; then echo "self-testing should also short circuit" fi @@ -203,14 +206,14 @@ # need to display help unless that arg looks like a request for the # suite version. -if [ "x$1" = "x" ] ; then +if [ "x$ARG1" = "x" ] ; then # make sure COMMAND was not set externally before assuming help if [ "x$COMMAND" = "x" ] ; then echo "$HELP_STATEMENT" exit 0 fi elif [ "x$2" = "x" ] ; then - case "x$1" in + case "x$ARG1" in # handle version x-[vV]) DISPLAY_VERSION=yes ;; x--[vV]) DISPLAY_VERSION=yes ;; @@ -239,8 +242,8 @@ ### -# INCLUDE THE UTILITY LIBRARY -############################# +# INCLUDE THE RESOURCE LIBRARY +############################## # # the almighty library file. dirname is needed/recommended so that we # will still be able to find the automation directory regardless of @@ -251,8 +254,8 @@ # on-demand. # echo "Please wait ..." 1>&2 -. "${PATH_TO_LIBRARY}" -loadAllResources +. "$RESOURCE_LIBRARY" +load initializeOption VERSION "$CORREDOR_VERSION" "$CORREDOR_VERSION" "Display the version of the automation suite" "v ver vers" hidden-commands @@ -479,7 +482,7 @@ # # iterate over arguments # - for argument in $ARGUMENTS ; do + for argument in $ARGS ; do # add command once set to force checking in proper category handleArgument "$1" "$2" $COMMAND @@ -716,7 +719,7 @@ # (ever) # elif [ "x$COMMAND" = "xLIBRARY" ] ; then - . "${PATH_TO_LIBRARY}" source + . "$RESOURCE_LIBRARY" source exit # @@ -738,7 +741,7 @@ SEC="`echo $TIME | cut -d':' -f3`" PRECOUNT="`expr $SEC + \( $MIN \* 60 \) + \( \( $HOUR \* 24 \) \* 60 \)`" - WC="`sh $PATH_TO_LIBRARY source | wc`" + WC="`sh $RESOURCE_LIBRARY source | wc`" LINE="`echo $WC | awk '{print $1}'`" ... [truncated message content] |
From: <br...@us...> - 2006-09-22 14:00:22
|
Revision: 10 http://svn.sourceforge.net/corredor/?rev=10&view=rev Author: brlcad Date: 2006-09-22 07:00:10 -0700 (Fri, 22 Sep 2006) Log Message: ----------- mostly all under revision control and cleaned up now, tag it as the beginning. corredor's epoch. Added Paths: ----------- corredor/tags/epoch/ corredor/tags/epoch/Documentation/ corredor/tags/epoch/README corredor/tags/epoch/automation Removed Paths: ------------- corredor/tags/epoch/BUGS corredor/tags/epoch/HACKING corredor/tags/epoch/INSTALL corredor/tags/epoch/README corredor/tags/epoch/Resources/NOTES corredor/tags/epoch/TODO corredor/tags/epoch/automation Copied: corredor/tags/epoch (from rev 8, corredor/trunk) Deleted: corredor/tags/epoch/BUGS =================================================================== --- corredor/trunk/BUGS 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/tags/epoch/BUGS 2006-09-22 14:00:10 UTC (rev 10) @@ -1,25 +0,0 @@ -Corredor Bugs -============= - -Bugs should be reported to the bug tracker on the project website at -http://sourceforge.net/tracker/?atid=640802&group_id=102847 - -The bugs and issues listed in here may or may not be the same as or -related to the bugs reported to the bug tracker. In general, users -should not look to this file for information regarding the status of -bugs. Informal bug-related information that is intended for -developers will generally be found here. This may include short term -issues that are in active development as well as long term and -on-going issues. - -Recent Bugs ------------ - -* none known yet, no formal release - - ---- -Bugs should be reported to the bug tracker on the project website at -http://sourceforge.net/tracker/?atid=640802&group_id=102847 - -BUGS should be formatted to column 70 (M-q in emacs), no tabs. Copied: corredor/tags/epoch/Documentation (from rev 9, corredor/trunk/Documentation) Deleted: corredor/tags/epoch/HACKING =================================================================== --- corredor/trunk/HACKING 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/tags/epoch/HACKING 2006-09-22 14:00:10 UTC (rev 10) @@ -1,84 +0,0 @@ -The Hackers Guide to Corredor -============================= - -Please read this document if you are planning on contributing to -Corredor. - -Corredor is a relatively straight-forward project that is easily -extended by the user community. Corredor is comprised of three main -components. There is the primary driver application script -(i.e. "corredor"), a library loader (i.e. Resources/library), and -modules like the test bucket directories and the modular functionality -of Corredor itself (i.e. Resources/Source). Individuals looking to -extend Corredor's functionality will likely be looking at the last of -those three -- modules. - - -TABLE OF CONTENTS ------------------ - Introduction - Table of Contents - Communicating - How to Contribute - Coding Style & Standards - - -COMMUNICATING -------------- - -As there are many ways to get started with Corredor, one of the most -important steps for new contributors to do is get involved in the -discussions and communicate with the Corredor developers. There are -mailing lists, on-line forums, and an IRC channel available for -Corredor development and project communication. All contributors are -encouraged to participate in any of the available communication -channels: - -* Internet Relay Chat - - The primary and generally preferred mechanism for interactive - developer discussions is via Internet Relay Chat (IRC). Several of - the core developers and core contributors of Corredor hang out in - #brlcad on the Freenode network, a channel that is currently shared - with the BRL-CAD project. With most any IRC client, you should be - able to join #brlcad on irc.freenode.net, port 6667. See - http://freenode.net and http://irchelp.org for more information - -* E-mail Mailing Lists - - There are several mailing lists available for interaction, e.g. the - http://sourceforge.net/mail/?group_id=102847 "corredor-devel" mailing - list. More involved contributors may also be interested in joining - the "corredor-commits" and "corredor-tracker" mailing lists. - -* On-line Forums - - Discussion forums are available on the project site at - http://sourceforge.net/forum/?group_id=102847 for both developers - and users. Of particular interest to developers is, of course, the - "Developers" forum where all contributors are incouraged to - participate. - - -HOW TO CONTRIBUTE ------------------ - -Basically, just jump in. The project isn't complicated enough to -warrant any heavy handed procedures. Make a patch and post it -"somewhere" (ideally the sf.net patches tracker) and it will get -reviewed and probably included. If you do make a patch, unified diffs -of modified files and tarballs of new files are preferred. - -If you are really interested in becoming heavily involved in the -project, commit access can be provided. - - -CODING STYLE & STANDARDS ------------------------- - -The ONLY assumption Corredor or any of Corredor's source modules may -make is the availability of a POSIX shell environment. Anything -outside of that must be tested for (e.g. trying to use sendmail) and -remain optional. - ---- Deleted: corredor/tags/epoch/INSTALL =================================================================== --- corredor/trunk/INSTALL 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/tags/epoch/INSTALL 2006-09-22 14:00:10 UTC (rev 10) @@ -1,109 +0,0 @@ -Corredor Installation & Setup Guide -=================================== - -Installation of the Corredor Automation & Testing Suite is a fairly -straightforward process that involves installing the Corredor files -and then defining your run tests. Corredor itself requires no -compilation or preparation other than requiring that you have a POSIX -compliant shell environment. Suitable environments include Mac OS X, -the Cygwin/Mingw compatibility environment for Windows, most of the -various flavors of BSD, most of the various distributions of Linux, -and most UNIX operating systems. - -TABLE OF CONTENTS ------------------ - Introduction - Table of Contents - Quick Installation & Setup - Installation & Setup Details - Reporting Problems - - -QUICK INSTALLATION & SETUP --------------------------- - -Since you are reading this document, it is assumed that you have -obtained the full sources of Corredor and are ready to get started -setting up Corredor to work with your project. For the impatient or -simplistic, the following should get you going fairly quickly with -minimal effort. - -1) Copy the "automation" file and "Resources" directory into your -project sources or into a system directory. Example: - -cp -R automation Resources /path/to/your/project - -2) Create a directory that will contain run tests for your project. -This directory will contain one file or directory per test. Example: - -mkdir /path/to/your/project/Tests - -3) Create a test. This is a simple shell script that minally contains -the commands you want to run. An example of such a script that will -build a traditional GNU Build System project that uses configure: - -cat > /path/to/your/project/Tests/Build <<EOF -#!/bin/sh -if [ ! -f configure ] ; then - if [ -f autogen.sh ] ; then - sh autogen.sh - else - autoreconf -is - fi - if [ ! -f configure ] ; then - bomb "Could not find configure" - fi -fi -./configure -if [ $? != 0 ] ; then - bomb "Configure failed" -fi -make -if [ $? != 0 ] ; then - bomb "Compilation failed" -fi -log "Compilation succeeded" -return 0 - -EOF - -4) Create a ~/.automationrc file with lines describing your project and -where you've put files. Example: - -cat > ~/.automationrc <<EOF -PACKAGE=name_of_your_project -PACKAGE_SRC=/path/to/your/project -TESTS_D=/path/to/your/project/tests -EOF - -5) Run corredor. You should now be able to run the corredor -automation tool and provide the "start" command. It will copy your -sources to a temporary directory (which is configurable) and run the -tests in your test directory. Example: - -/path/to/automation start - -That should do it. If that doesn't work, see the following section on -INSTALLATION & SETUP DETAILS or review the proceeding instructions in -closer detail. If you have read and are still experiencing issues, -please report those problems via the REPORTING PROBLEMS section below. - -INSTALLATION & SETUP DETAILS ----------------------------- - -Not yet written. *ahem* - - -REPORTING PROBLEMS ------------------- - -Please report any bugs encountered to the project bug tracker at -http://sourceforge.net/tracker/?group_id=102847&atid=633006 - -Similarly, please post any request for feature enhancements or support -to http://sourceforge.net/tracker/?group_id=102847&atid=633009 and -http://sourceforge.net/tracker/?group_id=102847&atid=633007 -respectively. - ---- -Cheers! Deleted: corredor/tags/epoch/README =================================================================== --- corredor/trunk/README 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/tags/epoch/README 2006-09-22 14:00:10 UTC (rev 10) @@ -1,174 +0,0 @@ - Corredor - Version 2006.10 - http://corredor.sf.net - -Corredor is a robust and general framework for performing automated -execution of tasks with a particular emphasis on software testing. -With a POSIX-compliant shell, Corredor makes it easier to set up, -maintain, and run scripts, supporting symmetric, simultaneous, and -distributed exectution. - -Corredor was initially created in 2002 with the design purpose of -performing automated and distributed testing of software packages. -Initially designed for testing the extensive BRL-CAD solid modeling -software suite, the framework was expanded and refined towards -providing a general execution framework that lets you run a set of -shell scripts are defined for a given project. - -The framework is written entirely in POSIX Bourne shell and makes no -assumptions about system functionality outside of the POSIX standard. -Any POSIX platform that can run a bourne shell should be able to -utilize Corredor without compilation or modification. The framework -provides a variety of routines that strive to make it as easy as -possible to build and test software packages. You write scripts that -can build and test your software, and then Corredor make it easy to -manage how those scripts are run locally or even distributed. - -As an example, once you describe even just a simple script that builds -a project, you can then tell the framework to automatically distribute -that job to an entire compilation farm of machines. Corredor then -takes care of all the details of packing everything up, getting onto -those machines, peforming the builds, analyzing whether the builds -succeed, cleaning up, and returning results back in some useful form. - -Corredor strives to make it as easy as possible to set up, maintain, -and run black box, white box, regression, unit, and build tests so -that software may be made more robust and reliable. Corredor supports -symmetric, simultaneous, and distributed testing. The system may be -invoked on-demand via automation or run interactively. Success and -failure reporting is given via direct-interactive feedback, file -report logging, and e-mail. - - -TABLE OF CONTENTS ------------------ - Introduction - Table of Contents - Getting Started - Benchmark - File Manifest - References - Contact & Contributions - - -GETTING STARTED ---------------- - -To effectively utilize Corredor as an execution framework, minimal -preparation is required. Namely, you will need to create execution -scripts specific to you particular environment testing needs. See the -INSTALL file for a brief introduction on how to get started with -Corredor. - -Corredor may also be used to benchmark the overall performance of -shell environment. See the BENCHMARK section below for details. - - -BENCHMARK ---------- - -Corredor has a built-in benchmark performance analysis functionality -for testing the run-time performance characteristics of a given -system's shell scripting environment. The benchmark exercises basic -shell functionality including the invocation of shell functions, -setting of environment variables, execution of required system -commands, and more. The benchmark reports the performance results in -terms of the number of shell operations per second. - - -FILE MANIFEST -------------- - README - this initial documentation file - Resources/ - execution framework internal logic and plugins - Resources/library - general purpose shell script library - SystemBucket/ - system directory containing remote host settings - TestBucket/ - directory containing runnable scripts/tests - automation - the Corredor automation and test execution tool - - -REFERENCES ----------- - -Regression testing -URL: http://whatis.techtarget.com/definition/0,,sid9_gci212884,00.html -NOTE: Regression testing is the process of testing changes to computer -programs to make sure that the older programming still works with the -new changes. Regression testing is a normal part of the program -development process and, in larger companies, is done by code testing -specialists. Test department coders develop code test scenarios and -exercises that will test new units of code after they have been -written. These test cases form what becomes the test bucket. Before a -new version of a software product is released, the old test cases are -run against the new version to make sure that all the old capabilities -still work. The reason they might not work is because changing or -adding new code to a program can easily introduce errors into code -that is not intended to be changed. - -Regression testing -URL: http://www.pcwebopaedia.com/TERM/R/regression_testing.html -NOTE: The selective retesting of a software system that has been -modified to ensure that any bugs have been fixed and that no other -previously-working functions have failed as a result of the -reparations and that newly added features have not created problems -with previous versions of the software. Also referred to as -verification testing, regression testing is initiated after a -programmer has attempted to fix a recognized problem or has added -source code to a program that may have inadvertently introduced -errors. It is a quality control measure to ensure that the -newly-modified code still complies with its specified requirements and -that unmodified code has not been affected by the maintenance -activity. - -Test-drive development -URL: http://www.thecoadletter.com/issues/testdriven/coadletter-testdriven-095_why_test.htm -NOTE: Article explains why Test-driven Development (TDD) is generally -a "good thing". - -Mac Startup Items -URL: http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/BootingLogin/The_Boot_Sequence.html -URL: http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/BootingLogin/Customization_Techniques.html -URL: http://developer.apple.com/techpubs/macosx/Darwin/howto/system_starter_howto/system_starter_howto.html - -Tetworks -URL: http://tetworks.opengroup.org/ -URL: http://tetworks.opengroup.org/Products/tet.html -NOTE: The Open Group's test execution product (16K for pro license + -6K/year). It appears to be the most robust and complete testing -framework around. The framework is used to test UNIX/POSIX -compliance, X11 API conformance and a slew of other "large" APIs. - -Gentoo Initscripts -URL: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=5 - -Concurrent Versions System -URL: http://www.cvshome.org - -Red Hat rc.d initscripts -URL: file:///etc/rc.d - - -CONTACT & CONTRIBUTIONS ------------------------ - -Corredor was originally conceived and remains primarily written and -maintained by Christopher Sean Morrison. Feedback and contributions -are always appreciated and welcome, and the project is always open to -having others join in the direct development and improvement of -Corredor. See the HACKING file for details on getting involved. - -Interactive support via IRC is preferred and generally available -during UTC-5 hours on the Freenode network (irc.freenode.net:6667) in -the #brlcad channel. Look for the user 'brlcad'. - -Bug reports, feature requests, and support requests may be made to the -project's Sourceforge site: http://sourceforge.net/projects/corredor - -Mailing lists are similarly available at the Sourceforge project site. - -Feel free to direct any questions or comments relating to Corredor via -e-mail to 'cor...@in...' or to any of the other -contact means described above. - -Cheers! -Sean - Copied: corredor/tags/epoch/README (from rev 9, corredor/trunk/README) =================================================================== --- corredor/tags/epoch/README (rev 0) +++ corredor/tags/epoch/README 2006-09-22 14:00:10 UTC (rev 10) @@ -0,0 +1,175 @@ + Corredor + Version 2006.10 + http://corredor.sf.net + +Corredor is a robust and general framework for performing automated +execution of tasks with a particular emphasis on software testing. +With a POSIX-compliant shell, Corredor makes it easier to set up, +maintain, and run scripts, supporting symmetric, simultaneous, and +distributed exectution. + +Corredor was initially created in 2002 with the design purpose of +performing automated and distributed testing of software packages. +Initially designed for testing the extensive BRL-CAD solid modeling +software suite, the framework was expanded and refined towards +providing a general execution framework that lets you run a set of +shell scripts are defined for a given project. + +The framework is written entirely in POSIX Bourne shell and makes no +assumptions about system functionality outside of the POSIX standard. +Any POSIX platform that can run a bourne shell should be able to +utilize Corredor without compilation or modification. The framework +provides a variety of routines that strive to make it as easy as +possible to build and test software packages. You write scripts that +can build and test your software, and then Corredor make it easy to +manage how those scripts are run locally or even distributed. + +As an example, once you describe even just a simple script that builds +a project, you can then tell the framework to automatically distribute +that job to an entire compilation farm of machines. Corredor then +takes care of all the details of packing everything up, getting onto +those machines, peforming the builds, analyzing whether the builds +succeed, cleaning up, and returning results back in some useful form. + +Corredor strives to make it as easy as possible to set up, maintain, +and run black box, white box, regression, unit, and build tests so +that software may be made more robust and reliable. Corredor supports +symmetric, simultaneous, and distributed testing. The system may be +invoked on-demand via automation or run interactively. Success and +failure reporting is given via direct-interactive feedback, file +report logging, and e-mail. + + +TABLE OF CONTENTS +----------------- + Introduction + Table of Contents + Getting Started + Benchmark + File Manifest + References + Contact & Contributions + + +GETTING STARTED +--------------- + +To effectively utilize Corredor as an execution framework, minimal +preparation is required. Namely, you will need to create execution +scripts specific to you particular environment testing needs. See the +Documentation/INSTALL file for a brief introduction on how to get +started with Corredor. + +Corredor may also be used to benchmark the overall performance of +shell environment. See the BENCHMARK section below for details. + + +BENCHMARK +--------- + +Corredor has a built-in benchmark performance analysis functionality +for testing the run-time performance characteristics of a given +system's shell scripting environment. The benchmark exercises basic +shell functionality including the invocation of shell functions, +setting of environment variables, execution of required system +commands, and more. The benchmark reports the performance results in +terms of the number of shell operations per second. + + +FILE MANIFEST +------------- + Documentation - project documentation and manual pages + README - this initial documentation file + Resources/ - execution framework internal logic and plugins + SystemBucket/ - system directory containing remote host settings + TestBucket/ - directory containing runnable scripts/tests + automation - the Corredor automation and test execution tool + + +REFERENCES +---------- + +Regression testing +URL: http://whatis.techtarget.com/definition/0,,sid9_gci212884,00.html +NOTE: Regression testing is the process of testing changes to computer +programs to make sure that the older programming still works with the +new changes. Regression testing is a normal part of the program +development process and, in larger companies, is done by code testing +specialists. Test department coders develop code test scenarios and +exercises that will test new units of code after they have been +written. These test cases form what becomes the test bucket. Before a +new version of a software product is released, the old test cases are +run against the new version to make sure that all the old capabilities +still work. The reason they might not work is because changing or +adding new code to a program can easily introduce errors into code +that is not intended to be changed. + +Regression testing +URL: http://www.pcwebopaedia.com/TERM/R/regression_testing.html +NOTE: The selective retesting of a software system that has been +modified to ensure that any bugs have been fixed and that no other +previously-working functions have failed as a result of the +reparations and that newly added features have not created problems +with previous versions of the software. Also referred to as +verification testing, regression testing is initiated after a +programmer has attempted to fix a recognized problem or has added +source code to a program that may have inadvertently introduced +errors. It is a quality control measure to ensure that the +newly-modified code still complies with its specified requirements and +that unmodified code has not been affected by the maintenance +activity. + +Test-drive development +URL: http://www.thecoadletter.com/issues/testdriven/coadletter-testdriven-095_why_test.htm +NOTE: Article explains why Test-driven Development (TDD) is generally +a "good thing". + +Mac Startup Items +URL: http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/BootingLogin/The_Boot_Sequence.html +URL: http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/BootingLogin/Customization_Techniques.html +URL: http://developer.apple.com/techpubs/macosx/Darwin/howto/system_starter_howto/system_starter_howto.html + +Tetworks +URL: http://tetworks.opengroup.org/ +URL: http://tetworks.opengroup.org/Products/tet.html +NOTE: The Open Group's test execution product (16K for pro license + +6K/year). It appears to be the most robust and complete testing +framework around. The framework is used to test UNIX/POSIX +compliance, X11 API conformance and a slew of other "large" APIs. + +Gentoo Initscripts +URL: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=5 + +Concurrent Versions System +URL: http://www.cvshome.org + +Red Hat rc.d initscripts +URL: file:///etc/rc.d + + +CONTACT & CONTRIBUTIONS +----------------------- + +Corredor was originally conceived and remains primarily written and +maintained by Christopher Sean Morrison. Feedback and contributions +are always appreciated and welcome, and the project is always open to +having others join in the direct development and improvement of +Corredor. See the Documentation/HACKING file for details on getting +involved. + +Interactive support via IRC is preferred and generally available +during UTC-5 hours on the Freenode network (irc.freenode.net:6667) in +the #brlcad channel. Look for the user 'brlcad'. + +Bug reports, feature requests, and support requests may be made to the +project's Sourceforge site: http://sourceforge.net/projects/corredor + +Mailing lists are similarly available at the Sourceforge project site. + +Feel free to direct any questions or comments relating to Corredor via +e-mail to 'cor...@in...' or to any of the other +contact means described above. + +Cheers! +Sean + Deleted: corredor/tags/epoch/Resources/NOTES =================================================================== --- corredor/trunk/Resources/NOTES 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/tags/epoch/Resources/NOTES 2006-09-22 14:00:10 UTC (rev 10) @@ -1,114 +0,0 @@ -PROBLEM ANALYSIS -================ - -Needs ------ - for source code commits to the main CVS branch compile across multiple architectures - detection of software bugs - verification that expected APIs do not change unexpectedly - - -Problems --------- - compilation is time intensive - manually compiling across multiple architectures is time intensive - verification that source code behaves as expected is time intensive - APIs are sometimes broken or used in unforseen manners - modification to one source module inadvertently induces an error in another source module - - -Potential General Solutions to Problems ---------------------------------------- - ignore the problems and/or deal with the issues as they arise - use a testing framework - design and implement one - buy one - impose policy on commiters - - -Realistic Tool Solution Expectations ------------------------------------- - it is simple to run tests across multiple architectures on demand - adding new tests is not complicated - cross compilation across multiple architectures may be automated - - -Current Manual Testing Costs ----------------------------- - time/cost varies per developer - useability testing is generally minimal (i.e. little time spent testing the software) - compilation testing is generally frequent (i.e. most time spent compiling) - compilation takes between 5 and 120 minutes per architecture (but is invoke-and-forget) - approximately 10 minutes per architecture per build is needed to setup/invoke/analyse build and run benchmarks (minimal functionality test - approximately 6 supported architectures (osx, linux, freebsd, sgi, solaris, aix) (windows?) - approximately 1 hour to build across all platforms and verify builds - 8 active core developers - one cross-compilation build/test by all developers is approximately 8 man hours (1 man day) - one build per week (moderate activity) is about 400 man hours (50 man days) per year (50 weeks) - compilations are less frequent after release (1/week) - compilations are frequent before release (1+/day) - - -Future (Expected) Manual Testing Costs --------------------------------------- - mandatory cross compilations happen nightly and per/commit happen automatically - maintenance of test suite is necessary - - -TOOL DESIGN -=========== - -Initial Automated Testing Costs -------------------------------- - design and implementation of test suite (0 -- done offline) - design and implementation of tests (1 man hour per test) - setup of test suite (8 man hours) - usage learning by all developers (1 man hour per developer) - - -Future Automated Testing Costs ------------------------------- - maintenance of test suite (1 man hour per month) - maintenance of tests (variable -- 1 man hour per year per test) - design and implementation of new tests ( 1 man hour per test) - - -Tool Users ----------- - builder and tester - := those who want to use the suite to verify buildability and/or functionality - test writer - := those who contribute tests to the test suite - suite maintainer - := those who install and/or modify the suite itself, preparing the test framework - software - := cron, web browsers, other tools that may invoke the tool on demand - - -Mandatory Tool Features and Contraints --------------------------------------- - works cross-platform on all supported architectures - must be minimally dependant upon external interfaces and tools - may be run on demand - may be automated - tool should not irreversibly modify user data by default - tool must be understood/learned by all users - requires no time expense when system is static (should not have to "clean up logs", etc) - - -Desireable Tool Features ------------------------- - should provide minimal false negatives (suite failure) - tool should be quick/simple to learn and use - may be run interactively (single stepping at different levels) - should be simple to add new tests - should be robust test framework to support evolving test style/strategy - should provide informative test reports for failure investigation - - -Maintenance of Tool -------------------- - needs to have new tests added as new features/tools are added - must be maintained as supported architectures evolve - must be ported to newly supported architectures - Deleted: corredor/tags/epoch/TODO =================================================================== --- corredor/trunk/TODO 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/tags/epoch/TODO 2006-09-22 14:00:10 UTC (rev 10) @@ -1,51 +0,0 @@ -Corredor To Do List -=================== - -Included below is a list of items that are scheduled or desirable to -have done at some point. Most recently added items are on top, older -topics are on the bottom. This is not an official list, it's more of -a scratch pad to use for tracking development ideas and informal -plans in a lightweight manner. - -THESE SHOULD HAPPEN BEFORE THE FIRST RELEASE --------------------------------------------- - -* basic local operation respecting test dependencies - -* basic documentation on installation and setup - - -THESE SHOULD HAPPEN WITHIN TWO RELEASE ITERATIONS -------------------------------------------------- - -* improved logging framework via log4sh - -* remote operation - - -THESE ARE FOR FUTURE RELEASES ------------------------------ - -* add multiproject single-install support - -* add self-installation support (e.g. sudo ./corredor install) - -* web interface for benchmark results - -* modules for system characteristics (cpu, architecture, OS, versions, - memory, disks, network, etc) - -* modules for various command tools (posix or otherwise) - -* ability to step through scripts one statement at a time for - debugging and testing support - -* shell script compiler written in shell - - ---- -See the project task tracker for more to do items and future planning -efforts. http://sf.net/pm/?group_id=102847 - -TODO items should be formated to column 70 (M-q in emacs), no tabs - Deleted: corredor/tags/epoch/automation =================================================================== --- corredor/trunk/automation 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/tags/epoch/automation 2006-09-22 14:00:10 UTC (rev 10) @@ -1,1235 +0,0 @@ -#!/bin/sh -# C O R R E D O R -# Corredor -# -# Copyright (c) 2003-2006 Christopher Sean Morrison -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# -# 3. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -### -# -# Corredor Automation Test Suite -# -# Corredor is a robust and general framework for performing automated -# execution of tasks with a particular emphasis tasks related to -# software testing. With a POSIX-compliant shell, Corredor makes it -# easier to set up, maintain, and run scripts, supporting symmetric, -# simultaneous, and distributed exectution. -# -# Author: -# Christopher Sean Morrison -# cor...@in... -# -##################################################################### - -# echo "use nl for line numbering..." - -# keep track of how we were invoked in case dollar-zero is reused -ARGUMENTS="$*" -PATH_TO_CORREDOR="`dirname $0`" -NAME_OF_CORREDOR="`basename $0`" -PATH_TO_LIBRARY="${PATH_TO_CORREDOR}/Resources/library" - -# sanity check -# XXX would be good to delay running dirname/basename until the -# library is loaded so that we can test for their existance properly -CORREDOR="$PATH_TO_CORREDOR/$NAME_OF_CORREDOR" -if [ ! -f "$CORREDOR" ] ; then - echo "INTERNAL ERROR: $CORREDOR does not exist" - if [ ! "x$0" = "x$CORREDOR" ] ; then - echo "INTERNAL ERROR: dirname/basename inconsistency: $0 != $CORREDOR" - fi - exit 1 -fi - -# -# this is a time saving hack for when we are running in library mode. -# we bypass option & environment initialization as well as -# command-line parsing since they are not significant to the library -# command. also noteworthy, the actual loading of the library file -# itself is bypassed. -# - -if [ "x$1" = "xlibrary" ] ; then - # necessary setting for non-posix-compliant /bin/sh shells - # (for proper $0 expansion, etc, on SGIs) - _XPG=1 - echo sh "${PATH_TO_LIBRARY}" $@ - - exit $? -elif [ "x$1" = "xself-test" ] ; then - echo "self-testing should also short circuit" -fi - -# force locale setting to C so things like date output as expected -# XXX necessary? should be in plugin? (probably) -LC_ALL=C - -# commands that are required for basic functionality -for __cmd in echo head tail wc basename dirname ; do - echo "test" | $__cmd "test" > /dev/null 2>&1 - if [ $? = 127 ] ; then - echo "INTERNAL ERROR: '${__cmd}' command is required" - exit 2 - fi -done - -# determine the behavior of head -case "x`echo 'head' | head -n 1 2>&1`" in - *xhead*) HEAD_N="n " ;; - *) HEAD_N="" ;; -esac - -# determine the behavior of tail -case "x`echo 'tail' | tail -n 1 2>&1`" in - *xtail*) TAIL_N="n " ;; - *) TAIL_N="" ;; -esac - -### -# CORREDOR IDENTIFICATION -######################### - -CORREDOR_API=0 -CORREDOR_REL=0 -CORREDOR_MON=2006.10 -CORREDOR_VERSION="${CORREDOR_API}.${CORREDOR_REL}.${CORREDOR_MON}" - -CORREDOR_MANTRAS="Smart code just works. -Helping intelligent coders create intelligent code since 2003. -Test early, test often. -Automation, now with more flair. -Test, test, test. And then test some more. -The runner awaits. -El corredor aguarda. -O corredor espera." - -# pick a random mantra from the list -CORREDOR_MANTRA="`echo \"$CORREDOR_MANTRAS\" | head -${HEAD_N}\`expr \\\`echo $RANDOM\\\` % \\\`echo \"$CORREDOR_MANTRAS\" | wc -l\\\` + 1\` | tail -${TAIL_N}1`" - -INFO_STATEMENT="Corredor is a tool for software automation and testing. - For updates, visit http://corredor.sf.net - -$CORREDOR_MANTRA -" # end INFO_STATEMENT - -USAGE_STATEMENT="Usage: $CORREDOR [automation-options] command [command-options] - where automation-options are -w, -s, etc. - (specify --help-options for a list of options) - where command is start, stop, status, etc. - (specify --help-commands for a list of commands) - where command-options is any command specific option - (specify -h [command] for help on a particular command) -" # end USAGE_STATEMENT - -VERSION_STATEMENT="${NAME_OF_CORREDOR} (Corredor Automation Test Suite) ${CORREDOR_VERSION} -Release ${CORREDOR_REL}, Application Programming Interface ${CORREDOR_API} - -Copyright (c) 2003-2006 by Christopher Sean Morrison -BSD style license applies, see --help for more details. - -$INFO_STATEMENT" # end VERSION_STATEMENT - -HELP_STATEMENT="$USAGE_STATEMENT -$INFO_STATEMENT" # end HELP_STATEMENT - -RESOURCE_FILE_HEADER="#!/bin/sh -# -# C O R R E D O R A U T O M A T I O N R E S O U R C E F I L E -###################################################################### -# -# The following are settings to be used in conjunction with the -# Corredor Automation Test Suite. This file may be used as either the -# start for a default automation suite resource file (RESOURCE_FILE) -# or as a template for a system definition file that would go in the -# system bucket directory (SYSTEMS_D). -# -# As few or many of the variables below may be modified to enforce -# default behaviour different from the default settings. See the -# master corredor automation script for more details on the behavior -# and meaning of each variable. -# -###################################################################### -" - - -### -# QUICK ARUGMENT HANDLING -######################### -# -# this is a time saving hack for when there are no or common basic -# arguments given. usually, these are requests for help or the -# version number. -# -# by default, no arguments means no command, which means we need to -# display help. also, if the user gave a general help option with -# nothing else, then we need to display help. if there is only one -# argument (and it is a switch), then we do not have a command and we -# need to display help unless that arg looks like a request for the -# suite version. - -if [ "x$1" = "x" ] ; then - # make sure COMMAND was not set externally - if [ "x$COMMAND" = "x" ] ; then - echo "$HELP_STATEMENT" - exit - fi -elif [ "x$2" = "x" ] ; then - case "x$1" in - # handle version - x-[vV]) DISPLAY_VERSION=yes ;; - x--[vV]) DISPLAY_VERSION=yes ;; - x--[vV][eE][rR][sS][iI][oO][nN]) DISPLAY_VERSION=yes ;; - - # handle help - x-\?) DISPLAY_HELP=yes ;; - x--\?) DISPLAY_HELP=yes ;; - x-[hH]) DISPLAY_HELP=yes ;; - x--[hH]) DISPLAY_HELP=yes ;; - x--[hH][eE][lL][pP]) DISPLAY_HELP=yes ;; - esac -fi - -if [ "x$DISPLAY_HELP" = "xyes" ] ; then - echo "$HELP_STATEMENT" - exit 0 -fi - -if [ "x$DISPLAY_VERSION" = "xyes" ] ; then - echo "$VERSION_STATEMENT" - exit 0 -fi - - -### -# INCLUDE THE UTILITY LIBRARY -############################# -# -# the almighty library file. dirname is needed/recommended so that we -# will still be able to find the automation directory regardless of -# where or how this script was invoked without needing to give a -# full-path. -# -# this will automagically include any resources the library provides -# on-demand. -# -echo "Please wait ..." 1>&2 -. "${PATH_TO_LIBRARY}" -loadAllResources - -initializeOption VERSION "$CORREDOR_VERSION" "$CORREDOR_VERSION" "Display the version of the automation suite" "v ver vers" hidden-commands - -# log loading messages to standard error -initializeVariable LOADING_LOG stderr -initializeVariable LOADING_TICK "log -n \".\" $LOADING_LOG" - -# did not find anything, so start to load the suite vars and options -log -n "Loading Corredor Automation Suite..." $LOADING_LOG - - -### -# DEFAULT PUBLIC VARIABLE INITIALIZATION -######################################## -# -# begin default settings and options. the difference: options may be -# modified via command-line arguments - -# short name of the project being automation tested -initializeVariable PACKAGE corredor -$LOADING_TICK - -# default working directory -initializeOption RUN_DIR "/tmp/`whoami`" "__ANYTHING__" "Working directory, where to perform tests" "d dir directory" -$LOADING_TICK - -# directory or file containing the source package to automation test -initializeOption PACKAGE_SRC "." "__ANYTHING__" "Directory containing files to be tested" "p source source-dir package" "start restart" -$LOADING_TICK - -# name of log file for output -initializeOption RUN_LOG ".${NAME_OF_CORREDOR}-${HOSTNAME}.log" "__ANYTHING__" "Test output log file" "l log logfile" -$LOADING_TICK - -# default system to automation test. "all" is a special keyword to -# automation test all of the systems in SYSTEMS_D. "localhost" is a -# special keyword to automation test the local system. -initializeOption RUN_SYSTEM "localhost" "__ANYTHING__" "System(s) to automation test" "s system systems" -$LOADING_TICK - -# default test(s) to run. "all" is a special keyword to run all tests -# found in TESTS_D. additionally, the tests may manually be run one -# at a time through the shell. -initializeOption RUN_TEST "all" "__ANYTHING__" "Test(s) to run" "t test tests" -$LOADING_TICK - -# fail on warnings (0/false==do not fail, 1/true==fail) -initializeOption WARNINGS "yes" "__BOOLEAN__" "Give warnings or abort fatally" "w warn warnings" -$LOADING_TICK - -# clean out the automation directory before starting -initializeOption CLOBBER "no" "__BOOLEAN__" "Remove automation directory contents before starting" "c rm remove" "start restart" -$LOADING_TICK - -# give a warning before clobbering -initializeOption CONFIRM_CLOBBER yes "__BOOLEAN__" "Confirm before removing automation directory contents" "cc confirm " "start restart" -$LOADING_TICK - -# number of minutes to wait on the automation lock. set to less than -# or equal to zero to not wait for lock if it is not acquired. -initializeOption WAIT_FOR_LOCK_TIMEOUT 3 "__NUMBER__" "Minutes to wait for cooperative directory locks" "m minutes timeout lock-timeout wait-timeout" -$LOADING_TICK - -# transport is the mechanism that gets a file from the localhost to -# remote machines; available options are ttcp, scp, rcp -initializeVariable TRANSPORT "scp" -$LOADING_TICK - -### -# SYSTEM VARIABLE INITIALIZATIONS -################################# -# -# these variables are the same as those above except that the user -# should never really have to worry about their setting or have to -# change the default values except to modify the suite to run with -# other packages. - -# name of systems directory (full path) -initializeVariable SYSTEMS_D "${PSD}/SystemBucket" omit -$LOADING_TICK - -# name of tests directory (full path) -initializeVariable TESTS_D "${PSD}/TestBucket" omit -$LOADING_TICK - -# name of the self-test test directory -initializeVariable SELF_TESTS_D "${PSD}/Resources/SelfTestBucket" omit -$LOADING_TICK - -# resource file will override any default public or system settings -initializeVariable RESOURCE_FILE "${HOME}/.${NAME_OF_CORREDOR}rc" omit -$LOADING_TICK - -# -# the commands option group holds a list of valid automation -# commands. the HELP_${command} variable holds a descriptive help -# message pertinent to that command. options for any particular -# command are designated in option initializations below using a group -# name that is the same as the command name (e.g. -C clobber option is -# in "start" option group) -# -initializeOption START "" "__BOOLEAN__" "Start the automation testing" "" commands -$LOADING_TICK - -initializeVariable START_HELP "The start command is what will invoke the automation suite testing. After validating any automation and command options, the existance of the source archive is ensured on each of the systems being used. Then each of the systems will commence testing the source by running the requested automation scripts from the test directory on each host." help -$LOADING_TICK - -initializeOption STOP "" "__BOOLEAN__" "Stop the automation testing" "" commands -$LOADING_TICK - -initializeVariable STOP_HELP "This command will halt any specified systems that are presently in the process of running the automation suite. Depending on the nature of what the running machine is doing at the time and whether the machine is remote, or not, all test processes will be halted as soon as possible." help -$LOADING_TICK - -initializeOption RESTART "" "__BOOLEAN__" "Restart (stop/start) the automation testing" "" commands -$LOADING_TICK - -initializeVariable RESTART_HELP "This command will restart automation suite testing for any systems specified. Restarting the suite consists of stopping any hosts that are presently running any tests, and then commencing the automation suite testing for each host regardless of whether they were running prior to the stop or not." help -$LOADING_TICK - -initializeOption STATUS "" "__BOOLEAN__" "Get status of the automation testing" "" commands -$LOADING_TICK - -initializeVariable STATUS_HELP "This command will return a automation suite status as to whether a certain host has not run the test, is presently running the test, has completed the test and failed, or has completed the test and passed. Optionally, the results from the test may be displayed using terminal \"colorized\" ansi output, text output, and/or results may be sent out via e-mail." help -$LOADING_TICK - -initializeOption SETTINGS "" "__BOOLEAN__" "Display current project settings" "" commands -$LOADING_TICK - -initializeVariable SETTINGS_HELP "This command is useful in generating a default resource file (i.e. a default $RESOURCE_FILE file) that may be used for future automation test runs or for debugging. Corredor will output a settings file to standard output, which may be saved to a file: ${CORREDOR} > ~/.${NAME_OF_CORREDOR}rc" help -$LOADING_TICK - -initializeOption LIBRARY "" "__BOOLEAN__" "Output available function and variable definitions" "" commands -$LOADING_TICK - -initializeVariable LIBRARY_HELP "This command may be used by POSIX shell script-based test scripts to get library functions and variable declarations of general utility. Read the $NAME_OF_CORREDOR source code for more details and information on creating new tests as well as details on utilizing the resource library." help -$LOADING_TICK - -initializeOption BENCHMARK "" "__BOOLEAN__" "Compute statisitical benchmark analysis of shell performance" "" commands -$LOADING_TICK - -initializeVariable BENCHMARK_HELP "This command may be used to compute a performance metric for a given system. The benchmark analysis will compute several iterations of intensive environment testing that will in turn provide informative metrics of how quickly a system is presently able to perform." help -$LOADING_TICK - -initializeOption SELF_TEST "" "__BOOLEAN__" "Run the automation suite self-validation tests" "selftest" commands -$LOADING_TICK - -initializeVariable SELF_TEST_HELP "This command may be used to perform a self-test validation of the automation suite operability." help -$LOADING_TICK - -initializeOption HELP_OPTIONS "" "__BOOLEAN__" "Help with options" "help-option" hidden-commands -$LOADING_TICK - -initializeOption HELP_COMMANDS "" "__BOOLEAN__" "Help with commands" "help-command" hidden-commands -$LOADING_TICK - -initializeOption HELP "" "HELP `getInitializedVariables commands` __BOOLEAN__" "General help and help for a particular command" "h" commands -$LOADING_TICK - -initializeVariable HELP_HELP "Help on help -- XXX not yet implemented" help -$LOADING_TICK - -# a list of all of the commands given above (in category "commands") -initializeVariable COMMANDS "`getInitializedVariables commands`" omit -$LOADING_TICK - -initializeVariable ALL_CMDS "`getInitializedVariables \"hidden-commands commands\"`" omit -$LOADING_TICK - -initializeOption COMMAND "" "$ALL_CMDS" "What command to run" "run cmd command commands" omit -$LOADING_TICK - - -### -# LOAD RESOURCE FILE -#################### -# -# a resource file will override any of the above settings, as it will -# contain the last settings prior to execution or processing of -# options. hence, the priority of variable settings is 4th) intrinsic -# default values, 3rd) environment variables, 2nd) resource file -# values, 1st) command-line arguments (1 is highest precedence, 4 is -# lowest). -# -# the command-line arguments and, potentially, the resource file -# settings may be bypassed by setting the environment variable -# BYPASS_SETTINGS to non-null. -# -# the only "almost a caveat" clause to the ordering is that you cannot -# use BYPASS_SETTINGS to bypass the resource file using a command-line -# switch (hence there is no such --bypass-settings option). -# -# delay reporting a "bypassed" message until done with initialization -# -# XXX possible feature could be to allow a resource file in the -# current directory as well as searching for one in $HOME -# -[ "x$BYPASS_SETTINGS" = "x" ] && [ -r "$RESOURCE_FILE" ] && loadResourceFile "$RESOURCE_FILE" -$LOADING_TICK - -### -# HANDLE COMMAND-LINE ARGUMENTS -############################### -# -# handle command-line arguments that were given to set automation -# options. there is a little default processing that occurs up above -# to handle some special cases such as simple help and version. the -# rest of the processing occurs here for any initialized options -# available. - -# -# save current command values to recognize changed values during -# argument handling -# -initializeVariable PRE_CMDS "" omit -$LOADING_TICK -for cmd in $ALL_CMDS ; do - cmdvalue="echo \$$cmd" - PRE_CMDS="$PRE_CMDS `eval $cmdvalue`" -done - -log "...Done\n" $LOADING_LOG - -if [ "x$BYPASS_SETTINGS" = "x" ] ; then - # - # iterate over arguments - # - for argument in $ARGUMENTS ; do - - # add command once set to force checking in proper category - handleArgument "$1" "$2" $COMMAND - handled="$?" - - if [ $handled -eq 0 ] ; then - log "Invalid option: $1" - log "$HELP_STATEMENT" - exit - elif [ $handled -gt 2 ] ; then - log "Invalid option value: $1 $2" - log "$HELP_STATEMENT" - exit - fi - - # if command is set, we want to check if the value has changed - # from the original value. if it has *changed*, we have an - # active command. - if [ "x$COMMAND" = "x" ] ; then - - # regenerate the command value list - postcmds="" - for cmd in $ALL_CMDS ; do - cmdvalue="echo \$$cmd" - postcmds="$postcmds `eval $cmdvalue`" - done - - # if one of the commands changed, it should be the - # variable for the current switch - if [ ! "x$postcmds" = "x$PRE_CMDS" ] ; then - handleArgument COMMAND "`getOptionVariable $1`" omit - [ $? -ne 2 ] && log "COULD NOT SET COMMAND" - fi - fi - - shift $handled - - # stop the insessint looping if we finished handling args - [ "x$1" = "x" ] && break; - done -else - # report if we bypassed a resource or command-line args - if [ -r "$RESOURCE_FILE" ] ; then - if [ "x$*" = "x" ] ; then - log "Resource file bypassed (BYPASS_SETTINGS=$BYPASS_SETTINGS)" - else - log "Resource file and command-line settings bypassed (BYPASS_SETTINGS=$BYPASS_SETTINGS)" - fi - elif [ ! "x$*" = "x" ] ; then - log "Command-line settings bypassed (BYPASS_SETTINGS=$BYPASS_SETTINGS)" - fi -fi - -# -# immediately validate that we ended up with a proper command name -# -if [ "x$COMMAND" = "x" ] ; then - log "A valid command name was NOT given" - log "$HELP_STATEMENT" - exit -fi -# make sure command's case is consistent -COMMAND="`echo $COMMAND | tr [:lower:]- [:upper:]_`" -LC_COMMAND="`echo $COMMAND | tr [:upper:]_ [:lower:]-`" -VALID_CMD="no" -for cmd in $ALL_CMDS ; do - if [ "x$cmd" = "x$COMMAND" ] || [ "x`echo $cmd | tr [:lower:]- [:upper:]_`" ] ; then - VALID_CMD="yes" - break - fi -done -if [ "x$VALID_CMD" = "xno" ] ; then - log "Invalid command: $COMMAND" - log "$HELP_STATEMENT" - exit -fi - -### -# HANDLE SIMPLE COMMANDS -######################## -# -# process commands that do not require any settings to be validated, -# are guaranteed to not be remote, and do not require any resources or -# functions defined outside of the core library (like the -# testing-specific calls). for any other command, we need to load -# libraries and validate settings. - -# -# "help" command -# -if [ "x$COMMAND" = "xHELP" ] ; then - - if [ "x$HELP" = "x1" ] ; then - log "$USAGE_STATEMENT" - else - helped="no" - uchelpvalue="`echo $HELP | tr [:lower:]- [:upper:]_`" - lchelpvalue="`echo $HELP | tr [:upper:]_ [:lower:]-`" - - [ ! "x$DEBUG" = "x" ] && log "Looking up help for [$uchelpvalue / $lchelpvalue] command" stderr - if [ ! "x${uchelpvalue}_HELP" = "x" ] ; then - log "Help for the \"$HELP\" command" - log "=========================================\n" - log "Summary:\n" - hlp_msg="echo \"\$${uchelpvalue}_HELP\"" - plog "`eval $hlp_msg`" "$LOG" 80 " " - log "" - - options="`getInitializedVariables $lchelpvalue`" - if [ ! "x$options" = "x" ] ; then - dispOptHead=no - for option in $options ; do - - switches="`getOptionSwitches $option`" - values="`getOptionValues $option`" - - if [ ! "x$switches" = "x" ] ; then - optval="echo \$$option" - optval="`eval $optval`" - - if [ "x$dispOptHead" = "xno" ] ; then - log "Options:\n" - firstSwitch="`echo $switches | awk '{print $1}'`" - plog "Options may be specified 1) via an environment variable, 2) through a .${NAME_OF_CORREDOR}rc file in user's home directory (see settings command), or 3) as a command-line argument to the automation suite using a valid switch (e.g. $CORREDOR $lchelpvalue --${firstSwitch}=\"$optval\" sets $option to \"$optval\")." "$LOG" 80 " " - log "" - dispOptHead=yes - fi - - log " $option=\"$optval\"" - log " `getOptionDescription $option`" - log " Switches: $switches" - log " Valid Values: $values\n" - fi - done - fi - helped="yes" - break - fi - [ "x$helped" = "xno" ] && log "$USAGE_STATEMENT" - fi - log "$INFO_STATEMENT" - exit - - -# -# "help-options" command -# -elif [ "x$COMMAND" = "xHELP_OPTIONS" ] ; then - - log "Automation options help" - - # iterate over main options - for i in `getInitializedVariables` ; do - option="`getOptionSwitches $i`" - if [ ! "x$option" = "x" ] ; then - default="echo \$$i" - varval="${i}=\"`eval $default`\"" - log " -`echo ${option} | awk '{print $1}'` `getOptionDescription $i` (${varval})" - fi - done - log " -v `getOptionDescription VERSION`" - log " -h `getOptionDescription HELP`" - log "" - - # iterate over command-specific options - LC_COMMANDS="`echo $COMMANDS | tr [:upper:]_ [:lower:]-`" - for i in $LC_COMMANDS ; do - options="`getInitializedVariables $i`" - if [ ! "x$options" = "x" ] ; then - displayedHeader="no" - for j in $options ; do - switches="`getOptionSwitches $j`" - if [ ! "x$switches" = "x" ] ; then - if [ "x$displayedHeader" = "xno" ] ; then - log "Options for the '${i}' command" - displayedHeader="yes" - fi - default="echo \$$j" - varval="${j}=\"`eval $default`\"" - log " -`echo ${switches} | awk '{print $1}'` `getOptionDescription $j` ($varval)" - fi - done - log "" - fi - done - log "$INFO_STATEMENT" - exit - -# -# "help-commands" command -# -elif [ "x$COMMAND" = "xHELP_COMMANDS" ] ; then - - LC_COMMANDS="`echo $COMMANDS | tr [:upper:]_ [:lower:]-`" - - log "Valid Automation Commands" - for i in $LC_COMMANDS ; do - log " $i \t`getOptionDescription $i`" - done - log "\nSpecify -h [command] for more detailed help on a particular command\n (e.g. $CORREDOR -h start)\n" - log "$INFO_STATEMENT" - exit - -# -# "settings" command -# -elif [ "x$COMMAND" = "xSETTINGS" ] ; then - - RC_VARS="`getInitializedVariables`" - [ "x$RC_VARS" = "x" ] && bomb "automation settings: no initialized variables set??" - - logfile=stdout - - # output header - log "$RESOURCE_FILE_HEADER" $logfile - - # output body - for __RV in $RC_VARS ; do - log "" $logfile - __RPVAR="echo \$$__RV" - log "${__RV}=\"`eval $__RPVAR`\"" $logfile - done - - # output footer - log "" $logfile - log "###" $logfile - - exit - -# -# "library" command -- we should only arrive at this point if other -# command line arguments were given. you cannot do anything but -# output source since the library command SHOULD HAVE NO OPTIONS -# (ever) -# -elif [ "x$COMMAND" = "xLIBRARY" ] ; then - . "${PATH_TO_LIBRARY}" source - exit - -# -# Corredor shell benchmark analysis -# -elif [ "x$COMMAND" = "xBENCHMARK" ] ; then - TIMEFRAME=60 - - log "C O R R E D O R B E N C H M A R K" - log "===================================" - - # capture how long it takes to source the library -- we want at - # least three times that for a time frame (this is needed for slow - # machines that require more than the default timeframe to simply - # load one!) - TIME="`date | awk '{print $4}'`" - HOUR="`echo $TIME | cut -d':' -f1`" - MIN="`echo $TIME | cut -d':' -f2`" - SEC="`echo $TIME | cut -d':' -f3`" - PRECOUNT="`expr $SEC + \( $MIN \* 60 \) + \( \( $HOUR \* 24 \) \* 60 \)`" - - WC="`sh $PATH_TO_LIBRARY source | wc`" - LINE="`echo $WC | awk '{print $1}'`" - WORD="`echo $WC | awk '{print $2}'`" - CHAR="`echo $WC | awk '{print $3}'`" - - # XXX need to wrap the timing functions into the library - TIME="`date | awk '{print $4}'`" - HOUR="`echo $TIME | cut -d':' -f1`" - MIN="`echo $TIME | cut -d':' -f2`" - SEC="`echo $TIME | cut -d':' -f3`" - COUNT="`expr $SEC + \( $MIN \* 60 \) + \( \( $HOUR \* 24 \) \* 60 \)`" - - SOURCE_TIME="`expr $COUNT - $PRECOUNT`" - log "Takes about $SOURCE_TIME seconds to load the library" - SOURCE_TIME="`expr $SOURCE_TIME \* 3`" - - [ $SOURCE_TIME -gt $TIMEFRAME ] && TIMEFRAME="$SOURCE_TIME" - log "Timeframe is $TIMEFRAME" - - ENDCOUNT="`expr $COUNT + $TIMEFRAME`" - - METRIC=0 - log "Benchmark analysis will run for approximately $TIMEFRAME seconds.\n" - log -n "Benchmark now in progress..." - while [ $COUNT -lt $ENDCOUNT ] ; do - log -n "." - - sh "$PATH_TO_LIBRARY" load > /dev/null 2>&1 - - TIME="`date | awk '{print $4}'`" - HOUR="`echo $TIME | cut -d':' -f1`" - MIN="`echo $TIME | cut -d':' -f2`" - SEC="`echo $TIME | cut -d':' -f3`" - COUNT="`expr $SEC + \( $MIN \* 60 \) + \( \( $HOUR \* 24 \) \* 60 \)`" - METRIC="`expr $METRIC + 1`" - done - # account for potential over-slippage for really slow machines or short - # time frames. - TIMEFRAME="`expr $TIMEFRAME + \( $COUNT - $ENDCOUNT \)`" - - log "Done." - log "\nResulting metrics:" - log "\t$TIMEFRAME\tseconds" - log "\t$METRIC\titerations" -METRICRATE=`dc <<EOF -2 k $METRIC $TIMEFRAME / p -EOF -` - log "\t$METRICRATE\titerations/sec" - log " " - log "\t$LINE\tlines/iteration" - log "\t$WORD\twords/iteration" - log "\t$CHAR\tcharacters/iteration" - log " " -LINERATE=`dc <<EOF -1 k $LINE $METRIC * $TIMEFRAME / p -EOF -` -log "\t$LINERATE\tlines/sec" -WORDRATE=`dc <<EOF -1 k $WORD $METRIC * $TIMEFRAME / p -EOF -` -log "\t$WORDRATE\twords/sec" -CHARRATE=`dc <<EOF -1 k $CHAR $METRIC * $TIMEFRAME / p -EOF -` -log "\t$CHARRATE\tchars/sec" - - exit -# -# "self-test" run -- only run the self-test tests. this effectively -#... [truncated message content] |
From: <br...@us...> - 2006-09-22 13:47:31
|
Revision: 9 http://svn.sourceforge.net/corredor/?rev=9&view=rev Author: brlcad Date: 2006-09-22 06:47:04 -0700 (Fri, 22 Sep 2006) Log Message: ----------- reorganize and add a Documentation directory, moving all of the pertinent docs there with the exception of the README file. add stubbed files for the manual pages, and initial notes on posix compliance. Modified Paths: -------------- corredor/trunk/README corredor/trunk/automation Added Paths: ----------- corredor/trunk/Documentation/ corredor/trunk/Documentation/BUGS corredor/trunk/Documentation/HACKING corredor/trunk/Documentation/INSTALL corredor/trunk/Documentation/TODO corredor/trunk/Documentation/automation.1 corredor/trunk/Documentation/corredor.1 corredor/trunk/Documentation/posix_notes.txt corredor/trunk/Documentation/testing_notes.txt Removed Paths: ------------- corredor/trunk/BUGS corredor/trunk/HACKING corredor/trunk/INSTALL corredor/trunk/Resources/NOTES corredor/trunk/TODO Deleted: corredor/trunk/BUGS =================================================================== --- corredor/trunk/BUGS 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/trunk/BUGS 2006-09-22 13:47:04 UTC (rev 9) @@ -1,25 +0,0 @@ -Corredor Bugs -============= - -Bugs should be reported to the bug tracker on the project website at -http://sourceforge.net/tracker/?atid=640802&group_id=102847 - -The bugs and issues listed in here may or may not be the same as or -related to the bugs reported to the bug tracker. In general, users -should not look to this file for information regarding the status of -bugs. Informal bug-related information that is intended for -developers will generally be found here. This may include short term -issues that are in active development as well as long term and -on-going issues. - -Recent Bugs ------------ - -* none known yet, no formal release - - ---- -Bugs should be reported to the bug tracker on the project website at -http://sourceforge.net/tracker/?atid=640802&group_id=102847 - -BUGS should be formatted to column 70 (M-q in emacs), no tabs. Copied: corredor/trunk/Documentation/BUGS (from rev 8, corredor/trunk/BUGS) =================================================================== --- corredor/trunk/Documentation/BUGS (rev 0) +++ corredor/trunk/Documentation/BUGS 2006-09-22 13:47:04 UTC (rev 9) @@ -0,0 +1,25 @@ +Corredor Bugs +============= + +Bugs should be reported to the bug tracker on the project website at +http://sourceforge.net/tracker/?atid=640802&group_id=102847 + +The bugs and issues listed in here may or may not be the same as or +related to the bugs reported to the bug tracker. In general, users +should not look to this file for information regarding the status of +bugs. Informal bug-related information that is intended for +developers will generally be found here. This may include short term +issues that are in active development as well as long term and +on-going issues. + +Recent Bugs +----------- + +* none known yet, no formal release + + +--- +Bugs should be reported to the bug tracker on the project website at +http://sourceforge.net/tracker/?atid=640802&group_id=102847 + +BUGS should be formatted to column 70 (M-q in emacs), no tabs. Copied: corredor/trunk/Documentation/HACKING (from rev 8, corredor/trunk/HACKING) =================================================================== --- corredor/trunk/Documentation/HACKING (rev 0) +++ corredor/trunk/Documentation/HACKING 2006-09-22 13:47:04 UTC (rev 9) @@ -0,0 +1,84 @@ +The Hackers Guide to Corredor +============================= + +Please read this document if you are planning on contributing to +Corredor. + +Corredor is a relatively straight-forward project that is easily +extended by the user community. Corredor is comprised of three main +components. There is the primary driver application script +(i.e. "corredor"), a library loader (i.e. Resources/library), and +modules like the test bucket directories and the modular functionality +of Corredor itself (i.e. Resources/Source). Individuals looking to +extend Corredor's functionality will likely be looking at the last of +those three -- modules. + + +TABLE OF CONTENTS +----------------- + Introduction + Table of Contents + Communicating + How to Contribute + Coding Style & Standards + + +COMMUNICATING +------------- + +As there are many ways to get started with Corredor, one of the most +important steps for new contributors to do is get involved in the +discussions and communicate with the Corredor developers. There are +mailing lists, on-line forums, and an IRC channel available for +Corredor development and project communication. All contributors are +encouraged to participate in any of the available communication +channels: + +* Internet Relay Chat + + The primary and generally preferred mechanism for interactive + developer discussions is via Internet Relay Chat (IRC). Several of + the core developers and core contributors of Corredor hang out in + #brlcad on the Freenode network, a channel that is currently shared + with the BRL-CAD project. With most any IRC client, you should be + able to join #brlcad on irc.freenode.net, port 6667. See + http://freenode.net and http://irchelp.org for more information + +* E-mail Mailing Lists + + There are several mailing lists available for interaction, e.g. the + http://sourceforge.net/mail/?group_id=102847 "corredor-devel" mailing + list. More involved contributors may also be interested in joining + the "corredor-commits" and "corredor-tracker" mailing lists. + +* On-line Forums + + Discussion forums are available on the project site at + http://sourceforge.net/forum/?group_id=102847 for both developers + and users. Of particular interest to developers is, of course, the + "Developers" forum where all contributors are incouraged to + participate. + + +HOW TO CONTRIBUTE +----------------- + +Basically, just jump in. The project isn't complicated enough to +warrant any heavy handed procedures. Make a patch and post it +"somewhere" (ideally the sf.net patches tracker) and it will get +reviewed and probably included. If you do make a patch, unified diffs +of modified files and tarballs of new files are preferred. + +If you are really interested in becoming heavily involved in the +project, commit access can be provided. + + +CODING STYLE & STANDARDS +------------------------ + +The ONLY assumption Corredor or any of Corredor's source modules may +make is the availability of a POSIX shell environment. Anything +outside of that must be tested for (e.g. trying to use sendmail) and +remain optional. + +--- Copied: corredor/trunk/Documentation/INSTALL (from rev 8, corredor/trunk/INSTALL) =================================================================== --- corredor/trunk/Documentation/INSTALL (rev 0) +++ corredor/trunk/Documentation/INSTALL 2006-09-22 13:47:04 UTC (rev 9) @@ -0,0 +1,109 @@ +Corredor Installation & Setup Guide +=================================== + +Installation of the Corredor Automation & Testing Suite is a fairly +straightforward process that involves installing the Corredor files +and then defining your run tests. Corredor itself requires no +compilation or preparation other than requiring that you have a POSIX +compliant shell environment. Suitable environments include Mac OS X, +the Cygwin/Mingw compatibility environment for Windows, most of the +various flavors of BSD, most of the various distributions of Linux, +and most UNIX operating systems. + +TABLE OF CONTENTS +----------------- + Introduction + Table of Contents + Quick Installation & Setup + Installation & Setup Details + Reporting Problems + + +QUICK INSTALLATION & SETUP +-------------------------- + +Since you are reading this document, it is assumed that you have +obtained the full sources of Corredor and are ready to get started +setting up Corredor to work with your project. For the impatient or +simplistic, the following should get you going fairly quickly with +minimal effort. + +1) Copy the "automation" file and "Resources" directory into your +project sources or into a system directory. Example: + +cp -R automation Resources /path/to/your/project + +2) Create a directory that will contain run tests for your project. +This directory will contain one file or directory per test. Example: + +mkdir /path/to/your/project/Tests + +3) Create a test. This is a simple shell script that minally contains +the commands you want to run. An example of such a script that will +build a traditional GNU Build System project that uses configure: + +cat > /path/to/your/project/Tests/Build <<EOF +#!/bin/sh +if [ ! -f configure ] ; then + if [ -f autogen.sh ] ; then + sh autogen.sh + else + autoreconf -is + fi + if [ ! -f configure ] ; then + bomb "Could not find configure" + fi +fi +./configure +if [ $? != 0 ] ; then + bomb "Configure failed" +fi +make +if [ $? != 0 ] ; then + bomb "Compilation failed" +fi +log "Compilation succeeded" +return 0 + +EOF + +4) Create a ~/.automationrc file with lines describing your project and +where you've put files. Example: + +cat > ~/.automationrc <<EOF +PACKAGE=name_of_your_project +PACKAGE_SRC=/path/to/your/project +TESTS_D=/path/to/your/project/tests +EOF + +5) Run corredor. You should now be able to run the corredor +automation tool and provide the "start" command. It will copy your +sources to a temporary directory (which is configurable) and run the +tests in your test directory. Example: + +/path/to/automation start + +That should do it. If that doesn't work, see the following section on +INSTALLATION & SETUP DETAILS or review the proceeding instructions in +closer detail. If you have read and are still experiencing issues, +please report those problems via the REPORTING PROBLEMS section below. + +INSTALLATION & SETUP DETAILS +---------------------------- + +Not yet written. *ahem* + + +REPORTING PROBLEMS +------------------ + +Please report any bugs encountered to the project bug tracker at +http://sourceforge.net/tracker/?group_id=102847&atid=633006 + +Similarly, please post any request for feature enhancements or support +to http://sourceforge.net/tracker/?group_id=102847&atid=633009 and +http://sourceforge.net/tracker/?group_id=102847&atid=633007 +respectively. + +--- +Cheers! Copied: corredor/trunk/Documentation/TODO (from rev 8, corredor/trunk/TODO) =================================================================== --- corredor/trunk/Documentation/TODO (rev 0) +++ corredor/trunk/Documentation/TODO 2006-09-22 13:47:04 UTC (rev 9) @@ -0,0 +1,51 @@ +Corredor To Do List +=================== + +Included below is a list of items that are scheduled or desirable to +have done at some point. Most recently added items are on top, older +topics are on the bottom. This is not an official list, it's more of +a scratch pad to use for tracking development ideas and informal +plans in a lightweight manner. + +THESE SHOULD HAPPEN BEFORE THE FIRST RELEASE +-------------------------------------------- + +* basic local operation respecting test dependencies + +* basic documentation on installation and setup + + +THESE SHOULD HAPPEN WITHIN TWO RELEASE ITERATIONS +------------------------------------------------- + +* improved logging framework via log4sh + +* remote operation + + +THESE ARE FOR FUTURE RELEASES +----------------------------- + +* add multiproject single-install support + +* add self-installation support (e.g. sudo ./corredor install) + +* web interface for benchmark results + +* modules for system characteristics (cpu, architecture, OS, versions, + memory, disks, network, etc) + +* modules for various command tools (posix or otherwise) + +* ability to step through scripts one statement at a time for + debugging and testing support + +* shell script compiler written in shell + + +--- +See the project task tracker for more to do items and future planning +efforts. http://sf.net/pm/?group_id=102847 + +TODO items should be formated to column 70 (M-q in emacs), no tabs + Added: corredor/trunk/Documentation/automation.1 =================================================================== Property changes on: corredor/trunk/Documentation/automation.1 ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/Documentation/corredor.1 =================================================================== Property changes on: corredor/trunk/Documentation/corredor.1 ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/Documentation/posix_notes.txt =================================================================== --- corredor/trunk/Documentation/posix_notes.txt (rev 0) +++ corredor/trunk/Documentation/posix_notes.txt 2006-09-22 13:47:04 UTC (rev 9) @@ -0,0 +1,199 @@ +http://www.opengroup.org/onlinepubs/009695399/utilities/ + +COMMANDS +======== +admin +alias +ar +asa +at +awk +basename +batch +bc +bg +break +c99 +cal +cat +cd +cflow +chgrp +chmod +chown +cksum +cmp +colon +comm +command +compress +continue +cp +crontab +csplit +ctags +cut +cxref +date +dd +delta +df +diff +dirname +dot +du +echo +ed +env +eval +ex +exec +exit +expand +export +expr +false +fc +fg +file +find +fold +fort77 +fuser +gencat +get +getconf +getopts +grep +hash +head +iconv +id +ipcrm +ipcs +jobs +join +kill +lex +link +ln +locale +localedef +logger +logname +lp +ls +m4 +mailx +make +man +mesg +mkdir +mkfifo +more +mv +newgrp +nice +nl +nm +nohup +od +paste +patch +pathchk +pax +pr +printf +prs +ps +pwd +qalter +qdel +qhold +qmove +qmsg +qrerun +qrls +qselect +qsig +qstat +qsub +read +readonly +renice +return +rm +rmdel +rmdir +sact +sccs +sed +set +sh +shift +sleep +sort +split +strings +strip +stty +tabs +tail +talk +tee +test +time +times +touch +tput +tr +trap +true +tsort +tty +type +ulimit +umask +unalias +uname +uncompress +unexpand +unget +uniq +unlink +unset +uucp +uudecode +uuencode +uustat +uux +val +vi +wait +wc +what +who +write +xargs +yacc +zcat + +ENVIRONMENT VARIABLES +===================== +ENV +HOME +IFS +LANG +LC_ALL +LC_COLLAGE +LC_CTYPE +LC_MESSAGES +LINENO +NLSPATH +PAGER +PATH +PPID +PS1 +PS2 +PS4 +PWD Property changes on: corredor/trunk/Documentation/posix_notes.txt ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Copied: corredor/trunk/Documentation/testing_notes.txt (from rev 8, corredor/trunk/Resources/NOTES) =================================================================== --- corredor/trunk/Documentation/testing_notes.txt (rev 0) +++ corredor/trunk/Documentation/testing_notes.txt 2006-09-22 13:47:04 UTC (rev 9) @@ -0,0 +1,114 @@ +PROBLEM ANALYSIS +================ + +Needs +----- + for source code commits to the main CVS branch compile across multiple architectures + detection of software bugs + verification that expected APIs do not change unexpectedly + + +Problems +-------- + compilation is time intensive + manually compiling across multiple architectures is time intensive + verification that source code behaves as expected is time intensive + APIs are sometimes broken or used in unforseen manners + modification to one source module inadvertently induces an error in another source module + + +Potential General Solutions to Problems +--------------------------------------- + ignore the problems and/or deal with the issues as they arise + use a testing framework + design and implement one + buy one + impose policy on commiters + + +Realistic Tool Solution Expectations +------------------------------------ + it is simple to run tests across multiple architectures on demand + adding new tests is not complicated + cross compilation across multiple architectures may be automated + + +Current Manual Testing Costs +---------------------------- + time/cost varies per developer + useability testing is generally minimal (i.e. little time spent testing the software) + compilation testing is generally frequent (i.e. most time spent compiling) + compilation takes between 5 and 120 minutes per architecture (but is invoke-and-forget) + approximately 10 minutes per architecture per build is needed to setup/invoke/analyse build and run benchmarks (minimal functionality test + approximately 6 supported architectures (osx, linux, freebsd, sgi, solaris, aix) (windows?) + approximately 1 hour to build across all platforms and verify builds + 8 active core developers + one cross-compilation build/test by all developers is approximately 8 man hours (1 man day) + one build per week (moderate activity) is about 400 man hours (50 man days) per year (50 weeks) + compilations are less frequent after release (1/week) + compilations are frequent before release (1+/day) + + +Future (Expected) Manual Testing Costs +-------------------------------------- + mandatory cross compilations happen nightly and per/commit happen automatically + maintenance of test suite is necessary + + +TOOL DESIGN +=========== + +Initial Automated Testing Costs +------------------------------- + design and implementation of test suite (0 -- done offline) + design and implementation of tests (1 man hour per test) + setup of test suite (8 man hours) + usage learning by all developers (1 man hour per developer) + + +Future Automated Testing Costs +------------------------------ + maintenance of test suite (1 man hour per month) + maintenance of tests (variable -- 1 man hour per year per test) + design and implementation of new tests ( 1 man hour per test) + + +Tool Users +---------- + builder and tester + := those who want to use the suite to verify buildability and/or functionality + test writer + := those who contribute tests to the test suite + suite maintainer + := those who install and/or modify the suite itself, preparing the test framework + software + := cron, web browsers, other tools that may invoke the tool on demand + + +Mandatory Tool Features and Contraints +-------------------------------------- + works cross-platform on all supported architectures + must be minimally dependant upon external interfaces and tools + may be run on demand + may be automated + tool should not irreversibly modify user data by default + tool must be understood/learned by all users + requires no time expense when system is static (should not have to "clean up logs", etc) + + +Desireable Tool Features +------------------------ + should provide minimal false negatives (suite failure) + tool should be quick/simple to learn and use + may be run interactively (single stepping at different levels) + should be simple to add new tests + should be robust test framework to support evolving test style/strategy + should provide informative test reports for failure investigation + + +Maintenance of Tool +------------------- + needs to have new tests added as new features/tools are added + must be maintained as supported architectures evolve + must be ported to newly supported architectures + Deleted: corredor/trunk/HACKING =================================================================== --- corredor/trunk/HACKING 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/trunk/HACKING 2006-09-22 13:47:04 UTC (rev 9) @@ -1,84 +0,0 @@ -The Hackers Guide to Corredor -============================= - -Please read this document if you are planning on contributing to -Corredor. - -Corredor is a relatively straight-forward project that is easily -extended by the user community. Corredor is comprised of three main -components. There is the primary driver application script -(i.e. "corredor"), a library loader (i.e. Resources/library), and -modules like the test bucket directories and the modular functionality -of Corredor itself (i.e. Resources/Source). Individuals looking to -extend Corredor's functionality will likely be looking at the last of -those three -- modules. - - -TABLE OF CONTENTS ------------------ - Introduction - Table of Contents - Communicating - How to Contribute - Coding Style & Standards - - -COMMUNICATING -------------- - -As there are many ways to get started with Corredor, one of the most -important steps for new contributors to do is get involved in the -discussions and communicate with the Corredor developers. There are -mailing lists, on-line forums, and an IRC channel available for -Corredor development and project communication. All contributors are -encouraged to participate in any of the available communication -channels: - -* Internet Relay Chat - - The primary and generally preferred mechanism for interactive - developer discussions is via Internet Relay Chat (IRC). Several of - the core developers and core contributors of Corredor hang out in - #brlcad on the Freenode network, a channel that is currently shared - with the BRL-CAD project. With most any IRC client, you should be - able to join #brlcad on irc.freenode.net, port 6667. See - http://freenode.net and http://irchelp.org for more information - -* E-mail Mailing Lists - - There are several mailing lists available for interaction, e.g. the - http://sourceforge.net/mail/?group_id=102847 "corredor-devel" mailing - list. More involved contributors may also be interested in joining - the "corredor-commits" and "corredor-tracker" mailing lists. - -* On-line Forums - - Discussion forums are available on the project site at - http://sourceforge.net/forum/?group_id=102847 for both developers - and users. Of particular interest to developers is, of course, the - "Developers" forum where all contributors are incouraged to - participate. - - -HOW TO CONTRIBUTE ------------------ - -Basically, just jump in. The project isn't complicated enough to -warrant any heavy handed procedures. Make a patch and post it -"somewhere" (ideally the sf.net patches tracker) and it will get -reviewed and probably included. If you do make a patch, unified diffs -of modified files and tarballs of new files are preferred. - -If you are really interested in becoming heavily involved in the -project, commit access can be provided. - - -CODING STYLE & STANDARDS ------------------------- - -The ONLY assumption Corredor or any of Corredor's source modules may -make is the availability of a POSIX shell environment. Anything -outside of that must be tested for (e.g. trying to use sendmail) and -remain optional. - ---- Deleted: corredor/trunk/INSTALL =================================================================== --- corredor/trunk/INSTALL 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/trunk/INSTALL 2006-09-22 13:47:04 UTC (rev 9) @@ -1,109 +0,0 @@ -Corredor Installation & Setup Guide -=================================== - -Installation of the Corredor Automation & Testing Suite is a fairly -straightforward process that involves installing the Corredor files -and then defining your run tests. Corredor itself requires no -compilation or preparation other than requiring that you have a POSIX -compliant shell environment. Suitable environments include Mac OS X, -the Cygwin/Mingw compatibility environment for Windows, most of the -various flavors of BSD, most of the various distributions of Linux, -and most UNIX operating systems. - -TABLE OF CONTENTS ------------------ - Introduction - Table of Contents - Quick Installation & Setup - Installation & Setup Details - Reporting Problems - - -QUICK INSTALLATION & SETUP --------------------------- - -Since you are reading this document, it is assumed that you have -obtained the full sources of Corredor and are ready to get started -setting up Corredor to work with your project. For the impatient or -simplistic, the following should get you going fairly quickly with -minimal effort. - -1) Copy the "automation" file and "Resources" directory into your -project sources or into a system directory. Example: - -cp -R automation Resources /path/to/your/project - -2) Create a directory that will contain run tests for your project. -This directory will contain one file or directory per test. Example: - -mkdir /path/to/your/project/Tests - -3) Create a test. This is a simple shell script that minally contains -the commands you want to run. An example of such a script that will -build a traditional GNU Build System project that uses configure: - -cat > /path/to/your/project/Tests/Build <<EOF -#!/bin/sh -if [ ! -f configure ] ; then - if [ -f autogen.sh ] ; then - sh autogen.sh - else - autoreconf -is - fi - if [ ! -f configure ] ; then - bomb "Could not find configure" - fi -fi -./configure -if [ $? != 0 ] ; then - bomb "Configure failed" -fi -make -if [ $? != 0 ] ; then - bomb "Compilation failed" -fi -log "Compilation succeeded" -return 0 - -EOF - -4) Create a ~/.automationrc file with lines describing your project and -where you've put files. Example: - -cat > ~/.automationrc <<EOF -PACKAGE=name_of_your_project -PACKAGE_SRC=/path/to/your/project -TESTS_D=/path/to/your/project/tests -EOF - -5) Run corredor. You should now be able to run the corredor -automation tool and provide the "start" command. It will copy your -sources to a temporary directory (which is configurable) and run the -tests in your test directory. Example: - -/path/to/automation start - -That should do it. If that doesn't work, see the following section on -INSTALLATION & SETUP DETAILS or review the proceeding instructions in -closer detail. If you have read and are still experiencing issues, -please report those problems via the REPORTING PROBLEMS section below. - -INSTALLATION & SETUP DETAILS ----------------------------- - -Not yet written. *ahem* - - -REPORTING PROBLEMS ------------------- - -Please report any bugs encountered to the project bug tracker at -http://sourceforge.net/tracker/?group_id=102847&atid=633006 - -Similarly, please post any request for feature enhancements or support -to http://sourceforge.net/tracker/?group_id=102847&atid=633009 and -http://sourceforge.net/tracker/?group_id=102847&atid=633007 -respectively. - ---- -Cheers! Modified: corredor/trunk/README =================================================================== --- corredor/trunk/README 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/trunk/README 2006-09-22 13:47:04 UTC (rev 9) @@ -57,8 +57,8 @@ To effectively utilize Corredor as an execution framework, minimal preparation is required. Namely, you will need to create execution scripts specific to you particular environment testing needs. See the -INSTALL file for a brief introduction on how to get started with -Corredor. +Documentation/INSTALL file for a brief introduction on how to get +started with Corredor. Corredor may also be used to benchmark the overall performance of shell environment. See the BENCHMARK section below for details. @@ -78,9 +78,9 @@ FILE MANIFEST ------------- + Documentation - project documentation and manual pages README - this initial documentation file Resources/ - execution framework internal logic and plugins - Resources/library - general purpose shell script library SystemBucket/ - system directory containing remote host settings TestBucket/ - directory containing runnable scripts/tests automation - the Corredor automation and test execution tool @@ -154,7 +154,8 @@ maintained by Christopher Sean Morrison. Feedback and contributions are always appreciated and welcome, and the project is always open to having others join in the direct development and improvement of -Corredor. See the HACKING file for details on getting involved. +Corredor. See the Documentation/HACKING file for details on getting +involved. Interactive support via IRC is preferred and generally available during UTC-5 hours on the Freenode network (irc.freenode.net:6667) in Deleted: corredor/trunk/Resources/NOTES =================================================================== --- corredor/trunk/Resources/NOTES 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/trunk/Resources/NOTES 2006-09-22 13:47:04 UTC (rev 9) @@ -1,114 +0,0 @@ -PROBLEM ANALYSIS -================ - -Needs ------ - for source code commits to the main CVS branch compile across multiple architectures - detection of software bugs - verification that expected APIs do not change unexpectedly - - -Problems --------- - compilation is time intensive - manually compiling across multiple architectures is time intensive - verification that source code behaves as expected is time intensive - APIs are sometimes broken or used in unforseen manners - modification to one source module inadvertently induces an error in another source module - - -Potential General Solutions to Problems ---------------------------------------- - ignore the problems and/or deal with the issues as they arise - use a testing framework - design and implement one - buy one - impose policy on commiters - - -Realistic Tool Solution Expectations ------------------------------------- - it is simple to run tests across multiple architectures on demand - adding new tests is not complicated - cross compilation across multiple architectures may be automated - - -Current Manual Testing Costs ----------------------------- - time/cost varies per developer - useability testing is generally minimal (i.e. little time spent testing the software) - compilation testing is generally frequent (i.e. most time spent compiling) - compilation takes between 5 and 120 minutes per architecture (but is invoke-and-forget) - approximately 10 minutes per architecture per build is needed to setup/invoke/analyse build and run benchmarks (minimal functionality test - approximately 6 supported architectures (osx, linux, freebsd, sgi, solaris, aix) (windows?) - approximately 1 hour to build across all platforms and verify builds - 8 active core developers - one cross-compilation build/test by all developers is approximately 8 man hours (1 man day) - one build per week (moderate activity) is about 400 man hours (50 man days) per year (50 weeks) - compilations are less frequent after release (1/week) - compilations are frequent before release (1+/day) - - -Future (Expected) Manual Testing Costs --------------------------------------- - mandatory cross compilations happen nightly and per/commit happen automatically - maintenance of test suite is necessary - - -TOOL DESIGN -=========== - -Initial Automated Testing Costs -------------------------------- - design and implementation of test suite (0 -- done offline) - design and implementation of tests (1 man hour per test) - setup of test suite (8 man hours) - usage learning by all developers (1 man hour per developer) - - -Future Automated Testing Costs ------------------------------- - maintenance of test suite (1 man hour per month) - maintenance of tests (variable -- 1 man hour per year per test) - design and implementation of new tests ( 1 man hour per test) - - -Tool Users ----------- - builder and tester - := those who want to use the suite to verify buildability and/or functionality - test writer - := those who contribute tests to the test suite - suite maintainer - := those who install and/or modify the suite itself, preparing the test framework - software - := cron, web browsers, other tools that may invoke the tool on demand - - -Mandatory Tool Features and Contraints --------------------------------------- - works cross-platform on all supported architectures - must be minimally dependant upon external interfaces and tools - may be run on demand - may be automated - tool should not irreversibly modify user data by default - tool must be understood/learned by all users - requires no time expense when system is static (should not have to "clean up logs", etc) - - -Desireable Tool Features ------------------------- - should provide minimal false negatives (suite failure) - tool should be quick/simple to learn and use - may be run interactively (single stepping at different levels) - should be simple to add new tests - should be robust test framework to support evolving test style/strategy - should provide informative test reports for failure investigation - - -Maintenance of Tool -------------------- - needs to have new tests added as new features/tools are added - must be maintained as supported architectures evolve - must be ported to newly supported architectures - Deleted: corredor/trunk/TODO =================================================================== --- corredor/trunk/TODO 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/trunk/TODO 2006-09-22 13:47:04 UTC (rev 9) @@ -1,51 +0,0 @@ -Corredor To Do List -=================== - -Included below is a list of items that are scheduled or desirable to -have done at some point. Most recently added items are on top, older -topics are on the bottom. This is not an official list, it's more of -a scratch pad to use for tracking development ideas and informal -plans in a lightweight manner. - -THESE SHOULD HAPPEN BEFORE THE FIRST RELEASE --------------------------------------------- - -* basic local operation respecting test dependencies - -* basic documentation on installation and setup - - -THESE SHOULD HAPPEN WITHIN TWO RELEASE ITERATIONS -------------------------------------------------- - -* improved logging framework via log4sh - -* remote operation - - -THESE ARE FOR FUTURE RELEASES ------------------------------ - -* add multiproject single-install support - -* add self-installation support (e.g. sudo ./corredor install) - -* web interface for benchmark results - -* modules for system characteristics (cpu, architecture, OS, versions, - memory, disks, network, etc) - -* modules for various command tools (posix or otherwise) - -* ability to step through scripts one statement at a time for - debugging and testing support - -* shell script compiler written in shell - - ---- -See the project task tracker for more to do items and future planning -efforts. http://sf.net/pm/?group_id=102847 - -TODO items should be formated to column 70 (M-q in emacs), no tabs - Modified: corredor/trunk/automation =================================================================== --- corredor/trunk/automation 2006-09-22 10:39:04 UTC (rev 8) +++ corredor/trunk/automation 2006-09-22 13:47:04 UTC (rev 9) @@ -1,5 +1,5 @@ #!/bin/sh -# C O R R E D O R +# A U T O M A T I O N # Corredor # # Copyright (c) 2003-2006 Christopher Sean Morrison @@ -52,8 +52,41 @@ # keep track of how we were invoked in case dollar-zero is reused ARGUMENTS="$*" -PATH_TO_CORREDOR="`dirname $0`" -NAME_OF_CORREDOR="`basename $0`" +ARG0="$0" + +# force locale setting to C so things like date output as expected +# XXX necessary? should be in plugin? (probably) +LC_ALL=C + +# commands that are required for basic functionality +for __cmd in echo head tail wc basename dirname ; do + echo "test" | $__cmd "test" > /dev/null 2>&1 + ret=$? + if [ $ret -eq 127 ] ; then + echo "INTERNAL ERROR: '${__cmd}' command is required for Corredor to initialize" + echo "The command was not found." + exit 2 + elif [ $ret -eq 126 ] ; then + echo "INTERNAL ERROR: '${__cmd}' command is required for Corredor to initialize" + echo "The command was found but is not executable." + exit 2 + fi +done + +# determine the behavior of head +case "x`echo 'head' | head -n 1 2>&1`" in + *xhead*) HEAD_N="n " ;; + *) HEAD_N="" ;; +esac + +# determine the behavior of tail +case "x`echo 'tail' | tail -n 1 2>&1`" in + *xtail*) TAIL_N="n " ;; + *) TAIL_N="" ;; +esac + +PATH_TO_CORREDOR="`dirname $ARG0`" +NAME_OF_CORREDOR="`basename $ARG0`" PATH_TO_LIBRARY="${PATH_TO_CORREDOR}/Resources/library" # sanity check @@ -80,38 +113,14 @@ # necessary setting for non-posix-compliant /bin/sh shells # (for proper $0 expansion, etc, on SGIs) _XPG=1 - echo sh "${PATH_TO_LIBRARY}" $@ + /bin/sh "${PATH_TO_LIBRARY}" $@ exit $? elif [ "x$1" = "xself-test" ] ; then echo "self-testing should also short circuit" fi -# force locale setting to C so things like date output as expected -# XXX necessary? should be in plugin? (probably) -LC_ALL=C -# commands that are required for basic functionality -for __cmd in echo head tail wc basename dirname ; do - echo "test" | $__cmd "test" > /dev/null 2>&1 - if [ $? = 127 ] ; then - echo "INTERNAL ERROR: '${__cmd}' command is required" - exit 2 - fi -done - -# determine the behavior of head -case "x`echo 'head' | head -n 1 2>&1`" in - *xhead*) HEAD_N="n " ;; - *) HEAD_N="" ;; -esac - -# determine the behavior of tail -case "x`echo 'tail' | tail -n 1 2>&1`" in - *xtail*) TAIL_N="n " ;; - *) TAIL_N="" ;; -esac - ### # CORREDOR IDENTIFICATION ######################### @@ -195,16 +204,17 @@ # suite version. if [ "x$1" = "x" ] ; then - # make sure COMMAND was not set externally + # make sure COMMAND was not set externally before assuming help if [ "x$COMMAND" = "x" ] ; then echo "$HELP_STATEMENT" - exit + exit 0 fi elif [ "x$2" = "x" ] ; then case "x$1" in # handle version x-[vV]) DISPLAY_VERSION=yes ;; x--[vV]) DISPLAY_VERSION=yes ;; + x[vV][eE][rR][sS][iI][oO][nN]) DISPLAY_VERSION=yes ;; x--[vV][eE][rR][sS][iI][oO][nN]) DISPLAY_VERSION=yes ;; # handle help @@ -212,6 +222,7 @@ x--\?) DISPLAY_HELP=yes ;; x-[hH]) DISPLAY_HELP=yes ;; x--[hH]) DISPLAY_HELP=yes ;; + x[hH][eE][lL][pP]) DISPLAY_HELP=yes ;; x--[hH][eE][lL][pP]) DISPLAY_HELP=yes ;; esac fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2006-09-22 10:39:10
|
Revision: 8 http://svn.sourceforge.net/corredor/?rev=8&view=rev Author: brlcad Date: 2006-09-22 03:39:04 -0700 (Fri, 22 Sep 2006) Log Message: ----------- updated install docs to reflect renaming Modified Paths: -------------- corredor/trunk/INSTALL Modified: corredor/trunk/INSTALL =================================================================== --- corredor/trunk/INSTALL 2006-09-22 10:27:28 UTC (rev 7) +++ corredor/trunk/INSTALL 2006-09-22 10:39:04 UTC (rev 8) @@ -28,10 +28,10 @@ simplistic, the following should get you going fairly quickly with minimal effort. -1) Copy the "corredor" file and "Resources" directory into your +1) Copy the "automation" file and "Resources" directory into your project sources or into a system directory. Example: -cp -R corredor Resources /path/to/your/project +cp -R automation Resources /path/to/your/project 2) Create a directory that will contain run tests for your project. This directory will contain one file or directory per test. Example: @@ -67,21 +67,21 @@ EOF -4) Create a ~/.corredorrc file with lines describing your project and +4) Create a ~/.automationrc file with lines describing your project and where you've put files. Example: -cat > ~/.corredorrc <<EOF +cat > ~/.automationrc <<EOF PACKAGE=name_of_your_project PACKAGE_SRC=/path/to/your/project TESTS_D=/path/to/your/project/tests EOF -5) Run corredor. You should now be able to run corredor and provide -the "start" command. It will copy your sources to a temporary -directory (which is configurable) and run the tests in your test -directory. Example: +5) Run corredor. You should now be able to run the corredor +automation tool and provide the "start" command. It will copy your +sources to a temporary directory (which is configurable) and run the +tests in your test directory. Example: -/path/to/corredor start +/path/to/automation start That should do it. If that doesn't work, see the following section on INSTALLATION & SETUP DETAILS or review the proceeding instructions in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2006-09-22 10:27:39
|
Revision: 7 http://svn.sourceforge.net/corredor/?rev=7&view=rev Author: brlcad Date: 2006-09-22 03:27:28 -0700 (Fri, 22 Sep 2006) Log Message: ----------- refer to automation instead of corredor Modified Paths: -------------- corredor/trunk/README Modified: corredor/trunk/README =================================================================== --- corredor/trunk/README 2006-09-22 10:25:06 UTC (rev 6) +++ corredor/trunk/README 2006-09-22 10:27:28 UTC (rev 7) @@ -81,9 +81,9 @@ README - this initial documentation file Resources/ - execution framework internal logic and plugins Resources/library - general purpose shell script library - SystemBucket/ - system directory containing settings for remote hosts + SystemBucket/ - system directory containing remote host settings TestBucket/ - directory containing runnable scripts/tests - corredor - the Corredor test execution command tool + automation - the Corredor automation and test execution tool REFERENCES This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2006-09-22 10:25:12
|
Revision: 6 http://svn.sourceforge.net/corredor/?rev=6&view=rev Author: brlcad Date: 2006-09-22 03:25:06 -0700 (Fri, 22 Sep 2006) Log Message: ----------- rename the thing that users will invoke on the command line to something hopefully a little more universally obvious. this doesn't change the project's name, but does change the command name from 'corredor' to 'automation'. Added Paths: ----------- corredor/trunk/automation Removed Paths: ------------- corredor/trunk/corredor Copied: corredor/trunk/automation (from rev 5, corredor/trunk/corredor) =================================================================== --- corredor/trunk/automation (rev 0) +++ corredor/trunk/automation 2006-09-22 10:25:06 UTC (rev 6) @@ -0,0 +1,1235 @@ +#!/bin/sh +# C O R R E D O R +# Corredor +# +# Copyright (c) 2003-2006 Christopher Sean Morrison +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +### +# +# Corredor Automation Test Suite +# +# Corredor is a robust and general framework for performing automated +# execution of tasks with a particular emphasis tasks related to +# software testing. With a POSIX-compliant shell, Corredor makes it +# easier to set up, maintain, and run scripts, supporting symmetric, +# simultaneous, and distributed exectution. +# +# Author: +# Christopher Sean Morrison +# cor...@in... +# +##################################################################### + +# echo "use nl for line numbering..." + +# keep track of how we were invoked in case dollar-zero is reused +ARGUMENTS="$*" +PATH_TO_CORREDOR="`dirname $0`" +NAME_OF_CORREDOR="`basename $0`" +PATH_TO_LIBRARY="${PATH_TO_CORREDOR}/Resources/library" + +# sanity check +# XXX would be good to delay running dirname/basename until the +# library is loaded so that we can test for their existance properly +CORREDOR="$PATH_TO_CORREDOR/$NAME_OF_CORREDOR" +if [ ! -f "$CORREDOR" ] ; then + echo "INTERNAL ERROR: $CORREDOR does not exist" + if [ ! "x$0" = "x$CORREDOR" ] ; then + echo "INTERNAL ERROR: dirname/basename inconsistency: $0 != $CORREDOR" + fi + exit 1 +fi + +# +# this is a time saving hack for when we are running in library mode. +# we bypass option & environment initialization as well as +# command-line parsing since they are not significant to the library +# command. also noteworthy, the actual loading of the library file +# itself is bypassed. +# + +if [ "x$1" = "xlibrary" ] ; then + # necessary setting for non-posix-compliant /bin/sh shells + # (for proper $0 expansion, etc, on SGIs) + _XPG=1 + echo sh "${PATH_TO_LIBRARY}" $@ + + exit $? +elif [ "x$1" = "xself-test" ] ; then + echo "self-testing should also short circuit" +fi + +# force locale setting to C so things like date output as expected +# XXX necessary? should be in plugin? (probably) +LC_ALL=C + +# commands that are required for basic functionality +for __cmd in echo head tail wc basename dirname ; do + echo "test" | $__cmd "test" > /dev/null 2>&1 + if [ $? = 127 ] ; then + echo "INTERNAL ERROR: '${__cmd}' command is required" + exit 2 + fi +done + +# determine the behavior of head +case "x`echo 'head' | head -n 1 2>&1`" in + *xhead*) HEAD_N="n " ;; + *) HEAD_N="" ;; +esac + +# determine the behavior of tail +case "x`echo 'tail' | tail -n 1 2>&1`" in + *xtail*) TAIL_N="n " ;; + *) TAIL_N="" ;; +esac + +### +# CORREDOR IDENTIFICATION +######################### + +CORREDOR_API=0 +CORREDOR_REL=0 +CORREDOR_MON=2006.10 +CORREDOR_VERSION="${CORREDOR_API}.${CORREDOR_REL}.${CORREDOR_MON}" + +CORREDOR_MANTRAS="Smart code just works. +Helping intelligent coders create intelligent code since 2003. +Test early, test often. +Automation, now with more flair. +Test, test, test. And then test some more. +The runner awaits. +El corredor aguarda. +O corredor espera." + +# pick a random mantra from the list +CORREDOR_MANTRA="`echo \"$CORREDOR_MANTRAS\" | head -${HEAD_N}\`expr \\\`echo $RANDOM\\\` % \\\`echo \"$CORREDOR_MANTRAS\" | wc -l\\\` + 1\` | tail -${TAIL_N}1`" + +INFO_STATEMENT="Corredor is a tool for software automation and testing. + For updates, visit http://corredor.sf.net + +$CORREDOR_MANTRA +" # end INFO_STATEMENT + +USAGE_STATEMENT="Usage: $CORREDOR [automation-options] command [command-options] + where automation-options are -w, -s, etc. + (specify --help-options for a list of options) + where command is start, stop, status, etc. + (specify --help-commands for a list of commands) + where command-options is any command specific option + (specify -h [command] for help on a particular command) +" # end USAGE_STATEMENT + +VERSION_STATEMENT="${NAME_OF_CORREDOR} (Corredor Automation Test Suite) ${CORREDOR_VERSION} +Release ${CORREDOR_REL}, Application Programming Interface ${CORREDOR_API} + +Copyright (c) 2003-2006 by Christopher Sean Morrison +BSD style license applies, see --help for more details. + +$INFO_STATEMENT" # end VERSION_STATEMENT + +HELP_STATEMENT="$USAGE_STATEMENT +$INFO_STATEMENT" # end HELP_STATEMENT + +RESOURCE_FILE_HEADER="#!/bin/sh +# +# C O R R E D O R A U T O M A T I O N R E S O U R C E F I L E +###################################################################### +# +# The following are settings to be used in conjunction with the +# Corredor Automation Test Suite. This file may be used as either the +# start for a default automation suite resource file (RESOURCE_FILE) +# or as a template for a system definition file that would go in the +# system bucket directory (SYSTEMS_D). +# +# As few or many of the variables below may be modified to enforce +# default behaviour different from the default settings. See the +# master corredor automation script for more details on the behavior +# and meaning of each variable. +# +###################################################################### +" + + +### +# QUICK ARUGMENT HANDLING +######################### +# +# this is a time saving hack for when there are no or common basic +# arguments given. usually, these are requests for help or the +# version number. +# +# by default, no arguments means no command, which means we need to +# display help. also, if the user gave a general help option with +# nothing else, then we need to display help. if there is only one +# argument (and it is a switch), then we do not have a command and we +# need to display help unless that arg looks like a request for the +# suite version. + +if [ "x$1" = "x" ] ; then + # make sure COMMAND was not set externally + if [ "x$COMMAND" = "x" ] ; then + echo "$HELP_STATEMENT" + exit + fi +elif [ "x$2" = "x" ] ; then + case "x$1" in + # handle version + x-[vV]) DISPLAY_VERSION=yes ;; + x--[vV]) DISPLAY_VERSION=yes ;; + x--[vV][eE][rR][sS][iI][oO][nN]) DISPLAY_VERSION=yes ;; + + # handle help + x-\?) DISPLAY_HELP=yes ;; + x--\?) DISPLAY_HELP=yes ;; + x-[hH]) DISPLAY_HELP=yes ;; + x--[hH]) DISPLAY_HELP=yes ;; + x--[hH][eE][lL][pP]) DISPLAY_HELP=yes ;; + esac +fi + +if [ "x$DISPLAY_HELP" = "xyes" ] ; then + echo "$HELP_STATEMENT" + exit 0 +fi + +if [ "x$DISPLAY_VERSION" = "xyes" ] ; then + echo "$VERSION_STATEMENT" + exit 0 +fi + + +### +# INCLUDE THE UTILITY LIBRARY +############################# +# +# the almighty library file. dirname is needed/recommended so that we +# will still be able to find the automation directory regardless of +# where or how this script was invoked without needing to give a +# full-path. +# +# this will automagically include any resources the library provides +# on-demand. +# +echo "Please wait ..." 1>&2 +. "${PATH_TO_LIBRARY}" +loadAllResources + +initializeOption VERSION "$CORREDOR_VERSION" "$CORREDOR_VERSION" "Display the version of the automation suite" "v ver vers" hidden-commands + +# log loading messages to standard error +initializeVariable LOADING_LOG stderr +initializeVariable LOADING_TICK "log -n \".\" $LOADING_LOG" + +# did not find anything, so start to load the suite vars and options +log -n "Loading Corredor Automation Suite..." $LOADING_LOG + + +### +# DEFAULT PUBLIC VARIABLE INITIALIZATION +######################################## +# +# begin default settings and options. the difference: options may be +# modified via command-line arguments + +# short name of the project being automation tested +initializeVariable PACKAGE corredor +$LOADING_TICK + +# default working directory +initializeOption RUN_DIR "/tmp/`whoami`" "__ANYTHING__" "Working directory, where to perform tests" "d dir directory" +$LOADING_TICK + +# directory or file containing the source package to automation test +initializeOption PACKAGE_SRC "." "__ANYTHING__" "Directory containing files to be tested" "p source source-dir package" "start restart" +$LOADING_TICK + +# name of log file for output +initializeOption RUN_LOG ".${NAME_OF_CORREDOR}-${HOSTNAME}.log" "__ANYTHING__" "Test output log file" "l log logfile" +$LOADING_TICK + +# default system to automation test. "all" is a special keyword to +# automation test all of the systems in SYSTEMS_D. "localhost" is a +# special keyword to automation test the local system. +initializeOption RUN_SYSTEM "localhost" "__ANYTHING__" "System(s) to automation test" "s system systems" +$LOADING_TICK + +# default test(s) to run. "all" is a special keyword to run all tests +# found in TESTS_D. additionally, the tests may manually be run one +# at a time through the shell. +initializeOption RUN_TEST "all" "__ANYTHING__" "Test(s) to run" "t test tests" +$LOADING_TICK + +# fail on warnings (0/false==do not fail, 1/true==fail) +initializeOption WARNINGS "yes" "__BOOLEAN__" "Give warnings or abort fatally" "w warn warnings" +$LOADING_TICK + +# clean out the automation directory before starting +initializeOption CLOBBER "no" "__BOOLEAN__" "Remove automation directory contents before starting" "c rm remove" "start restart" +$LOADING_TICK + +# give a warning before clobbering +initializeOption CONFIRM_CLOBBER yes "__BOOLEAN__" "Confirm before removing automation directory contents" "cc confirm " "start restart" +$LOADING_TICK + +# number of minutes to wait on the automation lock. set to less than +# or equal to zero to not wait for lock if it is not acquired. +initializeOption WAIT_FOR_LOCK_TIMEOUT 3 "__NUMBER__" "Minutes to wait for cooperative directory locks" "m minutes timeout lock-timeout wait-timeout" +$LOADING_TICK + +# transport is the mechanism that gets a file from the localhost to +# remote machines; available options are ttcp, scp, rcp +initializeVariable TRANSPORT "scp" +$LOADING_TICK + +### +# SYSTEM VARIABLE INITIALIZATIONS +################################# +# +# these variables are the same as those above except that the user +# should never really have to worry about their setting or have to +# change the default values except to modify the suite to run with +# other packages. + +# name of systems directory (full path) +initializeVariable SYSTEMS_D "${PSD}/SystemBucket" omit +$LOADING_TICK + +# name of tests directory (full path) +initializeVariable TESTS_D "${PSD}/TestBucket" omit +$LOADING_TICK + +# name of the self-test test directory +initializeVariable SELF_TESTS_D "${PSD}/Resources/SelfTestBucket" omit +$LOADING_TICK + +# resource file will override any default public or system settings +initializeVariable RESOURCE_FILE "${HOME}/.${NAME_OF_CORREDOR}rc" omit +$LOADING_TICK + +# +# the commands option group holds a list of valid automation +# commands. the HELP_${command} variable holds a descriptive help +# message pertinent to that command. options for any particular +# command are designated in option initializations below using a group +# name that is the same as the command name (e.g. -C clobber option is +# in "start" option group) +# +initializeOption START "" "__BOOLEAN__" "Start the automation testing" "" commands +$LOADING_TICK + +initializeVariable START_HELP "The start command is what will invoke the automation suite testing. After validating any automation and command options, the existance of the source archive is ensured on each of the systems being used. Then each of the systems will commence testing the source by running the requested automation scripts from the test directory on each host." help +$LOADING_TICK + +initializeOption STOP "" "__BOOLEAN__" "Stop the automation testing" "" commands +$LOADING_TICK + +initializeVariable STOP_HELP "This command will halt any specified systems that are presently in the process of running the automation suite. Depending on the nature of what the running machine is doing at the time and whether the machine is remote, or not, all test processes will be halted as soon as possible." help +$LOADING_TICK + +initializeOption RESTART "" "__BOOLEAN__" "Restart (stop/start) the automation testing" "" commands +$LOADING_TICK + +initializeVariable RESTART_HELP "This command will restart automation suite testing for any systems specified. Restarting the suite consists of stopping any hosts that are presently running any tests, and then commencing the automation suite testing for each host regardless of whether they were running prior to the stop or not." help +$LOADING_TICK + +initializeOption STATUS "" "__BOOLEAN__" "Get status of the automation testing" "" commands +$LOADING_TICK + +initializeVariable STATUS_HELP "This command will return a automation suite status as to whether a certain host has not run the test, is presently running the test, has completed the test and failed, or has completed the test and passed. Optionally, the results from the test may be displayed using terminal \"colorized\" ansi output, text output, and/or results may be sent out via e-mail." help +$LOADING_TICK + +initializeOption SETTINGS "" "__BOOLEAN__" "Display current project settings" "" commands +$LOADING_TICK + +initializeVariable SETTINGS_HELP "This command is useful in generating a default resource file (i.e. a default $RESOURCE_FILE file) that may be used for future automation test runs or for debugging. Corredor will output a settings file to standard output, which may be saved to a file: ${CORREDOR} > ~/.${NAME_OF_CORREDOR}rc" help +$LOADING_TICK + +initializeOption LIBRARY "" "__BOOLEAN__" "Output available function and variable definitions" "" commands +$LOADING_TICK + +initializeVariable LIBRARY_HELP "This command may be used by POSIX shell script-based test scripts to get library functions and variable declarations of general utility. Read the $NAME_OF_CORREDOR source code for more details and information on creating new tests as well as details on utilizing the resource library." help +$LOADING_TICK + +initializeOption BENCHMARK "" "__BOOLEAN__" "Compute statisitical benchmark analysis of shell performance" "" commands +$LOADING_TICK + +initializeVariable BENCHMARK_HELP "This command may be used to compute a performance metric for a given system. The benchmark analysis will compute several iterations of intensive environment testing that will in turn provide informative metrics of how quickly a system is presently able to perform." help +$LOADING_TICK + +initializeOption SELF_TEST "" "__BOOLEAN__" "Run the automation suite self-validation tests" "selftest" commands +$LOADING_TICK + +initializeVariable SELF_TEST_HELP "This command may be used to perform a self-test validation of the automation suite operability." help +$LOADING_TICK + +initializeOption HELP_OPTIONS "" "__BOOLEAN__" "Help with options" "help-option" hidden-commands +$LOADING_TICK + +initializeOption HELP_COMMANDS "" "__BOOLEAN__" "Help with commands" "help-command" hidden-commands +$LOADING_TICK + +initializeOption HELP "" "HELP `getInitializedVariables commands` __BOOLEAN__" "General help and help for a particular command" "h" commands +$LOADING_TICK + +initializeVariable HELP_HELP "Help on help -- XXX not yet implemented" help +$LOADING_TICK + +# a list of all of the commands given above (in category "commands") +initializeVariable COMMANDS "`getInitializedVariables commands`" omit +$LOADING_TICK + +initializeVariable ALL_CMDS "`getInitializedVariables \"hidden-commands commands\"`" omit +$LOADING_TICK + +initializeOption COMMAND "" "$ALL_CMDS" "What command to run" "run cmd command commands" omit +$LOADING_TICK + + +### +# LOAD RESOURCE FILE +#################### +# +# a resource file will override any of the above settings, as it will +# contain the last settings prior to execution or processing of +# options. hence, the priority of variable settings is 4th) intrinsic +# default values, 3rd) environment variables, 2nd) resource file +# values, 1st) command-line arguments (1 is highest precedence, 4 is +# lowest). +# +# the command-line arguments and, potentially, the resource file +# settings may be bypassed by setting the environment variable +# BYPASS_SETTINGS to non-null. +# +# the only "almost a caveat" clause to the ordering is that you cannot +# use BYPASS_SETTINGS to bypass the resource file using a command-line +# switch (hence there is no such --bypass-settings option). +# +# delay reporting a "bypassed" message until done with initialization +# +# XXX possible feature could be to allow a resource file in the +# current directory as well as searching for one in $HOME +# +[ "x$BYPASS_SETTINGS" = "x" ] && [ -r "$RESOURCE_FILE" ] && loadResourceFile "$RESOURCE_FILE" +$LOADING_TICK + +### +# HANDLE COMMAND-LINE ARGUMENTS +############################### +# +# handle command-line arguments that were given to set automation +# options. there is a little default processing that occurs up above +# to handle some special cases such as simple help and version. the +# rest of the processing occurs here for any initialized options +# available. + +# +# save current command values to recognize changed values during +# argument handling +# +initializeVariable PRE_CMDS "" omit +$LOADING_TICK +for cmd in $ALL_CMDS ; do + cmdvalue="echo \$$cmd" + PRE_CMDS="$PRE_CMDS `eval $cmdvalue`" +done + +log "...Done\n" $LOADING_LOG + +if [ "x$BYPASS_SETTINGS" = "x" ] ; then + # + # iterate over arguments + # + for argument in $ARGUMENTS ; do + + # add command once set to force checking in proper category + handleArgument "$1" "$2" $COMMAND + handled="$?" + + if [ $handled -eq 0 ] ; then + log "Invalid option: $1" + log "$HELP_STATEMENT" + exit + elif [ $handled -gt 2 ] ; then + log "Invalid option value: $1 $2" + log "$HELP_STATEMENT" + exit + fi + + # if command is set, we want to check if the value has changed + # from the original value. if it has *changed*, we have an + # active command. + if [ "x$COMMAND" = "x" ] ; then + + # regenerate the command value list + postcmds="" + for cmd in $ALL_CMDS ; do + cmdvalue="echo \$$cmd" + postcmds="$postcmds `eval $cmdvalue`" + done + + # if one of the commands changed, it should be the + # variable for the current switch + if [ ! "x$postcmds" = "x$PRE_CMDS" ] ; then + handleArgument COMMAND "`getOptionVariable $1`" omit + [ $? -ne 2 ] && log "COULD NOT SET COMMAND" + fi + fi + + shift $handled + + # stop the insessint looping if we finished handling args + [ "x$1" = "x" ] && break; + done +else + # report if we bypassed a resource or command-line args + if [ -r "$RESOURCE_FILE" ] ; then + if [ "x$*" = "x" ] ; then + log "Resource file bypassed (BYPASS_SETTINGS=$BYPASS_SETTINGS)" + else + log "Resource file and command-line settings bypassed (BYPASS_SETTINGS=$BYPASS_SETTINGS)" + fi + elif [ ! "x$*" = "x" ] ; then + log "Command-line settings bypassed (BYPASS_SETTINGS=$BYPASS_SETTINGS)" + fi +fi + +# +# immediately validate that we ended up with a proper command name +# +if [ "x$COMMAND" = "x" ] ; then + log "A valid command name was NOT given" + log "$HELP_STATEMENT" + exit +fi +# make sure command's case is consistent +COMMAND="`echo $COMMAND | tr [:lower:]- [:upper:]_`" +LC_COMMAND="`echo $COMMAND | tr [:upper:]_ [:lower:]-`" +VALID_CMD="no" +for cmd in $ALL_CMDS ; do + if [ "x$cmd" = "x$COMMAND" ] || [ "x`echo $cmd | tr [:lower:]- [:upper:]_`" ] ; then + VALID_CMD="yes" + break + fi +done +if [ "x$VALID_CMD" = "xno" ] ; then + log "Invalid command: $COMMAND" + log "$HELP_STATEMENT" + exit +fi + +### +# HANDLE SIMPLE COMMANDS +######################## +# +# process commands that do not require any settings to be validated, +# are guaranteed to not be remote, and do not require any resources or +# functions defined outside of the core library (like the +# testing-specific calls). for any other command, we need to load +# libraries and validate settings. + +# +# "help" command +# +if [ "x$COMMAND" = "xHELP" ] ; then + + if [ "x$HELP" = "x1" ] ; then + log "$USAGE_STATEMENT" + else + helped="no" + uchelpvalue="`echo $HELP | tr [:lower:]- [:upper:]_`" + lchelpvalue="`echo $HELP | tr [:upper:]_ [:lower:]-`" + + [ ! "x$DEBUG" = "x" ] && log "Looking up help for [$uchelpvalue / $lchelpvalue] command" stderr + if [ ! "x${uchelpvalue}_HELP" = "x" ] ; then + log "Help for the \"$HELP\" command" + log "=========================================\n" + log "Summary:\n" + hlp_msg="echo \"\$${uchelpvalue}_HELP\"" + plog "`eval $hlp_msg`" "$LOG" 80 " " + log "" + + options="`getInitializedVariables $lchelpvalue`" + if [ ! "x$options" = "x" ] ; then + dispOptHead=no + for option in $options ; do + + switches="`getOptionSwitches $option`" + values="`getOptionValues $option`" + + if [ ! "x$switches" = "x" ] ; then + optval="echo \$$option" + optval="`eval $optval`" + + if [ "x$dispOptHead" = "xno" ] ; then + log "Options:\n" + firstSwitch="`echo $switches | awk '{print $1}'`" + plog "Options may be specified 1) via an environment variable, 2) through a .${NAME_OF_CORREDOR}rc file in user's home directory (see settings command), or 3) as a command-line argument to the automation suite using a valid switch (e.g. $CORREDOR $lchelpvalue --${firstSwitch}=\"$optval\" sets $option to \"$optval\")." "$LOG" 80 " " + log "" + dispOptHead=yes + fi + + log " $option=\"$optval\"" + log " `getOptionDescription $option`" + log " Switches: $switches" + log " Valid Values: $values\n" + fi + done + fi + helped="yes" + break + fi + [ "x$helped" = "xno" ] && log "$USAGE_STATEMENT" + fi + log "$INFO_STATEMENT" + exit + + +# +# "help-options" command +# +elif [ "x$COMMAND" = "xHELP_OPTIONS" ] ; then + + log "Automation options help" + + # iterate over main options + for i in `getInitializedVariables` ; do + option="`getOptionSwitches $i`" + if [ ! "x$option" = "x" ] ; then + default="echo \$$i" + varval="${i}=\"`eval $default`\"" + log " -`echo ${option} | awk '{print $1}'` `getOptionDescription $i` (${varval})" + fi + done + log " -v `getOptionDescription VERSION`" + log " -h `getOptionDescription HELP`" + log "" + + # iterate over command-specific options + LC_COMMANDS="`echo $COMMANDS | tr [:upper:]_ [:lower:]-`" + for i in $LC_COMMANDS ; do + options="`getInitializedVariables $i`" + if [ ! "x$options" = "x" ] ; then + displayedHeader="no" + for j in $options ; do + switches="`getOptionSwitches $j`" + if [ ! "x$switches" = "x" ] ; then + if [ "x$displayedHeader" = "xno" ] ; then + log "Options for the '${i}' command" + displayedHeader="yes" + fi + default="echo \$$j" + varval="${j}=\"`eval $default`\"" + log " -`echo ${switches} | awk '{print $1}'` `getOptionDescription $j` ($varval)" + fi + done + log "" + fi + done + log "$INFO_STATEMENT" + exit + +# +# "help-commands" command +# +elif [ "x$COMMAND" = "xHELP_COMMANDS" ] ; then + + LC_COMMANDS="`echo $COMMANDS | tr [:upper:]_ [:lower:]-`" + + log "Valid Automation Commands" + for i in $LC_COMMANDS ; do + log " $i \t`getOptionDescription $i`" + done + log "\nSpecify -h [command] for more detailed help on a particular command\n (e.g. $CORREDOR -h start)\n" + log "$INFO_STATEMENT" + exit + +# +# "settings" command +# +elif [ "x$COMMAND" = "xSETTINGS" ] ; then + + RC_VARS="`getInitializedVariables`" + [ "x$RC_VARS" = "x" ] && bomb "automation settings: no initialized variables set??" + + logfile=stdout + + # output header + log "$RESOURCE_FILE_HEADER" $logfile + + # output body + for __RV in $RC_VARS ; do + log "" $logfile + __RPVAR="echo \$$__RV" + log "${__RV}=\"`eval $__RPVAR`\"" $logfile + done + + # output footer + log "" $logfile + log "###" $logfile + + exit + +# +# "library" command -- we should only arrive at this point if other +# command line arguments were given. you cannot do anything but +# output source since the library command SHOULD HAVE NO OPTIONS +# (ever) +# +elif [ "x$COMMAND" = "xLIBRARY" ] ; then + . "${PATH_TO_LIBRARY}" source + exit + +# +# Corredor shell benchmark analysis +# +elif [ "x$COMMAND" = "xBENCHMARK" ] ; then + TIMEFRAME=60 + + log "C O R R E D O R B E N C H M A R K" + log "===================================" + + # capture how long it takes to source the library -- we want at + # least three times that for a time frame (this is needed for slow + # machines that require more than the default timeframe to simply + # load one!) + TIME="`date | awk '{print $4}'`" + HOUR="`echo $TIME | cut -d':' -f1`" + MIN="`echo $TIME | cut -d':' -f2`" + SEC="`echo $TIME | cut -d':' -f3`" + PRECOUNT="`expr $SEC + \( $MIN \* 60 \) + \( \( $HOUR \* 24 \) \* 60 \)`" + + WC="`sh $PATH_TO_LIBRARY source | wc`" + LINE="`echo $WC | awk '{print $1}'`" + WORD="`echo $WC | awk '{print $2}'`" + CHAR="`echo $WC | awk '{print $3}'`" + + # XXX need to wrap the timing functions into the library + TIME="`date | awk '{print $4}'`" + HOUR="`echo $TIME | cut -d':' -f1`" + MIN="`echo $TIME | cut -d':' -f2`" + SEC="`echo $TIME | cut -d':' -f3`" + COUNT="`expr $SEC + \( $MIN \* 60 \) + \( \( $HOUR \* 24 \) \* 60 \)`" + + SOURCE_TIME="`expr $COUNT - $PRECOUNT`" + log "Takes about $SOURCE_TIME seconds to load the library" + SOURCE_TIME="`expr $SOURCE_TIME \* 3`" + + [ $SOURCE_TIME -gt $TIMEFRAME ] && TIMEFRAME="$SOURCE_TIME" + log "Timeframe is $TIMEFRAME" + + ENDCOUNT="`expr $COUNT + $TIMEFRAME`" + + METRIC=0 + log "Benchmark analysis will run for approximately $TIMEFRAME seconds.\n" + log -n "Benchmark now in progress..." + while [ $COUNT -lt $ENDCOUNT ] ; do + log -n "." + + sh "$PATH_TO_LIBRARY" load > /dev/null 2>&1 + + TIME="`date | awk '{print $4}'`" + HOUR="`echo $TIME | cut -d':' -f1`" + MIN="`echo $TIME | cut -d':' -f2`" + SEC="`echo $TIME | cut -d':' -f3`" + COUNT="`expr $SEC + \( $MIN \* 60 \) + \( \( $HOUR \* 24 \) \* 60 \)`" + METRIC="`expr $METRIC + 1`" + done + # account for potential over-slippage for really slow machines or short + # time frames. + TIMEFRAME="`expr $TIMEFRAME + \( $COUNT - $ENDCOUNT \)`" + + log "Done." + log "\nResulting metrics:" + log "\t$TIMEFRAME\tseconds" + log "\t$METRIC\titerations" +METRICRATE=`dc <<EOF +2 k $METRIC $TIMEFRAME / p +EOF +` + log "\t$METRICRATE\titerations/sec" + log " " + log "\t$LINE\tlines/iteration" + log "\t$WORD\twords/iteration" + log "\t$CHAR\tcharacters/iteration" + log " " +LINERATE=`dc <<EOF +1 k $LINE $METRIC * $TIMEFRAME / p +EOF +` +log "\t$LINERATE\tlines/sec" +WORDRATE=`dc <<EOF +1 k $WORD $METRIC * $TIMEFRAME / p +EOF +` +log "\t$WORDRATE\twords/sec" +CHARRATE=`dc <<EOF +1 k $CHAR $METRIC * $TIMEFRAME / p +EOF +` +log "\t$CHARRATE\tchars/sec" + + exit +# +# "self-test" run -- only run the self-test tests. this effectively +# means (on purpose) that you can't run the self-test and other tests +# at the same time without making a specific automation test that +# invokes a localhost self-test itself. +# +# part of the reasoning for this limitation is that the self-test is +# not meant to be used in a production environment -- only during +# setup/install. why? because no guarantees or expectations should +# be made regarding the self-test tests, layout, and execution +# mechanisms. (as opposed to the library facilities which should +# remain backwards-compatible with minor releases) the self-test is a +# volatile developer function. +# +# on the other hand, you should be able to execute the self-tests on +# remote systems using various transports just like any other test +# bucket set. +# +elif [ "x$COMMAND" = "xSELF_TEST" ] ; then + + # make the work directory the location of this automation script. + # this implies that self-test tests should not clobber anything + # that existed beforehand. + RUN_DIR="${PSD}" + PACKAGE_SRC="${PSD}" + + TESTS_D="$SELF_TESTS_D" + RUN_TEST="all" + COMMAND=START + LC_COMMAND=start + + # instead of reinvoking here, just let it fall through to be + # processed. this is not only faster, but a more clean test + # environment. + # $PATH_TO_CORREDOR + # exit +fi + + +### +# VALIDATE COMMON SETTINGS +########################## +# +# initialize variables and test dependancy tree +# + +# +# warn if RESOURCE_FILE was there but not readable when loaded earlier +# +[ -f "$RESOURCE_FILE" ] && [ ! -r "$RESOURCE_FILE" ] && warn "Resource file [RESOURCE_FILE=$RESOURCE_FILE] is NOT readable" + +# +# warn if there is whitespace in the package name +# +if [ ! "x`echo $PACKAGE | awk '{print $1}'`" = "x$PACKAGE" ] ; then + warn "Package name [PACKAGE=$PACKAGE] contains whitespace -- untested" +fi + +# +# check our automation directory settings for useability. sanity +# check -- make sure someone didn't request "". it is not a good idea +# to use "." either, since tests may clobber contents, but alas we do +# not check. we specifically do not check for read-write permissions +# until later (when we need to). +# +[ "x$RUN_DIR" = "x" ] && bomb "Must specify automation directory [RUN_DIR=""]\n Use -`getOptionSwitches RUN_DIR | awk '{print $1}'` switch" + +# +# make sure the SYSTEMS_D and TESTS_D directories exist, that we can +# get a listing (read), and that we can access and query contents +# (exec). each level is checked individually for more exact warning +# output. +# +if [ ! -d "$SYSTEMS_D" ] ; then + warn "Systems directory [SYSTEMS_D=$SYSTEMS_D] does not exist" +elif [ ! -r "$SYSTEMS_D" ] ; then + warn "Systems directory [SYSTEMS_D=$SYSTEMS_D] is not readable" +elif [ ! -x "$SYSTEMS_D" ] ; then + warn "Systems directory [SYSTEMS_D=$SYSTEMS_D] is not executable" +fi +if [ ! -d "$TESTS_D" ] ; then + warn "Tests directory [TESTS_D=$TESTS_D] does not exist" +elif [ ! -r "$TESTS_D" ] ; then + warn "Tests directory [TESTS_D=$TESTS_D] is not readable" +elif [ ! -x "$TESTS_D" ] ; then + warn "Tests directory [TESTS_D=$TESTS_D] is not executable" +fi + +# +# expand "all" keyworded system and test lists +# +if [ "x$RUN_SYSTEM" = "xall" ] ; then + RUN_SYSTEM="" + for SYS in `ls -A $SYSTEMS_D` __justInCase__ ; do + # check for system dirs, must be exec to read descriptions + [ -r "${SYSTEMS_D}/${SYS}/${SYS}" ] && RUN_SYSTEM="$RUN_SYSTEM $SYS" + done +elif [ "x$RUN_SYSTEM" = "x" ] ; then + # assume localhost if the system is still unspecified + RUN_SYSTEM="localhost" +fi +if [ "x$RUN_TEST" = "xall" ] ; then + RUN_TEST="" + for TST in `ls -A $TESTS_D` __justInCase__ ; do + # all directories in test bucket directory that have a test + [ -r "${TESTS_D}/${TST}/${TST}" ] && RUN_TEST="$RUN_TEST $TST" + done +fi + + +# +# make sure there is something left to do (i.e. that there is at least +# one test that may be run on some system, or that we are +# self-testing) +# +[ "x$RUN_SYSTEM" = "x" ] && bomb "No systems are specified [RUN_SYSTEM=$RUN_SYSTEM]. Use -`getOptionSwitches RUN_SYSTEM | awk '{print $1}'` switch" +[ "x$RUN_TEST" = "x" ] && bomb "No tests are specified [RUN_TEST=$RUN_TEST]. Use -`getOptionSwitches RUN_TEST | awk '{print $1}'` switch" + +# +# convert boolean option to simple yes/no values here (just for +# simplicity so that later on we only have to check for yes/no values) +# +variableIsTrue WARNINGS && WARNINGS=yes || WARNINGS=no + + + +### +# DONE CONFIGURATION +#################### +# +# now that we are done setting up and getting proper values, we need +# to determine how to proceed with running the tests. the basic idea +# is that if we are local and RUN_DIR is the same directory as +# PACKAGE_DIR, then we may begin actually running the tests. +# otherwise, we work on getting the suite into that kind of situation +# (i.e. send files to remote machines, copy the source directory to +# the run directory, reinvoke test as a localhost run). +# + +DEBUG=yes +if [ ! "x$DEBUG" = "x" ] ; then + log "Running $COMMAND:" + log "\tRUN_SYSTEM=$RUN_SYSTEM" + log "\tRUN_DIR=$RUN_DIR" + log "\tPACKAGE_SRC=$PACKAGE_SRC" + log "\tTESTS_D=$TESTS_D" + log "\tSYSTEMS_D=$SYSTEMS_D" + log "\tCOMMAND=$LC_COMMAND" + log "Tests:\n\t$RUN_TEST" + log "PSD: $PSD" + log "PWD: $PWD" +fi + +# iterate over all systems +for SYSTEM in $RUN_SYSTEM ; do + + log "Processing $SYSTEM..." + + # check for remote system + if ! isLocalhost "$SYSTEM" ; then + + ### + # HANDLE REMOTE SYSTEM + ###################### + # + # steps: + # ensure transport (ttcp, rsh, ssh) with remote system + # copy suite, tests, and package to remote system + # reinvoke tests remotely + # return remote test execution results + + validateTransport $TRANSPORT + + # !!! unimplemented + bomb "unimplemented" + + else + ### + # HANDLE LOCALHOST SYSTEM + ######################### + # + # Process: + # validate command-specific settings + # + + # + # validate start command settings + # + if [ "x$COMMAND" = "xSTART" ] ; then + + # + # convert boolean options to simple yes/no values here + # (just for simplicity so that later on we only have to + # check for yes/no values). + # + variableIsTrue CLOBBER && CLOBBER=yes || CLOBBER=no + variableIsTrue CONFIRM_CLOBBER && CONFIRM_CLOBBER=yes || CONFIRM_CLOBBER=no + + # + # prep and validate the automation directory just in case + # we need to use it early. make sure it exists, is a + # directory, and that it is read/writeable. + # + + # check if run_dir is actually a directory + fresh_run_dir=no + if [ ! -d "$RUN_DIR" ] ; then + warn "Automation directory [RUN_DIR=$RUN_DIR] does not exist" + + # handle the case where there is a file in the way + if [ -f "$RUN_DIR" ] ; then + warn "There is something that is not a directory at [$RUN_DIR]" + + # if clobbering is turned on and there is + # something in the way, try to blow it away. + if [ "x$CLOBBER" = "xyes" ] ; then + answer=yes + if [ ! "x$CONFIRM_CLOBBER" = "xno" ] ; then + ask "Remove file $RUN_DIR [yes/no]?" && answer=yes || answer=no + fi + if [ "x$answer" = "xyes" ] ; then + rm -f "${RUN_DIR}" + if [ $? != 0 ] ; then + bomb "Unable to remove file [$RUN_DIR]" + else + log "Deleted file [$RUN_DIR]" + fi + + else + bomb "Unable to proceed with [RUN_DIR=$RUN_DIR] in the way" + fi + else + bomb "Unable to continue with [$RUN_DIR] in the way" + fi + # end check for clobber + fi + # end check if run dir is a file + + log "Creating directory [$RUN_DIR]" + mkdir -m 700 -p "$RUN_DIR" + if [ $? -ne 0 ] ; then + warn "Unable to make directory [$RUN_DIR]" + fi + + # stop now if still do not have directory to work with + [ ! -d "$RUN_DIR" ] && bomb "Directory does not exist [$RUN_DIR]" + + # make a note that this is a new directory so we do + # not bother tring to clobber it later + fresh_run_dir=yes + fi + # end check if run_dir is actually a directory + + # + # make sure we have proper permissions (sanity checks) + # + [ ! -r "${RUN_DIR}" ] && bomb "Automation directory [RUN_DIR=$RUN_DIR] is not readable" + [ ! -w "${RUN_DIR}" ] && bomb "Automation directory [RUN_DIR=$RUN_DIR] is not writeable" + [ ! -x "${RUN_DIR}" ] && bomb "Automation directory [RUN_DIR=$RUN_DIR] is not executable" + + + # + # Verify that a source was given + # + if [ "x$PACKAGE_SRC" = "x" ] ; then + bomb "Must give a automation source [PACKAGE_SRC=$PACKAGE_SRC].\n Use -`getOptionSwitches PACKAGE_SRC | awk '{print $1}'` switch and give either a directory or an archive file" + fi + + # make sure we can read the source + [ -r "$PACKAGE_SRC" ] || bomb "Unable to read package source [PACKAGE_SRC=$PACKAGE_SRC]" + + # + # source needs to be a directory, if it is not already + # + if [ ! -d "$PACKAGE_SRC" ] ; then + + # handle the case where the source is a file (assumedly an + # archive file ala .tar.gz, .bz2, etc) + if [ -f "$PACKAGE_SRC" ] ; then + unpackArchive "$PACKAGE_SRC" "$RUN_DIR" + [ "x$?" = "x1" ] && bomb "Unable to unpack archive [PACKAGE_SRC=$PACKAGE_SRC]" + else + # handle any special keyword source cases (e.g. cvs) + case "$PACKAGE_SRC" in + c[vV][sS] | C[vV][sS] ) + # save any other cvs export log files + if [ -f "${RUN_DIR}/$CVS_LOGFILE" ] ; then + warn "Moving previous cvs log file [${RUN_DIR}/$CVS_LOGFILE] to [${RUN_DIR}/${CVS_LOGFILE}.$$]" + mv "${RUN_DIR}/$CVS_LOGFILE" "${RUN_DIR}/${CVS_LOGFILE}.$$" + touch "${RUN_DIR}/$CVS_LOGFILE" + fi + + # Perform the cvs export + warn "XXX unimplemented" + log "cvsExport \"$CVS_TAG\" \"$CVS_ROOT\" \"$RUN_DIR\" \"$CVS\" \"${RUN_DIR}/${CVS_LOGFILE}\"" + [ "x$?" = "x0" ] && bomb "cvs export failed" + + ;; + esac + # done handling special keyword source cases + fi + # done handling file + + # now we behave just like if we were given a directory + ORIGINAL_PACKAGE_SRC="${PACKAGE_SRC}" + PACKAGE_SRC="${RUN_DIR}" + fi + + # + # make sure we have proper permissions (sanity checks) + # + [ -d "${PACKAGE_SRC}" ] || bomb "Source directory [PACKAGE_SRC=$PACKAGE_SRC] is not a directory ??" + [ -r "${PACKAGE_SRC}" ] || bomb "Source directory [PACKAGE_SRC=$PACKAGE_SRC] is not readable" + [ -x "${PACKAGE_SRC}" ] || bomb "Source directory [PACKAGE_SRC=$PACKAGE_SRC] is not executable" + + # + # PACKAGE_SRC should now be a valid directory as expected + # + + # !!! need to check for inclusion of a directory so that + # we do not inadvertantly delete the package + if `directoryContainsDirectory "$RUN_DIR" "$PACKAGE_SRC"` ; then + # if [ ! "x$RUN_DIR_INODE" = "x$PACKAGE_SRC_INODE" ] ; then + + # + # clean out the contents at the automation directory + # location (except any special log files, ".", and + # "..", etc) unless we just # made this directory. + # + if [ ! "x$fresh_run_dir" = "xyes" ] ; then + if [ "x$CLOBBER" = "xyes" ] ; then + if [ ! "x$CONFIRM_CLOBBER" = "xno" ] ; then + ask "Clean out $RUN_DIR [yes/no]?" && answer=yes || answer=no + fi + if [ "x$answer" = "xyes" ] ; then + for entry in `ls -A $RUN_DIR` ; do + if [ ! "x$entry" = "x$RUN_LOG" ] && [ ! "x$entry" = "x." ] && [ ! "x$entry" = "x.." ] && [ ! "x$entry" = "x" ] ; then + [ ! "x$DEBUG" = "x" ] && log "Deleting [${RUN_DIR}/${entry}]" + if [ -f "${RUN_DIR}/${entry}" ] ; then + log "rm -f \"${RUN_DIR}/${entry}\"" + else + log "rm -rf \"${RUN_DIR}/${entry}\"" + fi + [ $? != 0 ] && bomb "Failure cleaning out automation directroy $RUN_DIR" + fi + done + fi + fi + fi + # end cleaning out automation directory + + else + if [ "x$CLOBBER" = "xyes" ] ; then + warn "Unable to clobber the automation directory -- it contains the package directory!" + fi + fi + # end check if run_dir contains the package_src + + + # !!! next copy the package_src into the run_dir + + # + # the automation directory should now be completely ready + # for use + # + + # link or copy the source into the automation directory if + # we didn't unarchive there. this is only significant for + # sources that are not archived initially since we unpack + # into the automation directory + # + # XXX need to add linking + log "Copying $PACKAGE_SRC TO $RUN_DIR" + log "cp -R $PACKAGE_SRC $RUN_DIR" + [ $? != 0 ] && bomb "Unable to copy source directory contents to automation directory" + + # + # put the tests in place. the tests should be able to + # assume there relative location to the source dir + # + echo rm -rf "${RUN_DIR}/__automation" + echo cp -R "$PSD" "${RUN_DIR}/__automation" + TEST_DIR_NAME="`basename $TESTS_D`" + echo mkdir "${RUN_DIR}/${TEST_DIR_NAME}" + echo cp -R "$TESTS_D" "${RUN_DIR}/${TEST_DIR_NAME}" + echo ls -la $RUN_DIR/__automation + + + # + # validate stop command settings + # + elif [ "x$COMMAND" = "xstop" ] ; then + bomb "stop command unimplemented" + + + # + # validate status command settings + # + elif [ "x$COMMAND" = "xstatus" ] ; then + bomb "status command unimplemented" + + + # + # validate restart command settings + # + elif [ "x$COMMAND" = "xrestart" ] ; then + bomb "restart command unimplemented" + fi + + + # + # done with localhost. + # + fi + # XXX done handling system execution, report run results + +done +# done iterating over all systems + + +### +# END +##### + +log "OK Done $CORREDOR" +exit 0 + +# Local Variables: +# mode: sh +# tab-width: 8 +# sh-indentation: 4 +# sh-basic-offset: 4 +# indent-tabs-mode: t +# End: +# ex: shiftwidth=4 tabstop=8 Deleted: corredor/trunk/corredor =================================================================== --- corredor/trunk/corredor 2006-09-22 10:22:19 UTC (rev 5) +++ corredor/trunk/corredor 2006-09-22 10:25:06 UTC (rev 6) @@ -1,1235 +0,0 @@ -#!/bin/sh -# C O R R E D O R -# Corredor -# -# Copyright (c) 2003-2006 Christopher Sean Morrison -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# -# 3. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -### -# -# Corredor Automation Test Suite -# -# Corredor is a robust and general framework for performing automated -# execution of tasks with a particular emphasis tasks related to -# software testing. With a POSIX-compliant shell, Corredor makes it -# easier to set up, maintain, and run scripts, supporting symmetric, -# simultaneous, and distributed exectution. -# -# Author: -# Christopher Sean Morrison -# cor...@in... -# -##################################################################### - -# echo "use nl for line numbering..." - -# keep track of how we were invoked in case dollar-zero is reused -ARGUMENTS="$*" -PATH_TO_CORREDOR="`dirname $0`" -NAME_OF_CORREDOR="`basename $0`" -PATH_TO_LIBRARY="${PATH_TO_CORREDOR}/Resources/library" - -# sanity check -# XXX would be good to delay running dirname/basename until the -# library is loaded so that we can test for their existance properly -CORREDOR="$PATH_TO_CORREDOR/$NAME_OF_CORREDOR" -if [ ! -f "$CORREDOR" ] ; then - echo "INTERNAL ERROR: $CORREDOR does not exist" - if [ ! "x$0" = "x$CORREDOR" ] ; then - echo "INTERNAL ERROR: dirname/basename inconsistency: $0 != $CORREDOR" - fi - exit 1 -fi - -# -# this is a time saving hack for when we are running in library mode. -# we bypass option & environment initialization as well as -# command-line parsing since they are not significant to the library -# command. also noteworthy, the actual loading of the library file -# itself is bypassed. -# - -if [ "x$1" = "xlibrary" ] ; then - # necessary setting for non-posix-compliant /bin/sh shells - # (for proper $0 expansion, etc, on SGIs) - _XPG=1 - echo sh "${PATH_TO_LIBRARY}" $@ - - exit $? -elif [ "x$1" = "xself-test" ] ; then - echo "self-testing should also short circuit" -fi - -# force locale setting to C so things like date output as expected -# XXX necessary? should be in plugin? (probably) -LC_ALL=C - -# commands that are required for basic functionality -for __cmd in echo head tail wc basename dirname ; do - echo "test" | $__cmd "test" > /dev/null 2>&1 - if [ $? = 127 ] ; then - echo "INTERNAL ERROR: '${__cmd}' command is required" - exit 2 - fi -done - -# determine the behavior of head -case "x`echo 'head' | head -n 1 2>&1`" in - *xhead*) HEAD_N="n " ;; - *) HEAD_N="" ;; -esac - -# determine the behavior of tail -case "x`echo 'tail' | tail -n 1 2>&1`" in - *xtail*) TAIL_N="n " ;; - *) TAIL_N="" ;; -esac - -### -# CORREDOR IDENTIFICATION -######################### - -CORREDOR_API=0 -CORREDOR_REL=0 -CORREDOR_MON=2006.10 -CORREDOR_VERSION="${CORREDOR_API}.${CORREDOR_REL}.${CORREDOR_MON}" - -CORREDOR_MANTRAS="Smart code just works. -Helping intelligent coders create intelligent code since 2003. -Test early, test often. -Automation, now with more flair. -Test, test, test. And then test some more. -The runner awaits. -El corredor aguarda. -O corredor espera." - -# pick a random mantra from the list -CORREDOR_MANTRA="`echo \"$CORREDOR_MANTRAS\" | head -${HEAD_N}\`expr \\\`echo $RANDOM\\\` % \\\`echo \"$CORREDOR_MANTRAS\" | wc -l\\\` + 1\` | tail -${TAIL_N}1`" - -INFO_STATEMENT="Corredor is a tool for software automation and testing. - For updates, visit http://corredor.sf.net - -$CORREDOR_MANTRA -" # end INFO_STATEMENT - -USAGE_STATEMENT="Usage: $CORREDOR [automation-options] command [command-options] - where automation-options are -w, -s, etc. - (specify --help-options for a list of options) - where command is start, stop, status, etc. - (specify --help-commands for a list of commands) - where command-options is any command specific option - (specify -h [command] for help on a particular command) -" # end USAGE_STATEMENT - -VERSION_STATEMENT="${NAME_OF_CORREDOR} (Corredor Automation Test Suite) ${CORREDOR_VERSION} -Release ${CORREDOR_REL}, Application Programming Interface ${CORREDOR_API} - -Copyright (c) 2003-2006 by Christopher Sean Morrison -BSD style license applies, see --help for more details. - -$INFO_STATEMENT" # end VERSION_STATEMENT - -HELP_STATEMENT="$USAGE_STATEMENT -$INFO_STATEMENT" # end HELP_STATEMENT - -RESOURCE_FILE_HEADER="#!/bin/sh -# -# C O R R E D O R A U T O M A T I O N R E S O U R C E F I L E -###################################################################### -# -# The following are settings to be used in conjunction with the -# Corredor Automation Test Suite. This file may be used as either the -# start for a default automation suite resource file (RESOURCE_FILE) -# or as a template for a system definition file that would go in the -# system bucket directory (SYSTEMS_D). -# -# As few or many of the variables below may be modified to enforce -# default behaviour different from the default settings. See the -# master corredor automation script for more details on the behavior -# and meaning of each variable. -# -###################################################################### -" - - -### -# QUICK ARUGMENT HANDLING -######################### -# -# this is a time saving hack for when there are no or common basic -# arguments given. usually, these are requests for help or the -# version number. -# -# by default, no arguments means no command, which means we need to -# display help. also, if the user gave a general help option with -# nothing else, then we need to display help. if there is only one -# argument (and it is a switch), then we do not have a command and we -# need to display help unless that arg looks like a request for the -# suite version. - -if [ "x$1" = "x" ] ; then - # make sure COMMAND was not set externally - if [ "x$COMMAND" = "x" ] ; then - echo "$HELP_STATEMENT" - exit - fi -elif [ "x$2" = "x" ] ; then - case "x$1" in - # handle version - x-[vV]) DISPLAY_VERSION=yes ;; - x--[vV]) DISPLAY_VERSION=yes ;; - x--[vV][eE][rR][sS][iI][oO][nN]) DISPLAY_VERSION=yes ;; - - # handle help - x-\?) DISPLAY_HELP=yes ;; - x--\?) DISPLAY_HELP=yes ;; - x-[hH]) DISPLAY_HELP=yes ;; - x--[hH]) DISPLAY_HELP=yes ;; - x--[hH][eE][lL][pP]) DISPLAY_HELP=yes ;; - esac -fi - -if [ "x$DISPLAY_HELP" = "xyes" ] ; then - echo "$HELP_STATEMENT" - exit 0 -fi - -if [ "x$DISPLAY_VERSION" = "xyes" ] ; then - echo "$VERSION_STATEMENT" - exit 0 -fi - - -### -# INCLUDE THE UTILITY LIBRARY -############################# -# -# the almighty library file. dirname is needed/recommended so that we -# will still be able to find the automation directory regardless of -# where or how this script was invoked without needing to give a -# full-path. -# -# this will automagically include any resources the library provides -# on-demand. -# -echo "Please wait ..." 1>&2 -. "${PATH_TO_LIBRARY}" -loadAllResources - -initializeOption VERSION "$CORREDOR_VERSION" "$CORREDOR_VERSION" "Display the version of the automation suite" "v ver vers" hidden-commands - -# log loading messages to standard error -initializeVariable LOADING_LOG stderr -initializeVariable LOADING_TICK "log -n \".\" $LOADING_LOG" - -# did not find anything, so start to load the suite vars and options -log -n "Loading Corredor Automation Suite..." $LOADING_LOG - - -### -# DEFAULT PUBLIC VARIABLE INITIALIZATION -######################################## -# -# begin default settings and options. the difference: options may be -# modified via command-line arguments - -# short name of the project being automation tested -initializeVariable PACKAGE corredor -$LOADING_TICK - -# default working directory -initializeOption RUN_DIR "/tmp/`whoami`" "__ANYTHING__" "Working directory, where to perform tests" "d dir directory" -$LOADING_TICK - -# directory or file containing the source package to automation test -initializeOption PACKAGE_SRC "." "__ANYTHING__" "Directory containing files to be tested" "p source source-dir package" "start restart" -$LOADING_TICK - -# name of log file for output -initializeOption RUN_LOG ".${NAME_OF_CORREDOR}-${HOSTNAME}.log" "__ANYTHING__" "Test output log file" "l log logfile" -$LOADING_TICK - -# default system to automation test. "all" is a special keyword to -# automation test all of the systems in SYSTEMS_D. "localhost" is a -# special keyword to automation test the local system. -initializeOption RUN_SYSTEM "localhost" "__ANYTHING__" "System(s) to automation test" "s system systems" -$LOADING_TICK - -# default test(s) to run. "all" is a special keyword to run all tests -# found in TESTS_D. additionally, the tests may manually be run one -# at a time through the shell. -initializeOption RUN_TEST "all" "__ANYTHING__" "Test(s) to run" "t test tests" -$LOADING_TICK - -# fail on warnings (0/false==do not fail, 1/true==fail) -initializeOption WARNINGS "yes" "__BOOLEAN__" "Give warnings or abort fatally" "w warn warnings" -$LOADING_TICK - -# clean out the automation directory before starting -initializeOption CLOBBER "no" "__BOOLEAN__" "Remove automation directory contents before starting" "c rm remove" "start restart" -$LOADING_TICK - -# give a warning before clobbering -initializeOption CONFIRM_CLOBBER yes "__BOOLEAN__" "Confirm before removing automation directory contents" "cc confirm " "start restart" -$LOADING_TICK - -# number of minutes to wait on the automation lock. set to less than -# or equal to zero to not wait for lock if it is not acquired. -initializeOption WAIT_FOR_LOCK_TIMEOUT 3 "__NUMBER__" "Minutes to wait for cooperative directory locks" "m minutes timeout lock-timeout wait-timeout" -$LOADING_TICK - -# transport is the mechanism that gets a file from the localhost to -# remote machines; available options are ttcp, scp, rcp -initializeVariable TRANSPORT "scp" -$LOADING_TICK - -### -# SYSTEM VARIABLE INITIALIZATIONS -################################# -# -# these variables are the same as those above except that the user -# should never really have to worry about their setting or have to -# change the default values except to modify the suite to run with -# other packages. - -# name of systems directory (full path) -initializeVariable SYSTEMS_D "${PSD}/SystemBucket" omit -$LOADING_TICK - -# name of tests directory (full path) -initializeVariable TESTS_D "${PSD}/TestBucket" omit -$LOADING_TICK - -# name of the self-test test directory -initializeVariable SELF_TESTS_D "${PSD}/Resources/SelfTestBucket" omit -$LOADING_TICK - -# resource file will override any default public or system settings -initializeVariable RESOURCE_FILE "${HOME}/.${NAME_OF_CORREDOR}rc" omit -$LOADING_TICK - -# -# the commands option group holds a list of valid automation -# commands. the HELP_${command} variable holds a descriptive help -# message pertinent to that command. options for any particular -# command are designated in option initializations below using a group -# name that is the same as the command name (e.g. -C clobber option is -# in "start" option group) -# -initializeOption START "" "__BOOLEAN__" "Start the automation testing" "" commands -$LOADING_TICK - -initializeVariable START_HELP "The start command is what will invoke the automation suite testing. After validating any automation and command options, the existance of the source archive is ensured on each of the systems being used. Then each of the systems will commence testing the source by running the requested automation scripts from the test directory on each host." help -$LOADING_TICK - -initializeOption STOP "" "__BOOLEAN__" "Stop the automation testing" "" commands -$LOADING_TICK - -initializeVariable STOP_HELP "This command will halt any specified systems that are presently in the process of running the automation suite. Depending on the nature of what the running machine is doing at the time and whether the machine is remote, or not, all test processes will be halted as soon as possible." help -$LOADING_TICK - -initializeOption RESTART "" "__BOOLEAN__" "Restart (stop/start) the automation testing" "" commands -$LOADING_TICK - -initializeVariable RESTART_HELP "This command will restart automation suite testing for any systems specified. Restarting the suite consists of stopping any hosts that are presently running any tests, and then commencing the automation suite testing for each host regardless of whether they were running prior to the stop or not." help -$LOADING_TICK - -initializeOption STATUS "" "__BOOLEAN__" "Get status of the automation testing" "" commands -$LOADING_TICK - -initializeVariable STATUS_HELP "This command will return a automation suite status as to whether a certain host has not run the test, is presently running the test, has completed the test and failed, or has completed the test and passed. Optionally, the results from the test may be displayed using terminal \"colorized\" ansi output, text output, and/or results may be sent out via e-mail." help -$LOADING_TICK - -initializeOption SETTINGS "" "__BOOLEAN__" "Display current project settings" "" commands -$LOADING_TICK - -initializeVariable SETTINGS_HELP "This command is useful in generating a default resource file (i.e. a default $RESOURCE_FILE file) that may be used for future automation test runs or for debugging. Corredor will output a settings file to standard output, which may be saved to a file: ${CORREDOR} > ~/.${NAME_OF_CORREDOR}rc" help -$LOADING_TICK - -initializeOption LIBRARY "" "__BOOLEAN__" "Output available function and variable definitions" "" commands -$LOADING_TICK - -initializeVariable LIBRARY_HELP "This command may be used by POSIX shell script-based test scripts to get library functions and variable declarations of general utility. Read the $NAME_OF_CORREDOR source code for more details and information on creating new tests as well as details on utilizing the resource library." help -$LOADING_TICK - -initializeOption BENCHMARK "" "__BOOLEAN__" "Compute statisitical benchmark analysis of shell performance" "" commands -$LOADING_TICK - -initializeVariable BENCHMARK_HELP "This command may be used to compute a performance metric for a given system. The benchmark analysis will compute several iterations of intensive environment testing that will in turn provide informative metrics of how quickly a system is presently able to perform." help -$LOADING_TICK - -initializeOption SELF_TEST "" "__BOOLEAN__" "Run the automation suite self-validation tests" "selftest" commands -$LOADING_TICK - -initializeVariable SELF_TEST_HELP "This command may be used to perform a self-test validation of the automation suite operability." help -$LOADING_TICK - -initializeOption HELP_OPTIONS "" "__BOOLEAN__" "Help with ... [truncated message content] |
From: <br...@us...> - 2006-09-22 10:22:24
|
Revision: 5 http://svn.sourceforge.net/corredor/?rev=5&view=rev Author: brlcad Date: 2006-09-22 03:22:19 -0700 (Fri, 22 Sep 2006) Log Message: ----------- minor rewording of library help Modified Paths: -------------- corredor/trunk/corredor Modified: corredor/trunk/corredor =================================================================== --- corredor/trunk/corredor 2006-09-22 10:06:59 UTC (rev 4) +++ corredor/trunk/corredor 2006-09-22 10:22:19 UTC (rev 5) @@ -376,7 +376,7 @@ initializeOption LIBRARY "" "__BOOLEAN__" "Output available function and variable definitions" "" commands $LOADING_TICK -initializeVariable LIBRARY_HELP "This command may be used by bourne-shell-based test scripts to provide library function and variable facilities. Read the automation script's sourcecode for more details and information on creating new tests and utilizing the resource library." help +initializeVariable LIBRARY_HELP "This command may be used by POSIX shell script-based test scripts to get library functions and variable declarations of general utility. Read the $NAME_OF_CORREDOR source code for more details and information on creating new tests as well as details on utilizing the resource library." help $LOADING_TICK initializeOption BENCHMARK "" "__BOOLEAN__" "Compute statisitical benchmark analysis of shell performance" "" commands This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2006-09-22 10:07:12
|
Revision: 4 http://svn.sourceforge.net/corredor/?rev=4&view=rev Author: brlcad Date: 2006-09-22 03:06:59 -0700 (Fri, 22 Sep 2006) Log Message: ----------- add support for printing various corredor automation and testing mantras randomly. the rcHeader.txt was moved back into the main script instead of as an outboard resource file. clean up the formatting while we're at it to M-q (70) Modified Paths: -------------- corredor/trunk/Resources/Source/Transport/Transport/SSH/SSH corredor/trunk/Resources/library corredor/trunk/corredor Removed Paths: ------------- corredor/trunk/Resources/rcHeader.txt Modified: corredor/trunk/Resources/Source/Transport/Transport/SSH/SSH =================================================================== --- corredor/trunk/Resources/Source/Transport/Transport/SSH/SSH 2006-09-19 17:38:11 UTC (rev 3) +++ corredor/trunk/Resources/Source/Transport/Transport/SSH/SSH 2006-09-22 10:06:59 UTC (rev 4) @@ -89,7 +89,7 @@ # to the localhost. # isLocalhost ( ) { - [ ! "x$DEBUG" = x ] && log "isLocalhost( \$1=[${1} ) " + [ ! "x$DEBUG" = x ] && log "isLocalhost( \$1=[${1}] ) " if [ ! "x$1" = "x" ] ; then __HOST="$1" Modified: corredor/trunk/Resources/library =================================================================== --- corredor/trunk/Resources/library 2006-09-19 17:38:11 UTC (rev 3) +++ corredor/trunk/Resources/library 2006-09-22 10:06:59 UTC (rev 4) @@ -744,4 +744,4 @@ ;; esac -# lock and load, boys.. we are done here. +# lock and load.. we are done here. Deleted: corredor/trunk/Resources/rcHeader.txt =================================================================== --- corredor/trunk/Resources/rcHeader.txt 2006-09-19 17:38:11 UTC (rev 3) +++ corredor/trunk/Resources/rcHeader.txt 2006-09-22 10:06:59 UTC (rev 4) @@ -1,16 +0,0 @@ -# -# C O R R E D O R R E S O U R C E F I L E -###################################################################### -# -# The following are settings to be used in conjunction with the -# Corredor automation test suite. This file may be used as either the -# start for a default automation suite resource file (RESOURCE_FILE) -# or as a template for a system definition file that would go in the -# system bucket directory (SYSTEMS_D). -# -# As few or many of the variables below may be modified to enforce -# default behaviour different from the default settings. See the -# master corredor automation script for more details on the behavior -# and meaning of each variable. -# -###################################################################### Modified: corredor/trunk/corredor =================================================================== --- corredor/trunk/corredor 2006-09-19 17:38:11 UTC (rev 3) +++ corredor/trunk/corredor 2006-09-22 10:06:59 UTC (rev 4) @@ -34,13 +34,13 @@ # ### # -# Corredor Automation & Testing Suite +# Corredor Automation Test Suite # # Corredor is a robust and general framework for performing automated -# execution of tasks with a particular emphasis on software testing. -# With a POSIX-compliant shell, Corredor makes it easier to set up, -# maintain, and run scripts, supporting symmetric, simultaneous, and -# distributed exectution. +# execution of tasks with a particular emphasis tasks related to +# software testing. With a POSIX-compliant shell, Corredor makes it +# easier to set up, maintain, and run scripts, supporting symmetric, +# simultaneous, and distributed exectution. # # Author: # Christopher Sean Morrison @@ -50,9 +50,7 @@ # echo "use nl for line numbering..." -# # keep track of how we were invoked in case dollar-zero is reused - ARGUMENTS="$*" PATH_TO_CORREDOR="`dirname $0`" NAME_OF_CORREDOR="`basename $0`" @@ -71,17 +69,18 @@ fi # -# this is a time saving hack for when we are running in library mode. we -# bypass option & environment initialization as well as command-line parsing -# since they are not significant to the library command. also noteworthy, -# the actual loading of the library file itself is bypassed. +# this is a time saving hack for when we are running in library mode. +# we bypass option & environment initialization as well as +# command-line parsing since they are not significant to the library +# command. also noteworthy, the actual loading of the library file +# itself is bypassed. # if [ "x$1" = "xlibrary" ] ; then # necessary setting for non-posix-compliant /bin/sh shells # (for proper $0 expansion, etc, on SGIs) _XPG=1 - sh "${PATH_TO_LIBRARY}" $@ + echo sh "${PATH_TO_LIBRARY}" $@ exit $? elif [ "x$1" = "xself-test" ] ; then @@ -92,7 +91,27 @@ # XXX necessary? should be in plugin? (probably) LC_ALL=C +# commands that are required for basic functionality +for __cmd in echo head tail wc basename dirname ; do + echo "test" | $__cmd "test" > /dev/null 2>&1 + if [ $? = 127 ] ; then + echo "INTERNAL ERROR: '${__cmd}' command is required" + exit 2 + fi +done +# determine the behavior of head +case "x`echo 'head' | head -n 1 2>&1`" in + *xhead*) HEAD_N="n " ;; + *) HEAD_N="" ;; +esac + +# determine the behavior of tail +case "x`echo 'tail' | tail -n 1 2>&1`" in + *xtail*) TAIL_N="n " ;; + *) TAIL_N="" ;; +esac + ### # CORREDOR IDENTIFICATION ######################### @@ -102,11 +121,25 @@ CORREDOR_MON=2006.10 CORREDOR_VERSION="${CORREDOR_API}.${CORREDOR_REL}.${CORREDOR_MON}" -INFO_STATEMENT="Corredor is a tool for software automation. +CORREDOR_MANTRAS="Smart code just works. +Helping intelligent coders create intelligent code since 2003. +Test early, test often. +Automation, now with more flair. +Test, test, test. And then test some more. +The runner awaits. +El corredor aguarda. +O corredor espera." + +# pick a random mantra from the list +CORREDOR_MANTRA="`echo \"$CORREDOR_MANTRAS\" | head -${HEAD_N}\`expr \\\`echo $RANDOM\\\` % \\\`echo \"$CORREDOR_MANTRAS\" | wc -l\\\` + 1\` | tail -${TAIL_N}1`" + +INFO_STATEMENT="Corredor is a tool for software automation and testing. For updates, visit http://corredor.sf.net + +$CORREDOR_MANTRA " # end INFO_STATEMENT -USAGE_STATEMENT="Usage: $0 [automation-options] command [command-options] +USAGE_STATEMENT="Usage: $CORREDOR [automation-options] command [command-options] where automation-options are -w, -s, etc. (specify --help-options for a list of options) where command is start, stop, status, etc. @@ -115,7 +148,7 @@ (specify -h [command] for help on a particular command) " # end USAGE_STATEMENT -VERSION_STATEMENT="${NAME_OF_CORREDOR} (Corredor Automation & Testing Suite) ${CORREDOR_VERSION} +VERSION_STATEMENT="${NAME_OF_CORREDOR} (Corredor Automation Test Suite) ${CORREDOR_VERSION} Release ${CORREDOR_REL}, Application Programming Interface ${CORREDOR_API} Copyright (c) 2003-2006 by Christopher Sean Morrison @@ -126,19 +159,40 @@ HELP_STATEMENT="$USAGE_STATEMENT $INFO_STATEMENT" # end HELP_STATEMENT +RESOURCE_FILE_HEADER="#!/bin/sh +# +# C O R R E D O R A U T O M A T I O N R E S O U R C E F I L E +###################################################################### +# +# The following are settings to be used in conjunction with the +# Corredor Automation Test Suite. This file may be used as either the +# start for a default automation suite resource file (RESOURCE_FILE) +# or as a template for a system definition file that would go in the +# system bucket directory (SYSTEMS_D). +# +# As few or many of the variables below may be modified to enforce +# default behaviour different from the default settings. See the +# master corredor automation script for more details on the behavior +# and meaning of each variable. +# +###################################################################### +" + ### # QUICK ARUGMENT HANDLING ######################### # -# this is a time saving hack for when there are no or common basic arguments -# given. usually, these are requests for help or the version number. +# this is a time saving hack for when there are no or common basic +# arguments given. usually, these are requests for help or the +# version number. # -# by default, no arguments means no command, which means we need to display -# help. also, if the user gave a general help option with nothing else, then -# we need to display help. if there is only one argument (and it is a switch), then we -# do not have a command and we need to display help unless that arg looks -# like a request for the suite version. +# by default, no arguments means no command, which means we need to +# display help. also, if the user gave a general help option with +# nothing else, then we need to display help. if there is only one +# argument (and it is a switch), then we do not have a command and we +# need to display help unless that arg looks like a request for the +# suite version. if [ "x$1" = "x" ] ; then # make sure COMMAND was not set externally @@ -172,15 +226,18 @@ exit 0 fi + ### # INCLUDE THE UTILITY LIBRARY ############################# # -# the almighty library file. dirname is needed/recommended so that we will -# still be able to find the automation directory regardless of where or how -# this script was invoked without needing to give a full-path. +# the almighty library file. dirname is needed/recommended so that we +# will still be able to find the automation directory regardless of +# where or how this script was invoked without needing to give a +# full-path. # -# this will automagically include any resources the library provides on-demand. +# this will automagically include any resources the library provides +# on-demand. # echo "Please wait ..." 1>&2 . "${PATH_TO_LIBRARY}" @@ -192,16 +249,16 @@ initializeVariable LOADING_LOG stderr initializeVariable LOADING_TICK "log -n \".\" $LOADING_LOG" -# we did not find anything, so we start to load the suite vars and options -log -n "Loading Automation Suite..." $LOADING_LOG +# did not find anything, so start to load the suite vars and options +log -n "Loading Corredor Automation Suite..." $LOADING_LOG ### # DEFAULT PUBLIC VARIABLE INITIALIZATION ######################################## # -# begin default settings and options. the difference: options may be modified -# via command-line arguments +# begin default settings and options. the difference: options may be +# modified via command-line arguments # short name of the project being automation tested initializeVariable PACKAGE corredor @@ -216,18 +273,18 @@ $LOADING_TICK # name of log file for output -initializeOption RUN_LOG ".automation-${HOSTNAME}.log" "__ANYTHING__" "Test output log file" "l log logfile" +initializeOption RUN_LOG ".${NAME_OF_CORREDOR}-${HOSTNAME}.log" "__ANYTHING__" "Test output log file" "l log logfile" $LOADING_TICK -# default system to automation test. "all" is a special keyword to automation -# test all of the systems in SYSTEMS_D. "localhost" is a special keyword to -# automation test the local system. +# default system to automation test. "all" is a special keyword to +# automation test all of the systems in SYSTEMS_D. "localhost" is a +# special keyword to automation test the local system. initializeOption RUN_SYSTEM "localhost" "__ANYTHING__" "System(s) to automation test" "s system systems" $LOADING_TICK -# default test(s) to run. "all" is a special keyword to run all tests found in -# TESTS_D. additionally, the tests may manually be run one at a time through -# the shell. +# default test(s) to run. "all" is a special keyword to run all tests +# found in TESTS_D. additionally, the tests may manually be run one +# at a time through the shell. initializeOption RUN_TEST "all" "__ANYTHING__" "Test(s) to run" "t test tests" $LOADING_TICK @@ -243,13 +300,13 @@ initializeOption CONFIRM_CLOBBER yes "__BOOLEAN__" "Confirm before removing automation directory contents" "cc confirm " "start restart" $LOADING_TICK -# number of minutes to wait on the automation lock. set to less than or equal -# to zero to not wait for lock if it is not acquired. +# number of minutes to wait on the automation lock. set to less than +# or equal to zero to not wait for lock if it is not acquired. initializeOption WAIT_FOR_LOCK_TIMEOUT 3 "__NUMBER__" "Minutes to wait for cooperative directory locks" "m minutes timeout lock-timeout wait-timeout" $LOADING_TICK -# transport is the mechanism that gets a file from the localhost to remote -# machines; available options are ttcp, scp, rcp +# transport is the mechanism that gets a file from the localhost to +# remote machines; available options are ttcp, scp, rcp initializeVariable TRANSPORT "scp" $LOADING_TICK @@ -257,9 +314,10 @@ # SYSTEM VARIABLE INITIALIZATIONS ################################# # -# these variables are the same as those above except that the user should never -# really have to worry about their setting or have to change the default values -# except to modify the suite to run with other packages. +# these variables are the same as those above except that the user +# should never really have to worry about their setting or have to +# change the default values except to modify the suite to run with +# other packages. # name of systems directory (full path) initializeVariable SYSTEMS_D "${PSD}/SystemBucket" omit @@ -273,16 +331,17 @@ initializeVariable SELF_TESTS_D "${PSD}/Resources/SelfTestBucket" omit $LOADING_TICK -# the resource file will override any of the default public or system settings -initializeVariable RESOURCE_FILE "${HOME}/.automationrc" omit +# resource file will override any default public or system settings +initializeVariable RESOURCE_FILE "${HOME}/.${NAME_OF_CORREDOR}rc" omit $LOADING_TICK # -# the commands option group holds a list of valid automation commands. the -# HELP_${command} variable holds a descriptive help message pertinent to that -# command. options for any particular command are designated in option -# initializations below using a group name that is the same as the command name -# (e.g. -C clobber option is in "start" option group) +# the commands option group holds a list of valid automation +# commands. the HELP_${command} variable holds a descriptive help +# message pertinent to that command. options for any particular +# command are designated in option initializations below using a group +# name that is the same as the command name (e.g. -C clobber option is +# in "start" option group) # initializeOption START "" "__BOOLEAN__" "Start the automation testing" "" commands $LOADING_TICK @@ -311,7 +370,7 @@ initializeOption SETTINGS "" "__BOOLEAN__" "Display current project settings" "" commands $LOADING_TICK -initializeVariable SETTINGS_HELP "This command is useful in generating a default resource file (i.e. a default $RESOURCE_FILE file) that may be used for future automation test runs or for debugging." help +initializeVariable SETTINGS_HELP "This command is useful in generating a default resource file (i.e. a default $RESOURCE_FILE file) that may be used for future automation test runs or for debugging. Corredor will output a settings file to standard output, which may be saved to a file: ${CORREDOR} > ~/.${NAME_OF_CORREDOR}rc" help $LOADING_TICK initializeOption LIBRARY "" "__BOOLEAN__" "Output available function and variable definitions" "" commands @@ -323,7 +382,7 @@ initializeOption BENCHMARK "" "__BOOLEAN__" "Compute statisitical benchmark analysis of shell performance" "" commands $LOADING_TICK -initializeVariable BENCHMARK_HELP "This command may be used to give a performance benchmark for a particular platform. The benchmark is based around timing how many iterations of known functionality are completed in a static amount of time. As with all benchmarks, take and use the benchmark results with a grain of salt." help +initializeVariable BENCHMARK_HELP "This command may be used to compute a performance metric for a given system. The benchmark analysis will compute several iterations of intensive environment testing that will in turn provide informative metrics of how quickly a system is presently able to perform." help $LOADING_TICK initializeOption SELF_TEST "" "__BOOLEAN__" "Run the automation suite self-validation tests" "selftest" commands @@ -359,23 +418,25 @@ # LOAD RESOURCE FILE #################### # -# a resource file will override any of the above settings, as it will contain -# the last settings prior to execution or processing of options. hence, the -# priority of variable settings is 4th) intrinsic default values, 3rd) -# environment variables, 2nd) resource file values, 1st) command-line arguments -# (1 is highest precedence, 4 is lowest). +# a resource file will override any of the above settings, as it will +# contain the last settings prior to execution or processing of +# options. hence, the priority of variable settings is 4th) intrinsic +# default values, 3rd) environment variables, 2nd) resource file +# values, 1st) command-line arguments (1 is highest precedence, 4 is +# lowest). # -# the command-line arguments and, potentially, the resource file settings may -# be bypassed by setting the environment variable BYPASS_SETTINGS to non-null. +# the command-line arguments and, potentially, the resource file +# settings may be bypassed by setting the environment variable +# BYPASS_SETTINGS to non-null. # -# the only "almost a caveat" clause to the ordering is that you cannot use -# BYPASS_SETTINGS to bypass the resource file using a command-line switch -# (hence there is no such --bypass-settings option). +# the only "almost a caveat" clause to the ordering is that you cannot +# use BYPASS_SETTINGS to bypass the resource file using a command-line +# switch (hence there is no such --bypass-settings option). # # delay reporting a "bypassed" message until done with initialization # -# XXX possible feature could be to allow a resource file in the current directory -# as well as searching for one in $HOME +# XXX possible feature could be to allow a resource file in the +# current directory as well as searching for one in $HOME # [ "x$BYPASS_SETTINGS" = "x" ] && [ -r "$RESOURCE_FILE" ] && loadResourceFile "$RESOURCE_FILE" $LOADING_TICK @@ -384,13 +445,15 @@ # HANDLE COMMAND-LINE ARGUMENTS ############################### # -# handle command-line arguments that were given to set automation options. -# there is a little default processing that occurs up above to handle some -# special cases such as simple help and version. the rest of the processing -# occurs here for any initialized options available. +# handle command-line arguments that were given to set automation +# options. there is a little default processing that occurs up above +# to handle some special cases such as simple help and version. the +# rest of the processing occurs here for any initialized options +# available. # -# save current command values to recognize changed values during arg handling +# save current command values to recognize changed values during +# argument handling # initializeVariable PRE_CMDS "" omit $LOADING_TICK @@ -406,7 +469,8 @@ # iterate over arguments # for argument in $ARGUMENTS ; do - # add the command once it is set to force checking in proper category + + # add command once set to force checking in proper category handleArgument "$1" "$2" $COMMAND handled="$?" @@ -419,9 +483,10 @@ log "$HELP_STATEMENT" exit fi - - # if command is set, we want to check if it's value has changed from - # the original value. if it has *changed*, we have an active command. + + # if command is set, we want to check if the value has changed + # from the original value. if it has *changed*, we have an + # active command. if [ "x$COMMAND" = "x" ] ; then # regenerate the command value list @@ -431,8 +496,8 @@ postcmds="$postcmds `eval $cmdvalue`" done - # if one of the commands changed, it should be the variable for the - # current switch + # if one of the commands changed, it should be the + # variable for the current switch if [ ! "x$postcmds" = "x$PRE_CMDS" ] ; then handleArgument COMMAND "`getOptionVariable $1`" omit [ $? -ne 2 ] && log "COULD NOT SET COMMAND" @@ -467,6 +532,7 @@ fi # make sure command's case is consistent COMMAND="`echo $COMMAND | tr [:lower:]- [:upper:]_`" +LC_COMMAND="`echo $COMMAND | tr [:upper:]_ [:lower:]-`" VALID_CMD="no" for cmd in $ALL_CMDS ; do if [ "x$cmd" = "x$COMMAND" ] || [ "x`echo $cmd | tr [:lower:]- [:upper:]_`" ] ; then @@ -484,10 +550,11 @@ # HANDLE SIMPLE COMMANDS ######################## # -# process commands that do not require any settings to be validated, are -# guaranteed to not be remote, and do not require any resources or functions -# defined outside of the core library (like the testing-specific calls). for -# any other command, we need to load libraries and validate settings. +# process commands that do not require any settings to be validated, +# are guaranteed to not be remote, and do not require any resources or +# functions defined outside of the core library (like the +# testing-specific calls). for any other command, we need to load +# libraries and validate settings. # # "help" command @@ -525,7 +592,7 @@ if [ "x$dispOptHead" = "xno" ] ; then log "Options:\n" firstSwitch="`echo $switches | awk '{print $1}'`" - plog "Options may be specified 1) via an environment variable, 2) through a .automationrc file in user's home directory (see settings command), or 3) as a command-line argument to the automation suite using a valid switch (e.g. $0 $lchelpvalue --${firstSwitch}=\"$optval\" sets $option to \"$optval\")." "$LOG" 80 " " + plog "Options may be specified 1) via an environment variable, 2) through a .${NAME_OF_CORREDOR}rc file in user's home directory (see settings command), or 3) as a command-line argument to the automation suite using a valid switch (e.g. $CORREDOR $lchelpvalue --${firstSwitch}=\"$optval\" sets $option to \"$optval\")." "$LOG" 80 " " log "" dispOptHead=yes fi @@ -601,7 +668,7 @@ for i in $LC_COMMANDS ; do log " $i \t`getOptionDescription $i`" done - log "\nSpecify -h [command] for more detailed help on a particular command\n (e.g. $0 -h start)\n" + log "\nSpecify -h [command] for more detailed help on a particular command\n (e.g. $CORREDOR -h start)\n" log "$INFO_STATEMENT" exit @@ -616,7 +683,7 @@ logfile=stdout # output header - log "`cat ${PSD}/Resources/rcHeader.txt`" $logfile + log "$RESOURCE_FILE_HEADER" $logfile # output body for __RV in $RC_VARS ; do @@ -632,20 +699,11 @@ exit # -# "version" command +# "library" command -- we should only arrive at this point if other +# command line arguments were given. you cannot do anything but +# output source since the library command SHOULD HAVE NO OPTIONS +# (ever) # -elif [ "x$COMMAND" = "xVERSION" ] ; then - - log "$VERSION_STATEMENT" - log " (script library version $LIBRARY_VERSION)\n" - log "$INFO_STATEMENT" - exit - -# -# "library" command -- we should only arrive at this point if other command -# line arguments were given. you cannot do anything but output source since -# the library command SHOULD HAVE NO OPTIONS (ever) -# elif [ "x$COMMAND" = "xLIBRARY" ] ; then . "${PATH_TO_LIBRARY}" source exit @@ -659,9 +717,10 @@ log "C O R R E D O R B E N C H M A R K" log "===================================" - # capture how long it takes to source the library -- we want at least - # three times that for a time frame (this is needed for slow machines - # that require more than the default timeframe to simply load one!) + # capture how long it takes to source the library -- we want at + # least three times that for a time frame (this is needed for slow + # machines that require more than the default timeframe to simply + # load one!) TIME="`date | awk '{print $4}'`" HOUR="`echo $TIME | cut -d':' -f1`" MIN="`echo $TIME | cut -d':' -f2`" @@ -740,35 +799,39 @@ exit # -# "self-test" run -- only run the self-test tests. this effectively means -# (on purpose) that you can't run the self-test and other tests at the same -# time without making a specific automation test that invokes a localhost -# self-test itself. +# "self-test" run -- only run the self-test tests. this effectively +# means (on purpose) that you can't run the self-test and other tests +# at the same time without making a specific automation test that +# invokes a localhost self-test itself. # -# part of the reasoning for this limitation is that the self-test is not -# meant to be used in a production environment -- only during setup/install. -# why? because no guarantees or expectations should be made regarding the -# self-test tests, layout, and execution mechanisms. (as opposed to the -# library facilities which should remain backwards-compatible with minor -# releases) the self-test is a volatile developer function. +# part of the reasoning for this limitation is that the self-test is +# not meant to be used in a production environment -- only during +# setup/install. why? because no guarantees or expectations should +# be made regarding the self-test tests, layout, and execution +# mechanisms. (as opposed to the library facilities which should +# remain backwards-compatible with minor releases) the self-test is a +# volatile developer function. # -# on the other hand, you should be able to execute the self-tests on remote -# systems using various transports just like any other test bucket set. +# on the other hand, you should be able to execute the self-tests on +# remote systems using various transports just like any other test +# bucket set. # elif [ "x$COMMAND" = "xSELF_TEST" ] ; then # make the work directory the location of this automation script. - # this implies that self-test tests should not clobber anything that - # existed beforehand. + # this implies that self-test tests should not clobber anything + # that existed beforehand. RUN_DIR="${PSD}" PACKAGE_SRC="${PSD}" TESTS_D="$SELF_TESTS_D" RUN_TEST="all" - COMMAND=start + COMMAND=START + LC_COMMAND=start - # instead of reinvoking here, just let it fall through to be processed. - # this is not only faster, but a more clean test environment. + # instead of reinvoking here, just let it fall through to be + # processed. this is not only faster, but a more clean test + # environment. # $PATH_TO_CORREDOR # exit fi @@ -782,7 +845,7 @@ # # -# warn if the RESOURCE_FILE was there but not readable when loaded earlier +# warn if RESOURCE_FILE was there but not readable when loaded earlier # [ -f "$RESOURCE_FILE" ] && [ ! -r "$RESOURCE_FILE" ] && warn "Resource file [RESOURCE_FILE=$RESOURCE_FILE] is NOT readable" @@ -794,18 +857,19 @@ fi # -# check our automation directory settings for useability. sanity check -- -# make sure someone didn't request "". it is not a good idea to use "." -# either, since tests may clobber contents, but alas we do not check. we -# specifically do not check for read-write permissions until later (when -# we need to). +# check our automation directory settings for useability. sanity +# check -- make sure someone didn't request "". it is not a good idea +# to use "." either, since tests may clobber contents, but alas we do +# not check. we specifically do not check for read-write permissions +# until later (when we need to). # [ "x$RUN_DIR" = "x" ] && bomb "Must specify automation directory [RUN_DIR=""]\n Use -`getOptionSwitches RUN_DIR | awk '{print $1}'` switch" # -# make sure the SYSTEMS_D and TESTS_D directories exist, that we can get a -# listing (read), and that we can access and query contents (exec). each -# level is checked individually for more exact warning output. +# make sure the SYSTEMS_D and TESTS_D directories exist, that we can +# get a listing (read), and that we can access and query contents +# (exec). each level is checked individually for more exact warning +# output. # if [ ! -d "$SYSTEMS_D" ] ; then warn "Systems directory [SYSTEMS_D=$SYSTEMS_D] does not exist" @@ -838,23 +902,23 @@ if [ "x$RUN_TEST" = "xall" ] ; then RUN_TEST="" for TST in `ls -A $TESTS_D` __justInCase__ ; do -log "TST=$TST" - # all directories in the test bucket directory that have a test + # all directories in test bucket directory that have a test [ -r "${TESTS_D}/${TST}/${TST}" ] && RUN_TEST="$RUN_TEST $TST" done fi # -# make sure there is something left to do (i.e. that there is at least one test -# that may be run on some system, or that we are self-testing) +# make sure there is something left to do (i.e. that there is at least +# one test that may be run on some system, or that we are +# self-testing) # [ "x$RUN_SYSTEM" = "x" ] && bomb "No systems are specified [RUN_SYSTEM=$RUN_SYSTEM]. Use -`getOptionSwitches RUN_SYSTEM | awk '{print $1}'` switch" [ "x$RUN_TEST" = "x" ] && bomb "No tests are specified [RUN_TEST=$RUN_TEST]. Use -`getOptionSwitches RUN_TEST | awk '{print $1}'` switch" # -# convert boolean option to simple yes/no values here (just for simplicity so -# that later on we only have to check for yes/no values) +# convert boolean option to simple yes/no values here (just for +# simplicity so that later on we only have to check for yes/no values) # variableIsTrue WARNINGS && WARNINGS=yes || WARNINGS=no @@ -864,13 +928,13 @@ # DONE CONFIGURATION #################### # -# now that we are done setting up and getting proper values, we need to -# determine how to proceed with running the tests. the basic idea is that -# if we are local and RUN_DIR is the same directory as PACKAGE_DIR, then -# we may begin actually running the tests. otherwise, we work on getting -# the suite into that kind of situation (i.e. send files to remote machines, -# copy the source directory to the run directory, reinvoke test as a -# localhost run). +# now that we are done setting up and getting proper values, we need +# to determine how to proceed with running the tests. the basic idea +# is that if we are local and RUN_DIR is the same directory as +# PACKAGE_DIR, then we may begin actually running the tests. +# otherwise, we work on getting the suite into that kind of situation +# (i.e. send files to remote machines, copy the source directory to +# the run directory, reinvoke test as a localhost run). # DEBUG=yes @@ -881,7 +945,7 @@ log "\tPACKAGE_SRC=$PACKAGE_SRC" log "\tTESTS_D=$TESTS_D" log "\tSYSTEMS_D=$SYSTEMS_D" - log "\tCOMMAND=$COMMAND" + log "\tCOMMAND=$LC_COMMAND" log "Tests:\n\t$RUN_TEST" log "PSD: $PSD" log "PWD: $PWD" @@ -925,17 +989,17 @@ if [ "x$COMMAND" = "xSTART" ] ; then # - # convert boolean options to simple yes/no values here (just for - # simplicity so that later on we only have to check for yes/no - # values). + # convert boolean options to simple yes/no values here + # (just for simplicity so that later on we only have to + # check for yes/no values). # variableIsTrue CLOBBER && CLOBBER=yes || CLOBBER=no variableIsTrue CONFIRM_CLOBBER && CONFIRM_CLOBBER=yes || CONFIRM_CLOBBER=no # - # prep and validate the automation directory just in case we need - # to use it early. make sure it exists, is a directory, and that - # it is read/writeable. + # prep and validate the automation directory just in case + # we need to use it early. make sure it exists, is a + # directory, and that it is read/writeable. # # check if run_dir is actually a directory @@ -947,8 +1011,8 @@ if [ -f "$RUN_DIR" ] ; then warn "There is something that is not a directory at [$RUN_DIR]" - # if clobbering is turned on and there is something in the way, - # try to blow it away. + # if clobbering is turned on and there is + # something in the way, try to blow it away. if [ "x$CLOBBER" = "xyes" ] ; then answer=yes if [ ! "x$CONFIRM_CLOBBER" = "xno" ] ; then @@ -978,11 +1042,11 @@ warn "Unable to make directory [$RUN_DIR]" fi - # stop now if we still do not have a directory to work with + # stop now if still do not have directory to work with [ ! -d "$RUN_DIR" ] && bomb "Directory does not exist [$RUN_DIR]" - # make a note that this is a new directory so we do not bother - # tring to clobber it later + # make a note that this is a new directory so we do + # not bother tring to clobber it later fresh_run_dir=yes fi # end check if run_dir is actually a directory @@ -1053,15 +1117,15 @@ # PACKAGE_SRC should now be a valid directory as expected # - # !!! need to check for inclusion of a directory so that we do not - # inadvertantly delete the package + # !!! need to check for inclusion of a directory so that + # we do not inadvertantly delete the package if `directoryContainsDirectory "$RUN_DIR" "$PACKAGE_SRC"` ; then # if [ ! "x$RUN_DIR_INODE" = "x$PACKAGE_SRC_INODE" ] ; then # - # clean out the contents at the automation directory location - # (except any special log files, ".", and "..", etc) unless we just - # made this directory. + # clean out the contents at the automation directory + # location (except any special log files, ".", and + # "..", etc) unless we just # made this directory. # if [ ! "x$fresh_run_dir" = "xyes" ] ; then if [ "x$CLOBBER" = "xyes" ] ; then @@ -1096,12 +1160,14 @@ # !!! next copy the package_src into the run_dir # - # the automation directory should now be completely ready for use + # the automation directory should now be completely ready + # for use # - # link or copy the source into the automation directory if we didn't unarchive there. - # this is only significant for sources that are not archived initially since we unpack - # into the automation directory + # link or copy the source into the automation directory if + # we didn't unarchive there. this is only significant for + # sources that are not archived initially since we unpack + # into the automation directory # # XXX need to add linking log "Copying $PACKAGE_SRC TO $RUN_DIR" @@ -1109,14 +1175,14 @@ [ $? != 0 ] && bomb "Unable to copy source directory contents to automation directory" # - # put the tests in place. the tests should be able to assume there relative location - # to the source dir + # put the tests in place. the tests should be able to + # assume there relative location to the source dir # echo rm -rf "${RUN_DIR}/__automation" echo cp -R "$PSD" "${RUN_DIR}/__automation" TEST_DIR_NAME="`basename $TESTS_D`" - echo mkdir "{$RUN_DIR}/${TEST_DIR_NAME}" - echo cp -R "$TESTS_D" "{$RUN_DIR}/${TEST_DIR_NAME}" + echo mkdir "${RUN_DIR}/${TEST_DIR_NAME}" + echo cp -R "$TESTS_D" "${RUN_DIR}/${TEST_DIR_NAME}" echo ls -la $RUN_DIR/__automation @@ -1156,7 +1222,7 @@ # END ##### -log "OK Done $0" +log "OK Done $CORREDOR" exit 0 # Local Variables: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2006-09-19 17:39:02
|
Revision: 3 http://svn.sourceforge.net/corredor/?rev=3&view=rev Author: brlcad Date: 2006-09-19 10:38:11 -0700 (Tue, 19 Sep 2006) Log Message: ----------- updated documentation including a stubbed BUGS file, details on getting involved, a rough sketch of plans, as well as a brief guide on installing Modified Paths: -------------- corredor/trunk/README Added Paths: ----------- corredor/trunk/BUGS corredor/trunk/HACKING corredor/trunk/INSTALL corredor/trunk/TODO Added: corredor/trunk/BUGS =================================================================== --- corredor/trunk/BUGS (rev 0) +++ corredor/trunk/BUGS 2006-09-19 17:38:11 UTC (rev 3) @@ -0,0 +1,25 @@ +Corredor Bugs +============= + +Bugs should be reported to the bug tracker on the project website at +http://sourceforge.net/tracker/?atid=640802&group_id=102847 + +The bugs and issues listed in here may or may not be the same as or +related to the bugs reported to the bug tracker. In general, users +should not look to this file for information regarding the status of +bugs. Informal bug-related information that is intended for +developers will generally be found here. This may include short term +issues that are in active development as well as long term and +on-going issues. + +Recent Bugs +----------- + +* none known yet, no formal release + + +--- +Bugs should be reported to the bug tracker on the project website at +http://sourceforge.net/tracker/?atid=640802&group_id=102847 + +BUGS should be formatted to column 70 (M-q in emacs), no tabs. Property changes on: corredor/trunk/BUGS ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/HACKING =================================================================== --- corredor/trunk/HACKING (rev 0) +++ corredor/trunk/HACKING 2006-09-19 17:38:11 UTC (rev 3) @@ -0,0 +1,84 @@ +The Hackers Guide to Corredor +============================= + +Please read this document if you are planning on contributing to +Corredor. + +Corredor is a relatively straight-forward project that is easily +extended by the user community. Corredor is comprised of three main +components. There is the primary driver application script +(i.e. "corredor"), a library loader (i.e. Resources/library), and +modules like the test bucket directories and the modular functionality +of Corredor itself (i.e. Resources/Source). Individuals looking to +extend Corredor's functionality will likely be looking at the last of +those three -- modules. + + +TABLE OF CONTENTS +----------------- + Introduction + Table of Contents + Communicating + How to Contribute + Coding Style & Standards + + +COMMUNICATING +------------- + +As there are many ways to get started with Corredor, one of the most +important steps for new contributors to do is get involved in the +discussions and communicate with the Corredor developers. There are +mailing lists, on-line forums, and an IRC channel available for +Corredor development and project communication. All contributors are +encouraged to participate in any of the available communication +channels: + +* Internet Relay Chat + + The primary and generally preferred mechanism for interactive + developer discussions is via Internet Relay Chat (IRC). Several of + the core developers and core contributors of Corredor hang out in + #brlcad on the Freenode network, a channel that is currently shared + with the BRL-CAD project. With most any IRC client, you should be + able to join #brlcad on irc.freenode.net, port 6667. See + http://freenode.net and http://irchelp.org for more information + +* E-mail Mailing Lists + + There are several mailing lists available for interaction, e.g. the + http://sourceforge.net/mail/?group_id=102847 "corredor-devel" mailing + list. More involved contributors may also be interested in joining + the "corredor-commits" and "corredor-tracker" mailing lists. + +* On-line Forums + + Discussion forums are available on the project site at + http://sourceforge.net/forum/?group_id=102847 for both developers + and users. Of particular interest to developers is, of course, the + "Developers" forum where all contributors are incouraged to + participate. + + +HOW TO CONTRIBUTE +----------------- + +Basically, just jump in. The project isn't complicated enough to +warrant any heavy handed procedures. Make a patch and post it +"somewhere" (ideally the sf.net patches tracker) and it will get +reviewed and probably included. If you do make a patch, unified diffs +of modified files and tarballs of new files are preferred. + +If you are really interested in becoming heavily involved in the +project, commit access can be provided. + + +CODING STYLE & STANDARDS +------------------------ + +The ONLY assumption Corredor or any of Corredor's source modules may +make is the availability of a POSIX shell environment. Anything +outside of that must be tested for (e.g. trying to use sendmail) and +remain optional. + +--- Property changes on: corredor/trunk/HACKING ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/INSTALL =================================================================== --- corredor/trunk/INSTALL (rev 0) +++ corredor/trunk/INSTALL 2006-09-19 17:38:11 UTC (rev 3) @@ -0,0 +1,109 @@ +Corredor Installation & Setup Guide +=================================== + +Installation of the Corredor Automation & Testing Suite is a fairly +straightforward process that involves installing the Corredor files +and then defining your run tests. Corredor itself requires no +compilation or preparation other than requiring that you have a POSIX +compliant shell environment. Suitable environments include Mac OS X, +the Cygwin/Mingw compatibility environment for Windows, most of the +various flavors of BSD, most of the various distributions of Linux, +and most UNIX operating systems. + +TABLE OF CONTENTS +----------------- + Introduction + Table of Contents + Quick Installation & Setup + Installation & Setup Details + Reporting Problems + + +QUICK INSTALLATION & SETUP +-------------------------- + +Since you are reading this document, it is assumed that you have +obtained the full sources of Corredor and are ready to get started +setting up Corredor to work with your project. For the impatient or +simplistic, the following should get you going fairly quickly with +minimal effort. + +1) Copy the "corredor" file and "Resources" directory into your +project sources or into a system directory. Example: + +cp -R corredor Resources /path/to/your/project + +2) Create a directory that will contain run tests for your project. +This directory will contain one file or directory per test. Example: + +mkdir /path/to/your/project/Tests + +3) Create a test. This is a simple shell script that minally contains +the commands you want to run. An example of such a script that will +build a traditional GNU Build System project that uses configure: + +cat > /path/to/your/project/Tests/Build <<EOF +#!/bin/sh +if [ ! -f configure ] ; then + if [ -f autogen.sh ] ; then + sh autogen.sh + else + autoreconf -is + fi + if [ ! -f configure ] ; then + bomb "Could not find configure" + fi +fi +./configure +if [ $? != 0 ] ; then + bomb "Configure failed" +fi +make +if [ $? != 0 ] ; then + bomb "Compilation failed" +fi +log "Compilation succeeded" +return 0 + +EOF + +4) Create a ~/.corredorrc file with lines describing your project and +where you've put files. Example: + +cat > ~/.corredorrc <<EOF +PACKAGE=name_of_your_project +PACKAGE_SRC=/path/to/your/project +TESTS_D=/path/to/your/project/tests +EOF + +5) Run corredor. You should now be able to run corredor and provide +the "start" command. It will copy your sources to a temporary +directory (which is configurable) and run the tests in your test +directory. Example: + +/path/to/corredor start + +That should do it. If that doesn't work, see the following section on +INSTALLATION & SETUP DETAILS or review the proceeding instructions in +closer detail. If you have read and are still experiencing issues, +please report those problems via the REPORTING PROBLEMS section below. + +INSTALLATION & SETUP DETAILS +---------------------------- + +Not yet written. *ahem* + + +REPORTING PROBLEMS +------------------ + +Please report any bugs encountered to the project bug tracker at +http://sourceforge.net/tracker/?group_id=102847&atid=633006 + +Similarly, please post any request for feature enhancements or support +to http://sourceforge.net/tracker/?group_id=102847&atid=633009 and +http://sourceforge.net/tracker/?group_id=102847&atid=633007 +respectively. + +--- +Cheers! Property changes on: corredor/trunk/INSTALL ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: corredor/trunk/README =================================================================== --- corredor/trunk/README 2006-09-19 06:01:40 UTC (rev 2) +++ corredor/trunk/README 2006-09-19 17:38:11 UTC (rev 3) @@ -54,11 +54,14 @@ GETTING STARTED --------------- -To effectively utilize Corredor as an execution framework, some +To effectively utilize Corredor as an execution framework, minimal preparation is required. Namely, you will need to create execution -scripts specific to you particular environment testing needs. +scripts specific to you particular environment testing needs. See the +INSTALL file for a brief introduction on how to get started with +Corredor. + Corredor may also be used to benchmark the overall performance of -shell environment. See the BENCHMARK section for details. +shell environment. See the BENCHMARK section below for details. BENCHMARK @@ -147,10 +150,11 @@ CONTACT & CONTRIBUTIONS ----------------------- -Corredor is written and maintained by Christopher Sean Morrison. -Feedback and contributions are always appreciated and welcome, and the -project is always open to having others join in the direct development -and improvement of Corredor. +Corredor was originally conceived and remains primarily written and +maintained by Christopher Sean Morrison. Feedback and contributions +are always appreciated and welcome, and the project is always open to +having others join in the direct development and improvement of +Corredor. See the HACKING file for details on getting involved. Interactive support via IRC is preferred and generally available during UTC-5 hours on the Freenode network (irc.freenode.net:6667) in Added: corredor/trunk/TODO =================================================================== --- corredor/trunk/TODO (rev 0) +++ corredor/trunk/TODO 2006-09-19 17:38:11 UTC (rev 3) @@ -0,0 +1,51 @@ +Corredor To Do List +=================== + +Included below is a list of items that are scheduled or desirable to +have done at some point. Most recently added items are on top, older +topics are on the bottom. This is not an official list, it's more of +a scratch pad to use for tracking development ideas and informal +plans in a lightweight manner. + +THESE SHOULD HAPPEN BEFORE THE FIRST RELEASE +-------------------------------------------- + +* basic local operation respecting test dependencies + +* basic documentation on installation and setup + + +THESE SHOULD HAPPEN WITHIN TWO RELEASE ITERATIONS +------------------------------------------------- + +* improved logging framework via log4sh + +* remote operation + + +THESE ARE FOR FUTURE RELEASES +----------------------------- + +* add multiproject single-install support + +* add self-installation support (e.g. sudo ./corredor install) + +* web interface for benchmark results + +* modules for system characteristics (cpu, architecture, OS, versions, + memory, disks, network, etc) + +* modules for various command tools (posix or otherwise) + +* ability to step through scripts one statement at a time for + debugging and testing support + +* shell script compiler written in shell + + +--- +See the project task tracker for more to do items and future planning +efforts. http://sf.net/pm/?group_id=102847 + +TODO items should be formated to column 70 (M-q in emacs), no tabs + Property changes on: corredor/trunk/TODO ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2006-09-19 06:02:54
|
Revision: 2 http://svn.sourceforge.net/corredor/?rev=2&view=rev Author: brlcad Date: 2006-09-18 23:01:40 -0700 (Mon, 18 Sep 2006) Log Message: ----------- Initial revision of Corredor. This version was implemented a couple years ago but was never committed to revision control until now. At this point, corredor correctly loads the plugin modules in correct dependency order and supports the primary start/stop/status/run commands along with all the supporting backend infrastructure (e.g. logging, environment processing, overrides, i/o, configuration management, locking, and more). Also included is the embedded benchmark suite for evaluating the performance of a shell environment. Added Paths: ----------- corredor/trunk/README corredor/trunk/Resources/ corredor/trunk/Resources/NOTES corredor/trunk/Resources/Source/ corredor/trunk/Resources/Source/Compression/ corredor/trunk/Resources/Source/Compression/Compression corredor/trunk/Resources/Source/Compression/ExecutionParameters.plist corredor/trunk/Resources/Source/Environment/ corredor/trunk/Resources/Source/Environment/Environment corredor/trunk/Resources/Source/Environment/ExecutionParameters.plist corredor/trunk/Resources/Source/Filesystem/ corredor/trunk/Resources/Source/Filesystem/ExecutionParameters.plist corredor/trunk/Resources/Source/Filesystem/Filesystem corredor/trunk/Resources/Source/Input/ corredor/trunk/Resources/Source/Input/ExecutionParameters.plist corredor/trunk/Resources/Source/Input/Input corredor/trunk/Resources/Source/Locking/ corredor/trunk/Resources/Source/Locking/ExecutionParameters.plist corredor/trunk/Resources/Source/Locking/Locking corredor/trunk/Resources/Source/Mail/ corredor/trunk/Resources/Source/Mail/ExecutionParameters.plist corredor/trunk/Resources/Source/Mail/Mail corredor/trunk/Resources/Source/Output/ corredor/trunk/Resources/Source/Output/ExecutionParameters.plist corredor/trunk/Resources/Source/Output/Output corredor/trunk/Resources/Source/Platform/ corredor/trunk/Resources/Source/Platform/ExecutionParameters.plist corredor/trunk/Resources/Source/Platform/Platform corredor/trunk/Resources/Source/ResourceFile/ corredor/trunk/Resources/Source/ResourceFile/ExecutionParameters.plist corredor/trunk/Resources/Source/ResourceFile/ResourceFile corredor/trunk/Resources/Source/RevisionControl/ corredor/trunk/Resources/Source/RevisionControl/ExecutionParameters.plist corredor/trunk/Resources/Source/RevisionControl/RevisionControl corredor/trunk/Resources/Source/Testing/ corredor/trunk/Resources/Source/Testing/ExecutionParameters.plist corredor/trunk/Resources/Source/Testing/Testing corredor/trunk/Resources/Source/Transport/ corredor/trunk/Resources/Source/Transport/ExecutionParameters.plist corredor/trunk/Resources/Source/Transport/Transport/ corredor/trunk/Resources/Source/Transport/Transport/RSH/ corredor/trunk/Resources/Source/Transport/Transport/SSH/ corredor/trunk/Resources/Source/Transport/Transport/SSH/SSH corredor/trunk/Resources/library corredor/trunk/Resources/rcHeader.txt corredor/trunk/Resources/test.sh corredor/trunk/SystemBucket/ corredor/trunk/SystemBucket/localhost/ corredor/trunk/TestBucket/ corredor/trunk/TestBucket/Input/ corredor/trunk/TestBucket/Locking/ corredor/trunk/TestBucket/Logging/ corredor/trunk/TestBucket/README corredor/trunk/TestBucket/Shell/ corredor/trunk/TestBucket/Shell/Shell corredor/trunk/TestBucket/Template/ corredor/trunk/TestBucket/Template/Template corredor/trunk/TestBucket/Variables/ corredor/trunk/corredor Added: corredor/trunk/README =================================================================== --- corredor/trunk/README (rev 0) +++ corredor/trunk/README 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,170 @@ + Corredor + Version 2006.10 + http://corredor.sf.net + +Corredor is a robust and general framework for performing automated +execution of tasks with a particular emphasis on software testing. +With a POSIX-compliant shell, Corredor makes it easier to set up, +maintain, and run scripts, supporting symmetric, simultaneous, and +distributed exectution. + +Corredor was initially created in 2002 with the design purpose of +performing automated and distributed testing of software packages. +Initially designed for testing the extensive BRL-CAD solid modeling +software suite, the framework was expanded and refined towards +providing a general execution framework that lets you run a set of +shell scripts are defined for a given project. + +The framework is written entirely in POSIX Bourne shell and makes no +assumptions about system functionality outside of the POSIX standard. +Any POSIX platform that can run a bourne shell should be able to +utilize Corredor without compilation or modification. The framework +provides a variety of routines that strive to make it as easy as +possible to build and test software packages. You write scripts that +can build and test your software, and then Corredor make it easy to +manage how those scripts are run locally or even distributed. + +As an example, once you describe even just a simple script that builds +a project, you can then tell the framework to automatically distribute +that job to an entire compilation farm of machines. Corredor then +takes care of all the details of packing everything up, getting onto +those machines, peforming the builds, analyzing whether the builds +succeed, cleaning up, and returning results back in some useful form. + +Corredor strives to make it as easy as possible to set up, maintain, +and run black box, white box, regression, unit, and build tests so +that software may be made more robust and reliable. Corredor supports +symmetric, simultaneous, and distributed testing. The system may be +invoked on-demand via automation or run interactively. Success and +failure reporting is given via direct-interactive feedback, file +report logging, and e-mail. + + +TABLE OF CONTENTS +----------------- + Introduction + Table of Contents + Getting Started + Benchmark + File Manifest + References + Contact & Contributions + + +GETTING STARTED +--------------- + +To effectively utilize Corredor as an execution framework, some +preparation is required. Namely, you will need to create execution +scripts specific to you particular environment testing needs. +Corredor may also be used to benchmark the overall performance of +shell environment. See the BENCHMARK section for details. + + +BENCHMARK +--------- + +Corredor has a built-in benchmark performance analysis functionality +for testing the run-time performance characteristics of a given +system's shell scripting environment. The benchmark exercises basic +shell functionality including the invocation of shell functions, +setting of environment variables, execution of required system +commands, and more. The benchmark reports the performance results in +terms of the number of shell operations per second. + + +FILE MANIFEST +------------- + README - this initial documentation file + Resources/ - execution framework internal logic and plugins + Resources/library - general purpose shell script library + SystemBucket/ - system directory containing settings for remote hosts + TestBucket/ - directory containing runnable scripts/tests + corredor - the Corredor test execution command tool + + +REFERENCES +---------- + +Regression testing +URL: http://whatis.techtarget.com/definition/0,,sid9_gci212884,00.html +NOTE: Regression testing is the process of testing changes to computer +programs to make sure that the older programming still works with the +new changes. Regression testing is a normal part of the program +development process and, in larger companies, is done by code testing +specialists. Test department coders develop code test scenarios and +exercises that will test new units of code after they have been +written. These test cases form what becomes the test bucket. Before a +new version of a software product is released, the old test cases are +run against the new version to make sure that all the old capabilities +still work. The reason they might not work is because changing or +adding new code to a program can easily introduce errors into code +that is not intended to be changed. + +Regression testing +URL: http://www.pcwebopaedia.com/TERM/R/regression_testing.html +NOTE: The selective retesting of a software system that has been +modified to ensure that any bugs have been fixed and that no other +previously-working functions have failed as a result of the +reparations and that newly added features have not created problems +with previous versions of the software. Also referred to as +verification testing, regression testing is initiated after a +programmer has attempted to fix a recognized problem or has added +source code to a program that may have inadvertently introduced +errors. It is a quality control measure to ensure that the +newly-modified code still complies with its specified requirements and +that unmodified code has not been affected by the maintenance +activity. + +Test-drive development +URL: http://www.thecoadletter.com/issues/testdriven/coadletter-testdriven-095_why_test.htm +NOTE: Article explains why Test-driven Development (TDD) is generally +a "good thing". + +Mac Startup Items +URL: http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/BootingLogin/The_Boot_Sequence.html +URL: http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/BootingLogin/Customization_Techniques.html +URL: http://developer.apple.com/techpubs/macosx/Darwin/howto/system_starter_howto/system_starter_howto.html + +Tetworks +URL: http://tetworks.opengroup.org/ +URL: http://tetworks.opengroup.org/Products/tet.html +NOTE: The Open Group's test execution product (16K for pro license + +6K/year). It appears to be the most robust and complete testing +framework around. The framework is used to test UNIX/POSIX +compliance, X11 API conformance and a slew of other "large" APIs. + +Gentoo Initscripts +URL: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=5 + +Concurrent Versions System +URL: http://www.cvshome.org + +Red Hat rc.d initscripts +URL: file:///etc/rc.d + + +CONTACT & CONTRIBUTIONS +----------------------- + +Corredor is written and maintained by Christopher Sean Morrison. +Feedback and contributions are always appreciated and welcome, and the +project is always open to having others join in the direct development +and improvement of Corredor. + +Interactive support via IRC is preferred and generally available +during UTC-5 hours on the Freenode network (irc.freenode.net:6667) in +the #brlcad channel. Look for the user 'brlcad'. + +Bug reports, feature requests, and support requests may be made to the +project's Sourceforge site: http://sourceforge.net/projects/corredor + +Mailing lists are similarly available at the Sourceforge project site. + +Feel free to direct any questions or comments relating to Corredor via +e-mail to 'cor...@in...' or to any of the other +contact means described above. + +Cheers! +Sean + Property changes on: corredor/trunk/README ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/Resources/NOTES =================================================================== --- corredor/trunk/Resources/NOTES (rev 0) +++ corredor/trunk/Resources/NOTES 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,114 @@ +PROBLEM ANALYSIS +================ + +Needs +----- + for source code commits to the main CVS branch compile across multiple architectures + detection of software bugs + verification that expected APIs do not change unexpectedly + + +Problems +-------- + compilation is time intensive + manually compiling across multiple architectures is time intensive + verification that source code behaves as expected is time intensive + APIs are sometimes broken or used in unforseen manners + modification to one source module inadvertently induces an error in another source module + + +Potential General Solutions to Problems +--------------------------------------- + ignore the problems and/or deal with the issues as they arise + use a testing framework + design and implement one + buy one + impose policy on commiters + + +Realistic Tool Solution Expectations +------------------------------------ + it is simple to run tests across multiple architectures on demand + adding new tests is not complicated + cross compilation across multiple architectures may be automated + + +Current Manual Testing Costs +---------------------------- + time/cost varies per developer + useability testing is generally minimal (i.e. little time spent testing the software) + compilation testing is generally frequent (i.e. most time spent compiling) + compilation takes between 5 and 120 minutes per architecture (but is invoke-and-forget) + approximately 10 minutes per architecture per build is needed to setup/invoke/analyse build and run benchmarks (minimal functionality test + approximately 6 supported architectures (osx, linux, freebsd, sgi, solaris, aix) (windows?) + approximately 1 hour to build across all platforms and verify builds + 8 active core developers + one cross-compilation build/test by all developers is approximately 8 man hours (1 man day) + one build per week (moderate activity) is about 400 man hours (50 man days) per year (50 weeks) + compilations are less frequent after release (1/week) + compilations are frequent before release (1+/day) + + +Future (Expected) Manual Testing Costs +-------------------------------------- + mandatory cross compilations happen nightly and per/commit happen automatically + maintenance of test suite is necessary + + +TOOL DESIGN +=========== + +Initial Automated Testing Costs +------------------------------- + design and implementation of test suite (0 -- done offline) + design and implementation of tests (1 man hour per test) + setup of test suite (8 man hours) + usage learning by all developers (1 man hour per developer) + + +Future Automated Testing Costs +------------------------------ + maintenance of test suite (1 man hour per month) + maintenance of tests (variable -- 1 man hour per year per test) + design and implementation of new tests ( 1 man hour per test) + + +Tool Users +---------- + builder and tester + := those who want to use the suite to verify buildability and/or functionality + test writer + := those who contribute tests to the test suite + suite maintainer + := those who install and/or modify the suite itself, preparing the test framework + software + := cron, web browsers, other tools that may invoke the tool on demand + + +Mandatory Tool Features and Contraints +-------------------------------------- + works cross-platform on all supported architectures + must be minimally dependant upon external interfaces and tools + may be run on demand + may be automated + tool should not irreversibly modify user data by default + tool must be understood/learned by all users + requires no time expense when system is static (should not have to "clean up logs", etc) + + +Desireable Tool Features +------------------------ + should provide minimal false negatives (suite failure) + tool should be quick/simple to learn and use + may be run interactively (single stepping at different levels) + should be simple to add new tests + should be robust test framework to support evolving test style/strategy + should provide informative test reports for failure investigation + + +Maintenance of Tool +------------------- + needs to have new tests added as new features/tools are added + must be maintained as supported architectures evolve + must be ported to newly supported architectures + Property changes on: corredor/trunk/Resources/NOTES ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Compression/Compression =================================================================== --- corredor/trunk/Resources/Source/Compression/Compression (rev 0) +++ corredor/trunk/Resources/Source/Compression/Compression 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,52 @@ +#!/bin/sh +# +# C o m p r e s s i o n +# +### +# +# unpackArchive +# unpack an archive from a variety of formats (tar files, tgz, zip, etc) + + +# +# unpackArchive archive [extractDir] +# +# as it is, this function merely bombs on error, but it should return a +# truthvalue as to whether the unpacking succeeded or not and let the +# application handle the result. +unpackArchive ( ) { + [ ! "x$DEBUG" = "x" ] && log "unpackArchive( \$1=[$1] \$2=[$2] )" + + [ "x$1" = x ] && bomb "unpackArchive() arg1 mismatch -- no archive given" + __ARCHIVE="$1" + if [ "x$2" = "x" ] ; then + __SWS=`echo $__ARCHIVE | sed 's/^\/.*/___ROOTED_NAME___/'` + [ "x$__SWS" = "x___ROOTED_NAME___" ] && __DIR=`dirname $__ARCHIVE` || __DIR="./" + else + __DIR="$2" + fi + + # [ ! -f "$__ARCHIVE" ] && bomb "Unable to find archive [$__ARCHIVE] for unpacking" + # [ ! -r "$__ARCHIVE" ] && bomb "Unable to read archive [$__ARCHIVE] for unpacking" + + # XXX this is minimal checking and support for right now + # we assume that the uncompressor is available and options are supported + case "$__ARCHIVE" in + *.tar ) + tar -C "$__DIR" -xf "$__ARCHIVE" ;; + *.zip ) + unzip "$__ARCHIVE" ;; + *.tar.Z ) + uncompress -c "$__ARCHIVE" | tar -C "$__DIR" -x ;; + *.tar.gz | *.tgz ) + gzip -c -d "$__ARCHIVE" | tar -x -C "$__DIR" ;; + *.tar.bz2 ) + bunzip2 -c "$__ARCHIVE" | tar -C "$__DIR" -x ;; + * ) + bomb "Unsupported archive format" ;; + esac + + # [ ! "x$?" = "x0" ] && bomb "Archive unpacking failed" + return $? +} + Property changes on: corredor/trunk/Resources/Source/Compression/Compression ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/x-sh Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Compression/ExecutionParameters.plist =================================================================== --- corredor/trunk/Resources/Source/Compression/ExecutionParameters.plist (rev 0) +++ corredor/trunk/Resources/Source/Compression/ExecutionParameters.plist 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,5 @@ +Description="Compression and archive routines"; +Provides="Compression"; +Requires="Output"; +Uses="Debug"; +OrderPreference="None"; Property changes on: corredor/trunk/Resources/Source/Compression/ExecutionParameters.plist ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Environment/Environment =================================================================== --- corredor/trunk/Resources/Source/Environment/Environment (rev 0) +++ corredor/trunk/Resources/Source/Environment/Environment 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,698 @@ +#!/bin/sh +# +# E n v i r o n m e n t +# +### +# +# initializeVariable +# initializes a variable to a value if not already set +# getInitializedVariables +# returns a list of variables that were initialized +# initializeOption +# initialize a special variable that has a defined behavior and interface +# getOptionSwitches +# outputs a list of switches associated with an option +# getOptionVariable +# outputs the variable associated with a given switch +# getOptionDescription +# outputs a description of an option +# variableIsTrue +# returns true or false if a variable is truthful +# variableIsFalse +# returns true or false if a variable is not truthful +# handleArgument +# turns an argument into the appropriate option value +# +# INTERNAL VARIABLES (do not use or rely on) +# +# __INITIALIZED_VARIABLE_GROUPS +# __INITIALIZED_VARIABLES_* +# + +# +# initializeVariable variableName [defaultValue] [categoryList] +# +# initializes a variable to a given value unless that variable is already +# defined (e.g. already initialized). this allows script variables to also be +# overridden by environment variables this is similar behavior as +# ${variableName:=defaultValue} available in some shells, except for the +# variable logging. variables may be logged in groups by giving a list of +# categories that this variable should be logged under. +# +# !!! need to optimize this routine to decrease startup times +# +initializeVariable ( ) { + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "initializeVariable( \$1=[$1] \$2=[$2] \$3=[$3] )" + unset __TEMP_DEBUG_OFF + + if [ "x$1" = "x" ] ; then + bomb "initializeVariable() arg1 mismatch" + else + __VAR="$1" + fi + # do not need to check since may be empty anyways + __DEF="$2" + __GROUP="`echo $3 | tr [:lower:]- [:upper:]_`" + + # make sure the name is valid (no dashes) + if [ "x`echo $__VARIABLE | tr - _`" != "x$__VARIABLE" ] ; then + bomb "Dashes are not allowed in variable names (underscores are, though)" + fi + + # stupid name to variable translation is a bitch..especially on sun5 + + # here, the variable is actually set, after we first make sure that the + # variable is not already set + __PVAR="echo \$$__VAR" + if [ "x`eval $__PVAR`" = "x" ] ; then + # if the value is already quoted, leave it quoted + # XXX need to check that the quoting still works + if [ "x`echo $__DEF | sed 's/^[\"].*/__QUOTED__/'`" = "x__QUOTED__" ] ; then + __CMD="$__VAR=$__DEF" + else + __CMD="$__VAR=\"$__DEF\"" + fi + + eval $__CMD + export $__VAR + fi + + # add the group to the list of groups if it is not there. this is + # primarily of performance use for routines that want to know what the + # groups are (like bomb) + if [ ! "x$__GROUP" = "x" ] ; then + for __GRP in $__GROUP ; do + __FOUNDGROUP=no + for __i in $__INITIALIZED_VARIABLE_GROUPS ; do + if [ "x$__GRP" = "x$__i" ] ; then + __FOUNDGROUP="yes" + break; + fi + done + if [ "x$__FOUNDGROUP" = "xno" ] ; then + __INITIALIZED_VARIABLE_GROUPS="$__INITIALIZED_VARIABLE_GROUPS $__GRP" + export __INTIALIZED_VARIABLE_GROUPS + fi + done + fi + + # add the variable to a list of known initialized variables (with optional + # grouping). note that __INITIALIZED_VARIABLES_ holds the + # main/default/non-categorized variables + if [ "x$__GROUP" = "x" ] ; then + __INITIALIZED_VARIABLES_="$__INITIALIZED_VARIABLES_ $__VAR" + export __INITIALIZED_VARIABLES_ + else + for __GRP in $__GROUP ; do + __PVAR="echo \$__INITIALIZED_VARIABLES_${__GRP}" + __PVAR="__INITIALIZED_VARIABLES_${__GRP}=\"`eval $__PVAR` $__VAR\"" + eval $__PVAR + export __INITIALIZED_VARIABLES_${__GRP} + done + fi + + __TEMP_DEBUG_OFF=1 + if [ ! x$DEBUG = x ] ; then + __PVAR="echo \$$__VAR" + log "initializeVariable: $__VAR=[`eval $__PVAR`]" + fi + unset __TEMP_DEBUG_OFF + + return 0 +} + + +# +# getInitializedVariables [categoryList] +# +# returns a list of the variables that have been initialized from an optional +# list of categorues (that would have been given when the variable was set). +# +# category names are case-insensitive +# +getInitializedVariables ( ) { + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "getInitializedVariables( \$1=[$1] )" stderr + unset __TEMP_DEBUG_OFF + + __GROUP="`echo $1 | tr [:lower:]- [:upper:]_`" + + if [ "x$__GROUP" = "x" ] ; then + [ ! "x$DEBUG" = "x" ] && log "getInitializedVariables: returning $__INITIALIZED_VARIABLES_" + echo "$__INITIALIZED_VARIABLES_" + return 0 + fi + + __VARS="" + for __GRP in $__GROUP ; do + __PVAR="echo \$__INITIALIZED_VARIABLES_${__GRP}" + __VARS="`eval $__PVAR` $__VARS" + done + [ ! "x$DEBUG" = "x" ] && log "getInitializedVariables: returning $__VARS" + echo $__VARS + return 0 +} + + +# +# initializeOption variableName [defaultValue] [validValues] [description] [additionalSwitches] [categoryList] +# +# options are runtime switches that modify a programs runtime behavior. +# options may be set either 1) as a default value to a variable inside of the +# actual source (e.g. inside of ./corredor) program using the variable, or +# 1) as a system environment variable (e.g. PACKAGE_SOURCE=/usr/src/whatever), +# or 3) via a command-line argument to the program +# (e.g. ./corredor --package-source=/usr/src/whatever). +# precedence goes in reverse order: first to command-line args, then to +# environment vars, then to defaults. +# +# this function takes the "description" of an option, including its name, +# default value, valid values, a text description, additional switches, and a +# category. the only required data is the name of the option. valid values +# are escaped patterns that will match a case test. by default, an option may +# be specified via the command line according to this pattern +# -+OPTION[_-]NAME[= ]+\"?VALUE\"?. (e.g. option OPTION_NAME could be +# specified as --option-name=one, --option_name=two, +# -option-name="three four", -option_name five, OPTION_NAME=six, etc) that is +# to say, in english, that there are one or more preceeding dashes followed by +# case-insensitive letters, embedded underscores and dashes are +# interchangeable, and the equal sign and wrapping quotes are optional. +# (wrapping quotes are not optional if there are spaces in the value). +# +# category names are case-insensitive. +# +initializeOption ( ) { + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "initializeOption( \$1=[$1] \$2=[$2] \$3=[$3] \$4=[$4] \$5=[$5] \$6=[$6] )" + unset __TEMP_DEBUG_OFF + + if [ "x$1" = "x" ] ; then + bomb "initializeOption() arg1 mismatch" + else + __VARIABLE="`echo $1 | tr [:lower:]- [:upper:]_`" + fi + __DEFAULT="$2" + + # since valid is a matching pattern, default is match nothing if given "". + # that is how to make a read-only option (cannot be set) + __VALID="$3" + # wrap the value in single quotes to prevent replacement + # [ "x$__VALID" = "x" ] || __VALID="'$__VALID'" + + # a simple default label is given if no description is available + [ "x$4" = "x" ] && __DESC="$__VARIABLE option" || __DESC="$4" + + # there are no default "additional" switches or default grouping + __SWITCHES="$5" + # convert a category to uppercase + __CATEGORY="`echo $6 | tr [:lower:]- [:upper:]_`" + + # check if option is already registered as an option or is in use + __PVAR="echo \$$__VARIABLE" + if [ ! "x`eval $__PVAR`" = "x" ] ; then + + # this means the option name is already in use as an option or variable + + __PVAR="echo \$__${__VARIABLE}_SWITCHES" + if [ "x`eval $__PVAR`" = "x" ] ; then + __PVAR="echo \$$__VARIABLE" + warn "Unable to initialize $__VARIABLE as option -- variable already has value (`eval $__PVAR`)" + else + # the option is already registered + return + fi + else + # check for options with empty defaults + __PVAR="echo \$__${__VARIABLE}_SWITCHES" + if [ ! "x`eval $__PVAR`" = "x" ] ; then + # the option is in use (empty default) + return + + # xxx unreached xxx + # returning is normally desired to match initVar's default "quiet" + # behavior on initializing something already initialized. + warn "Option $__VARIABLE has already been initialized" + fi + fi + + # !!! need to optimize initializeOptions to not use initializeVariable for performance + + # actually intialize and record an option just as if it were a + # variable, then we do some extra bookkeeping + initializeVariable "$__VARIABLE" "$__DEFAULT" "$__CATEGORY" + + # add at least the variable name to the list of valid switches. + __SWITCHES="$__SWITCHES `echo $__VARIABLE | tr [:upper:]_ [:lower:]-`" + + # XXX should replace this whole section with a grep match for performance + # make sure another option is not set to use any of our switches + for __i in $__SWITCHES ; do + for __j in $__USED_SWITCHES ; do + if [ "x$__i" = "x$__j" ] ; then + # here we see if the matching switch is associated with *this* option (multiple init) + __SELF_SWITCHES="echo \$__${__VARIABLE}_SWITCHES" + __SELF_SWITCHES="`eval $__SELF_SWITCHES`" + __SELF_MATCH=0 + if [ ! "x$__SELF_SWITCHES" = "x" ] ; then + for __k in $__SELF_SWITCHES ; do + if [ "x$__i" = "x$__k" ] ; then + warn "Option \"$__VARIABLE\" already has switch \"$__k\"" + __SELF_MATCH=1 + break + fi + done + fi + if [ "x$__SELF_MATCH" = "x0" ] ; then + bomb "Conflict adding $__VARIABLE option, \"$__i\" switch already designated" + fi + # since we matched a used switch, no need to keep checking + # (the switch was previously added to this option) + break + fi + done + done + + # extra bookkeeping + initializeVariable "__${__VARIABLE}_SWITCHES" "$__SWITCHES" "_OPTION_SWITCHES" + initializeVariable "__${__VARIABLE}_VALUES" "$__VALID" "_OPTION_VALUES" + initializeVariable "__${__VARIABLE}_DESCRIPTION" "$__DESC" "_OPTION_DESCRIPTION" + + # keep specific track of all switches for collision detection. we do not + # do any error checking just because if we got here, new switches were + # added. this is a whole *lot* faster than getting a list of variables or + # options and checking all their switches then. saves us about a sec, at + # least. + __USED_SWITCHES="$__USED_SWITCHES $__SWITCHES" + export __USED_SWITCHES + + # we still perform basic book-keeping separate from the init vars + # bookkeeping, so we can iterate only over option variables + __INITIALIZED_OPTIONS_="$__INITIALIZED_OPTIONS_ $__VARIABLE" + export __INITIALIZED_OPTIONS_ + # if categories were given, make add the option to that category list + if [ ! "x$__CATEGORY" = "x" ] ; then + for __CAT in $__CATEGORY ; do + __PVAR="echo \$__INITIALIZED_OPTIONS_${__CAT}" + __PVAR="__INITIALIZED_OPTIONS_${__CAT}=\"`eval $__PVAR` $__VARIABLE\"" + eval $__PVAR + export __INITIALIZED_OPTIONS_${__CAT} + done + fi + + [ ! "x$DEBUG" = "x" ] && log "initializeOption: done with option \"$__VARIABLE\" (set to to \"$__DEFAULT\" in category \"$__CATEGORY\")" +} + + +# getOptionSwitches optionName [category] +# +# returns a list of the options for this switch. if the category is given, +# then the option must be in that category. +# +# category names are case-insensitive +# +getOptionSwitches ( ) { + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "getOptionSwitches( \$1=[$1] \$2=[$2] )" stderr + unset __TEMP_DEBUG_OFF + + if [ "x$1" = "x" ] ; then + bomb "getOptionSwitches() arg1 mismatch" + fi + __VARIABLE="$1" +# __CATEGORY="`echo $2 | tr [:lower:]- [:upper:]_`" + + # if they did not give a category, just return the switch +# if [ "x$__CATEGORY" = "x" ] ; then + eval "echo \$__${__VARIABLE}_SWITCHES" + return 0 +# fi + + # they gave a category so we must validate that the option is in that + # category + + # XXX unimplemented + + return 0 +} + + +# getOptionVariable switch [category] +# +# returns the option that is associated with a given switch. if the category +# is given, then the option must be in that category. +# +# category names are case-insensitive +# +getOptionVariable ( ) { + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "getOptionVariable( \$1=[$1] \$2=[$2] )" stderr + unset __TEMP_DEBUG_OFF + + if [ "x$1" = "x" ] ; then + bomb "getOptionVariable() arg1 mismatch" + fi + __SWITCH="$1" +# __CATEGORY="`echo $2 | tr [:lower:]- [:upper:]_`" + + # separate out __SWITCH if it is SWITCH=VALUE form + if [ ! "x`echo $__SWITCH | grep =`" = "x" ] ; then + __PVAR="`echo $__SWITCH | sed 's/^-*\([a-zA-Z_-]*\)=.*/\1/'`" + if [ "x$__PVAR" = "x" ] ; then + warn "could not match $__VAR (sed match error)" + else + __SWITCH="$__PVAR" + fi + fi + + # strip off leading dashes + __SWITCH="`echo $__SWITCH | sed 's/^-*\(.*\)/\1/'`" + + # convert embedded underscores to dashes and upper to lower + __SWITCH="`echo $__SWITCH | tr [:upper:]_ [:lower:]-`" + + # if they did not give a category, just return the switch + +# if [ "x$__CATEGORY" = "x" ] ; then + # make sure the switch is at least in use + if [ ! "x`echo $__USED_SWITCHES | grep -i $__SWITCH`" = "x" ] ; then + for __OPT in $__INITIALIZED_OPTIONS_ __placeholder__ ; do + __SWITCHES="`getOptionSwitches $__OPT`" + for __SH in $__SWITCHES ; do + if [ "x$__SH" = "x$__SWITCH" ] ; then + [ "x$DEBUG" = "x" ] || log "getOptionVariable: returning $__OPT" stderr + echo "$__OPT" + return 0 + fi + done + done + fi + [ "x$DEBUG" = "x" ] || log "getOptionVariable: returning" stderr + return 0 +# fi + + # they gave a category so we must validate that the option is in that + # category + + # XXX unimplemented + + [ "x$DEBUG" = "x" ] || log "getOptionVariable: returning" stderr + return 0 +} + + +# getOptionValues optionName [category] +# +# returns a list of the valid options for this switch. if a category is +# given, then the option must be in that category. +# +# category names are case-insensitive +# +getOptionValues ( ) { + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "getOptionValues( \$1=[$1] \$2=[$2] )" stderr + unset __TEMP_DEBUG_OFF + + if [ "x$1" = "x" ] ; then + bomb "getOptionValues() arg1 mismatch" + fi + __VARIABLE="$1" +# __CATEGORY="`echo $2 | tr [:lower:]- [:upper:]_`" + + # if they did not give a category, just return the switch +# if [ "x$__CATEGORY" = "x" ] ; then + __PVAR="echo \$__${__VARIABLE}_VALUES" + __PVAR="`eval $__PVAR`" +# __QUOTE="`echo $__PVAR | tr \' \\" | sed 's/^\"\(.*\)\"/\1/'`" +# echo $__PVAR | tr \' \" | sed 's/^\"\(.*\)\"/\1/' + echo $__PVAR + # strip off the wrapping single quotes + [ ! "x$DEBUG" = "x" ] && log "getOptionValues: returning $__PVAR" stderr + + return 0 +# fi + + # they gave a category so we must validate that the option is in that + # category + + # XXX unimplemented + + return 0 +} + + +# getOptionDescription optionName [category] +# +# returns a list of the options for this switch. if a category is given, +# then the option must be in that category. +# +# category names are case-insensitive +# +getOptionDescription ( ) { + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "getOptionDescription( \$1=[$1] \$2=[$2] )" stderr + unset __TEMP_DEBUG_OFF + + if [ "x$1" = "x" ] ; then + bomb "getOptionDescription() arg1 mismatch" + fi + __VARIABLE="`echo $1 | tr [:lower:]- [:upper:]_`" +# __CATEGORY="`echo $2 | tr [:lower:]- [:upper:]_`" + + # if they did not give a category, just return the switch +# if [ "x$__CATEGORY" = "x" ] ; then + __PVAL="echo \$__${__VARIABLE}_DESCRIPTION" + eval $__PVAL + return 0 +# fi + + # they gave a category so we must validate that the option is in that + # category + + # XXX unimplemented + + return 0 +} + +# +# variableIsTrue variable +# +# simply returns true if a variable is considered true and false otherwise. +# variables are true when their value is "yes", "true", or "1". +# +variableIsTrue ( ) { + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "variableIsTrue( \$1=[$1] )" stderr + unset __TEMP_DEBUG_OFF + + if [ "x$1" = "x" ] ; then + bomb "variableIsTrue() arg1 mismatch" + fi + __VARIABLE="$1" + + __VARVAL="echo \$$__VARIABLE" + __VARVAL="`eval $__VARVAL`" + + [ ! "x$DEBUG" = "x" ] && log "variableIsTrue: value is [$__VARVAL]" + + [ "x$__VARVAL" = "x" ] && return 1 + + # if the value is a truthful boolean, return true + case "$__VARVAL" in + y[eE][sS] | Y[eE][sS] | t[rR][uU][eE] | T[rR][uU][eE] | 1 ) + return 0 + ;; + esac + + # otherwise, return false + return 1 +} + + +# +# variableIsFalse variable +# +# simply returns true if a variable is considered false and true otherwise. +# variables are false when they are not true (grin -- see variableIsTrue). +# +variableIsFalse ( ) { + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "variableIsFalse( \$1=[$1] )" stderr + unset __TEMP_DEBUG_OFF + + if [ "x$1" = "x" ] ; then + bomb "variableIsFalse() arg1 mismatch" + fi + __VARIABLE="$1" + + if `variableIsTrue $__VARIABLE` ; then + return 1 + fi + return 0 +} + + +# +# handleArgument (switch|switch=value) [value] [category] +# +# handles an argument (switch value tuple) passed through via the command +# line. the argument includes some unkown number of dashes before the +# switch name, then the switch (case insensitive with optional interchangeable +# dashes and underscores embedded), an optional equals sign, and then the +# value (case-preserving). if a category is given, then the argument must +# match a corresponding option switch in that category. otherwise, not giving +# a category means to match against *any* category. +# +# (e.g. handleArgument test="one two three" "" testCategory) +# (e.g. handleArgument --w no) +# (e.g. handleArgument --w=no -nextArg) +# +# there are several special-case values that represent special classes of +# values. passing __ANYTHING__ as the value, will allow any argument value to +# match. passing __BOOLEAN__ will allow yes/no style values such as true +# false 0 1, etc. passing __NUMBER__ will allow for positive numeric values. +# +# this function returns how many arguments (0, 1, or 2) that were handled that +# may subsequently be shift'd off the argument stack. if a value greater than +# two is returned, it means that the switch was matched, but the value was not. +# +# category names are case-insensitive +# +handleArgument ( ) { + + __TEMP_DEBUG_OFF=1 + [ ! "x$DEBUG" = "x" ] && log "handleArgument( \$1=[$1] \$2=[$2] \$3=[$3] )" stderr + unset __TEMP_DEBUG_OFF + + if [ "x$1" = "x" ] ; then + bomb "handleArgument() arg1 mismatch" + fi + __VAR="$1" + # this "may" not be the value if __VAR is in VAR=VALUE form + __VALUE="$2" + # optional category (case-insensitive) + __GROUP="`echo $3 | tr [:lower:]- [:upper:]_`" + # how many (1 or 2) arguments were processed + __RETURN="2" + + # make sure arg2 is not an option (if it is, value defaults to "true") + if [ "x`echo $__VALUE | sed 's/^\(-\).*/\1/'`" = "x-" ] ; then + __VALUE="1" + __RETURN="1" + elif [ "x$__VALUE" = "x" ] ; then + __VALUE="1" + __RETURN="1" + fi + + # separate out __VAR if it is VAR=VALUE form + if [ ! "x`echo $__VAR | grep =`" = "x" ] ; then + __PVAR="`echo $__VAR | sed 's/^-*\([a-zA-Z_-]*\)=.*/\1/'`" + __PVAL="`echo $__VAR | sed 's/^-*\([a-zA-Z_-]*\)=\(.*\)/\2/'`" + if [ "x$__PVAR" = "x" ] ; then + warn "could not match $__VAR" + else + __VAR="$__PVAR" + __VALUE="$__PVAL" + __RETURN="1" + fi + fi + + # strip off leading dashes and underscores + __VAR="`echo $__VAR | sed 's/^[-_]*\(.*\)/\1/'`" + # convert to lowercase (because switches are stored as *lowercase*) + __VAR="`echo $__VAR | tr [:upper:]_ [:lower:]-`" + + [ ! "x$DEBUG" = "x" ] && log "using $__VAR == $__VALUE as argument" stderr + + # see if there are any options (for this group) registered + __IO="echo \$__INITIALIZED_OPTIONS_${__GROUP}" + __IO="`eval $__IO`" + if [ "x$__IO" = "x" ] ; then + warn "\"$__VAR\" is not a switch in the $__GROUP category, checking other categories" +# warn "No options in the specified category [${__GROUP}]" + __IO="$__INITIALIZED_OPTIONS_" + if [ "x$__IO" = "x" ] ; then + warn "No options match (no options initialized)!" + return 0 + fi + # return 0 + fi + + # there were options found, so iterate over their switches until we find it + for __i in $__IO ; do + for __j in `getOptionSwitches "$__i" "$__GROUP"` ; do + if [ "x$__j" = "x$__VAR" ] ; then + + # we FOUND it ... now validate the value + [ ! "x$DEBUG" = "x" ] && log "handleArgument: found $__VAR as valid switch for $__i option" stderr + + __options="`getOptionValues "$__i" "$__GROUP"`" + + for __val in $__options ; do + # expand the anything value keyword to match any value. + # we set to __match so that we can know which keyword we + # are on (useful for boolean below). + if [ "x$__val" = "x__ANYTHING__" ] ; then + __match="*" + # expand the boolean value keyword to match booleans (we + # cannot do it in outer loop since __BOOLEAN__ may be + # embedded with other options) + elif [ "x$__val" = "x__BOOLEAN__" ] ; then + __match="yes no true false 0 1" + elif [ "x$__val" = "x__NUMBER__" ] ; then + __match="[0123456789]*" + else + __match="$__val" + fi + + # check what was given + case $__VALUE in + $__match ) + __PVAR="${__i}=\"${__VALUE}\"" + eval $__PVAR + export ${__i} + [ ! "x$DEBUG" = "x" ] && log "handleArugment: matched $__match case for $__VALUE, set $__PVAR, returning $__RETURN" stderr + return $__RETURN + ;; + esac + + # more extensive backup checking here for non-exact or + # boolean matches. + for __val2 in $__match ; do + + # check case-insensitive version (we set var to + # original, though -- case-preserving, unless value + # is __BOOLEAN__) + __LCVALUE="`echo $__VALUE | tr [:upper:]_ [:lower:]-`" + if [ "x`echo $__val2 | tr [:upper:]_ [:lower:]-`" = "x$__LCVALUE" ] ; then + if [ "x$__val" = "x__BOOLEAN__" ] ; then + __PVAR="${__i}=\"${__LCVALUE}\"" + else + __PVAR="${__i}=\"${__VALUE}\"" + fi + eval $__PVAR + export ${__i} + + [ ! "x$DEBUG" = "x" ] && log "handleArugment: matched $__val2 insensitive case for $__VALUE, set $__PVAR, returning $__RETURN" stderr + return $__RETURN + fi + + done + + done + + # if we get to here, then we matched, but did not find a + # valid value. + [ ! "x$DEBUG" = "x" ] && warn "handleArgument: matched (${__VAR}) switch, but did NOT find (${__VALUE}) as a valid value" stderr + return 127 + fi + done + done + + [ ! "x$DEBUG" = "x" ] && warn "handleArgument: did NOT find (${__VAR}) as a valid switch" stderr + + return 0 +} + +# this is to avoid a freebsd /bin/sh pwd problem over nfs +# initializeVariable PWD "`pwd`" __library Property changes on: corredor/trunk/Resources/Source/Environment/Environment ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/x-sh Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Environment/ExecutionParameters.plist =================================================================== --- corredor/trunk/Resources/Source/Environment/ExecutionParameters.plist (rev 0) +++ corredor/trunk/Resources/Source/Environment/ExecutionParameters.plist 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,5 @@ +Description="Environement variable, option, and argument manipulation support " +Provides="Environment Variables Options Arguments" +Requires="Output" +Uses="Debug" +OrderPreference="None" Property changes on: corredor/trunk/Resources/Source/Environment/ExecutionParameters.plist ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Filesystem/ExecutionParameters.plist =================================================================== --- corredor/trunk/Resources/Source/Filesystem/ExecutionParameters.plist (rev 0) +++ corredor/trunk/Resources/Source/Filesystem/ExecutionParameters.plist 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,5 @@ +Description="Filesystem " +Provides="Filesystem Directory" +Requires="Output" +Uses="Debug" +OrderPreference="None" Property changes on: corredor/trunk/Resources/Source/Filesystem/ExecutionParameters.plist ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Filesystem/Filesystem =================================================================== --- corredor/trunk/Resources/Source/Filesystem/Filesystem (rev 0) +++ corredor/trunk/Resources/Source/Filesystem/Filesystem 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,76 @@ +#!/bin/sh +# +# F i l e s y s t e m +# +### +# +# directoryEqualsDirectory +# returns true or false if two directories are one in the same +# directoryContainsDirectory +# returns true or false if one directory contains another +# + + +# +# directoryEqualsDirectory containingDirectory directory +# +# returns a true/false depending on whether two directories are, in fact, +# one in the same. the mechanism used to detect equality are the directory +# inode numbers. +# +directoryEqualsDirectory ( ) { + [ ! "x$DEBUG" = "x" ] && log "directoryEqualsDirectory( \$1=[$1] \$2=[$2] )" + + if [ "x$1" = "x" ] ; then + bomb "directoryEqualsDirectory() arg1 mismatch" + else + __CDIR="$1" + fi + + if [ "x$2" = "x" ] ; then + bomb "directoryEqualsDirectory() arg2 mismatch" + else + __DIR="$2" + fi + + # get a unique identifier for the automation directory + CDIR_INODE="`ls -d -i $CDIR | awk '{print $1}'`" + DIR_INODE="`ls -d -i $DIR | awk '{print $1}'`" + + if [ "x$CDIR_INODE" = "x$DIR_INODE" ] ; then + return 1; + fi + return 0 +} + + +# +# directoryContainsDirectory containingDirectory directory +# +# returns a true/false depending on whether the second directory is +# contained within the first containing directory. The mechanism used +# to detect containment are the directory inode numbers. +# +directoryContainsDirectory ( ) { + [ ! "x$DEBUG" = "x" ] && log "directoryContainsDirectory( \$1=[$1] \$2=[$2] )" + + if [ "x$1" = "x" ] ; then + bomb "directoryContainsDirectory() arg1 mismatch" + else + __CDIR="$1" + fi + + if [ "x$2" = "x" ] ; then + bomb "directoryContainsDirectory() arg2 mismatch" + else + __DIR="$2" + fi + + # get a unique identifier for the automation directory + CDIR_INODE="`ls -d -i $CDIR | awk '{print $1}'`" + DIR_INODE="`ls -d -i $DIR | awk '{print $1}'`" + + + + return 0 +} Property changes on: corredor/trunk/Resources/Source/Filesystem/Filesystem ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/x-sh Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Input/ExecutionParameters.plist =================================================================== --- corredor/trunk/Resources/Source/Input/ExecutionParameters.plist (rev 0) +++ corredor/trunk/Resources/Source/Input/ExecutionParameters.plist 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,5 @@ +Description="Receive and parse input from the user"; +Provides="Input"; +Requires="Output"; +Uses="Debug"; +OrderPreference="None"; Property changes on: corredor/trunk/Resources/Source/Input/ExecutionParameters.plist ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Input/Input =================================================================== --- corredor/trunk/Resources/Source/Input/Input (rev 0) +++ corredor/trunk/Resources/Source/Input/Input 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,54 @@ +#!/bin/sh +# +# I n p u t +# +### +# +# ask +# ask a yes/no question until a valid response is given +# + + +# +# ask [question] +# +# ask simply asks a yes/no question until a valid answer is given. a boolean +# value is returned (true==yes) +# +ask ( ) { + [ ! "x$DEBUG" = "x" ] && log "ask( \$1=[$1] )" + + [ "x$1" = "x" ] || __QUESTION="$1" + + [ "x$__QUESTION" = "x" ] || log "$__QUESTION" + read __answer + [ ! "x$DEBUG" = "x" ] && log "ask: user responded with [$__answer] )" + case $__answer in + y[eE][sS] | Y[eE][sS] ) + __answer="yes" + ;; + n[oO] | N[oO] ) + __answer="no" + ;; + esac + while [ "x$__answer" != "xyes" ] && [ "x$__answer" != "xno" ] ; do + log "please answer yes or no" + [ "x$__QUESTION" = "x" ] || log "$__QUESTION" + read __answer + [ ! "x$DEBUG" = "x" ] && log "ask: user responded with [$__answer] )" + case $__answer in + Yes | yEs | yeS | YEs | YeS | yES | YES ) + __answer="yes" + ;; + No | nO | NO ) + __answer="no" + ;; + esac + done + + [ ! "x$DEBUG" = "x" ] && log "ask: returning yes/no 0/1 value (yes==0) of [$__answer] )" + + [ "x$__answer" = "xyes" ] && return 0 + return 1 +} + Property changes on: corredor/trunk/Resources/Source/Input/Input ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/x-sh Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Locking/ExecutionParameters.plist =================================================================== --- corredor/trunk/Resources/Source/Locking/ExecutionParameters.plist (rev 0) +++ corredor/trunk/Resources/Source/Locking/ExecutionParameters.plist 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,5 @@ +Description="File-based lock and semaphore support"; +Provides="Locking Locks Semaphores"; +Requires="Output"; +Uses="Debug"; +OrderPreference="None"; Property changes on: corredor/trunk/Resources/Source/Locking/ExecutionParameters.plist ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: corredor/trunk/Resources/Source/Locking/Locking =================================================================== --- corredor/trunk/Resources/Source/Locking/Locking (rev 0) +++ corredor/trunk/Resources/Source/Locking/Locking 2006-09-19 06:01:40 UTC (rev 2) @@ -0,0 +1,320 @@ +#!/bin/sh +# +# L o c k i n g +# +### +# +# acquireLock +# creates a cooperative lock file ("blocks" when one already exists) +# releaseLock +# releases and/or removes a cooperative lock file +# releaseAllLocks +# releases all locally acquired locks +# +# acquireSemaphore +# gets a cooperative file semaphore ("blocks" when one does not exist) +# releaseSemaphore +# releases and/or creates a cooperative file semaphore +# releaseAllSemaphores +# releases all locally acquired semaphores +# +# INTERNAL VARIABLES (do not use or rely on) +# +# __ACQUIRED_LOCKS +# __ACQUIRED_SEMAPHORES +# + + +# +# acquireLock [lockName] [retryCount] [waitLength] [location] +# +# will create a file that will block subsequent calls to acquireLock until the +# file lock is released. a ".lock" extension is appended automatically to +# distinguish between file locks and file semaphores. +# locks acquired are listed in the ACQUIRED_LOCKS global var +# +# if file exists then wait/fail +# else create lock file and log +# +acquireLock ( ) { + [ ! "x$DEBUG" = x ] && log "acquireLock( \$1=[$1] \$2=[$2] \$3=[$3] \$4=[$4] )" + + if [ "x$1" = x ] ; then __NAME="local" ; else __NAME="${1}" ; fi + if [ "x$2" = x ] ; then __RETRY=1 ; else __RETRY=$2 ; fi + if [ "x$3" = x ] ; then __WAIT=0 ; else __WAIT=$3 ; fi + if [ "x$4" = x ] ; then + # if we contain a slash, prefix is nothing (rooted or relative path + # name), otherwise use the current dir + __SWS=`echo $__NAME | sed 's/.*\/.*/___ROOTED_NAME___/'` + if [ "x$__SWS" = "x___ROOTED_NAME___" ] ; then __PREFIX="" ; else __PREFIX="./" ; fi + else + # if we end with a slash, no worries, otherwise, append one + __SWS=`echo $__NAME | sed 's/.*\/$/___END_SLASH___/'` + if [ "x$__SWS" = "x___END_SLASH___" ] ; then __PREFIX="$4" ; else __PREFIX="${4}/" ; fi + fi + __LOCK="${__NAME}.lock" + + [ ! "x$DEBUG" = "x" ] && log "acquireLock: before __ACQUIRED_LOCKS=[${__ACQUIRED_LOCKS}]" + + while [ -f ${__PREFIX}$__LOCK ] ; do + __RETRY=`expr $__RETRY - 1` + if [ $__RETRY -lt 1 ] ; then + warn "Unable to obtain $__LOCK in $__PREFIX" + + if [ ! "x$USER" = "x" ] ; then __USER="$USER" ; unset USER ; fi + if [ ! "x$PID" = "x" ] ; then __PID="$USER" ; unset PID ; fi + if [ ! "x$DATE" = "x" ] ; then __DATE="$USER" ; unset DATE ; fi + loadResourceFile "${__PREFIX}$__LOCK" + if [ ! "x$USER" = "x" ] ; then + log "Timed out waiting for ${USER}'s lock held since ${DATE} (pid: $PID)" + fi + if [ ! "x$__USER" = "x" ] ; then USER="$__USER" ; unset __USER ; fi + if [ ! "x$__PID" = "x" ] ; then PID="$__USER" ; unset __PID ; fi + if [ ! "x$__DATE" = "x" ] ; then DATE="$__USER" ; unset __DATE ; fi + + return 1 + fi + log "Waiting for $__LOCK ($__WAIT seconds)... $__RETRY attempts remain" + sleep $__WAIT + done + touch ${__PREFIX}$__LOCK + if [ ! -w ${__PREFIX}$__LOCK ] ; then + warn "Unable to write to lock file $__LOCK in ${__PREFIX}?" + fi + # save details about the acquiring process to the lock file + if [ ! "x$USER" = "x" ] ; then log "USER=\"$USER\"" "${__PREFIX}$__LOCK" ; else log "USER=\"unknown\"" "${__PREFIX}$__LOCK" ; fi + log "PID=\"$$\"" "${__PREFIX}$__LOCK" + log "DATE=\"`date`\"" "${__PREFIX}$__LOCK" + # keep a list of the acquired locks up to date + __ACQUIRED_LOCKS="$__ACQUIRED_LOCKS ${__PREFIX}$__NAME" ; export __ACQUIRED_LOCKS + [ ! "x$DEBUG" = "x" ] && log "acquireLock: after __ACQUIRED_LOCKS=[${__ACQUIRED_LOCKS}]" + + log "Acquired $__LOCK" + + return 0 +} + + +# +# releaseLock [lockName] [location] +# +# if file exists then remove and try unlog +# else warn and try unlog +# +releaseLock ( ) { + [ ! "x$DEBUG" = x ] && log "releaseLock( \$1=[$1] \$2=[$2] )" + + if [ "x$1" = x ] ; then __NAME="local" ; else __NAME="${1}" ; fi + if [ "x$2" = x ] ; then + # if we contain a slash, prefix is nothing (rooted or relative-path + # name), otherwise use a current dir + __SWS=`echo $__NAME | sed 's/.*\/.*/___ROOTED_NAME___/'` + if [ ! "x$DEBUG" = x ] ; then log "releaseLock: __SWS=[$__SWS]" ; fi + if [ "x$__SWS" = "x___ROOTED_NAME___" ] ; then __PREFIX="" ; else __PREFIX="./" ; fi + else + # if we end with a slash, no worries, otherwise, append one + __SWS=`echo $__NAME | sed 's/.*\/$/___END_SLASH___/'` + if [ "x$__SWS" = "x___END_SLASH___" ] ; then __PREFIX="$2" ; else __PREFIX="${2}/" ; fi + fi + __LOCK="${__NAME}.lock" + + if [ ! "x$DEBUG" = x ] ; then log "releaseLock: __PREFIX=[$__PREFIX] __LOCK=[$__LOCK]" ; fi + + [ ! "x$DEBUG" = "x" ] && log "releaseLock: before __ACQUIRED_LOCKS=[${__ACQUIRED_LOCKS}]" + + if [ ! -f "${__PREFIX}$__LOCK" ] ; then + warn "Lock [$__LOCK] is already released" + # make sure the lock is not registered + if [ ! "x$__ACQUIRED_LOCKS" = "x" ] ; then + __NEW__AL="" + for __CL in $__ACQUIRED_LOCKS ; do + if [ ! "x$__CL" = "x${__PREFIX}$__NAME" ] ; then + __NEW__AL="$__NEW__AL $__CL" + fi + done + __ACQUIRED_LOCKS="$__NEW__AL" ; export __ACQUIRED_LOCKS + fi + return 1 + fi + rm -f ${__PREFIX}$__LOCK + # unregister the lock with the __ACQUIRED_LOCKS var + if [ ! "x$__ACQUIRED_LOCKS" = "x" ] ; then + __NEW__AL="" + __FOUND_LOCK=0 + for __CL in $__ACQUIRED_LOCKS ; do + if [ "x$__CL" = "x${__PREFIX}$__NAME" ] ; then + __FOUND_LOCK=1 + else + __NEW__AL="$__NEW__AL $__CL" + fi + done + if [ ! "x$__FOUND_LOCK" = "x1" ] ; then + warn "bad bookkeeping -- __ACQUIRED_LOCKS is missing entry $__NAME [LOCK=${__PREFIX}${__NAME}] [__A_L=$__ACQUIRED_LOCKS]" + fi + __ACQUIRED_LOCKS="$__NEW__AL" ; export __ACQUIRED_LOCKS + else + warn "bad bookkeeping -- __ACQUIRED_LOCKS is empty prior to a release of $__NAME" + fi + [ ! "x$DEBUG" = "x" ] && log "releaseLock: after __ACQUIRED_LOCKS=[${__ACQUIRED_LOCKS}]" + + log "Released $__LOCK" + return 0 +} + +# +# releaseAllLocks +# +releaseAllLocks ( ) { + [ ! "x$DEBUG" = x ] && log "releaseAllLocks() __ACQUIRED_LOCKS=[$__ACQUIRED_LOCKS]" + + if [ ! "x$__ACQUIRED_LOCKS" = x ] ; then + for __LOCK in $__ACQUIRED_LOCKS ; do + releaseLock $__LOCK + done + fi +} + +# +# acquireSemaphore [semaphoreName] [retryCount] [waitLength] [location] +# +# if file exists then remove file and log +# else wait/fail +# +acquireSemaphore ( ) { + [ ! "x$DEBUG" = x ] && log "acquireSemaphore( \$1=[$1] \$2=[$2] \$3=[$3] \$4=[$4] )" + + if [ "x$1" = x ] ; then __NAME="local" ; else __NAME="${1}" ; fi + if [ "x$2" = x ] ; then __RETRY=1 ; else __RETRY=$2 ; fi + if [ "x$3" = x ] ; then __WAIT=0 ; else __WAIT=$3 ; fi + if [ "x$4" = x ] ; then + # if we start with a slash, prefix is nothing (rooted name), + # otherwise use a relative path + __SWS=`echo $__NAME | sed 's/^\/.*/___ROOTED_NAME___/'` + if [ "x$__SWS" = "x___ROOTED_NAME___" ] ; then __PREFIX="" ; else __PREFIX="./" ; fi + else + # if we end with a slash, no worries, otherwise, append one + __SWS=`echo $__NAME | sed 's/.*\/$/___END_SLASH___/'` + if [ "x$__SWS" = "x___END_SLASH___" ] ; then __PREFIX="$4" ; else __PREFIX="${4}/" ; fi + fi + __SEMAPHORE="${__NAME}.semaphore" + + while [ ! -f ${__PREFIX}$__SEMAPHORE ] ; do + __RETRY=`expr $__RETRY - 1` + if [ $__RETRY -lt 1 ] ; then + warn "Unable to obtain $__SEMAPHORE in $__PREFIX" + return 1 + fi + log "Waiting for $__SEMAPHORE ($__WAIT seconds)... $__RETRY attempts remain" + sleep $__WAIT + done + # we move instead of delete so that we can tell who has acquired the semaphore + mv -f "${__PREFIX}${__SEMAPHORE}" "${__PREFIX}${__SEMAPHORE}.acquired" + if [ ! -w "${__PREFIX}${__SEMAPHORE}.acquired" ] ; then + warn "Unable to write to acquired semaphore file ${__SEMAPHORE}.acquired in ${__PREFIX}" + fi + # sanity check - make sure file is gone + if [ -f "${__PREFIX}${__SEMAPHORE}" ] ; then + warn "Unable to properly remove/acquire semaphore file ${__SEMAPHORE} in ${__PREFIX}" + return 1 + fi + + if [ ! "x$USER" = "x" ] ; then log "USER=$USER" "${__PREFIX}${__SEMAPHORE}.acquired" ; else log "USER=unknown" "${__PREFIX}${__SEMAPHORE}.acquired" ; fi + log "PID=$$" "${__PREFIX}${__SEMAPHORE}.acquired" + log "DATE=`date`" "${__PREFIX}${__SEMAPHORE}.acquired" + + __ACQUIRED_SEMAPHORES="$__ACQUIRED_SEMAPHORES ${__PREFIX}$__NAME" ; exp... [truncated message content] |
From: <br...@us...> - 2006-09-04 03:03:58
|
Revision: 1 http://svn.sourceforge.net/corredor/?rev=1&view=rev Author: brlcad Date: 2006-09-03 20:03:53 -0700 (Sun, 03 Sep 2006) Log Message: ----------- initial import Added Paths: ----------- corredor/ corredor/branches/ corredor/tags/ corredor/trunk/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |