This commit is contained in:
Louwrentius 2010-03-06 23:26:07 +00:00
parent 789db609c9
commit 0f8dced209
2 changed files with 20 additions and 20 deletions

14
ppss
View File

@ -267,7 +267,7 @@ showusage_long () {
echo echo
echo -e "Running PPSS on a client as part of a cluster." echo -e "Running PPSS on a client as part of a cluster."
echo echo
echo -e "$0 -d /somedir -c 'cp "$ITEM" /some/destination' -s 10.0.0.50 -u ppss -t -k ppss-key.key" echo -e "$0 -d /somedir -c 'cp "$ITEM" /some/destination' -m 10.0.0.50 -u ppss -t -k ppss-key.key"
echo echo
} }
@ -792,12 +792,11 @@ check_status () {
if [ ! "$ERROR" == "0" ] if [ ! "$ERROR" == "0" ]
then then
log INFO "$FUNCTION - $MESSAGE" log DSPLY "$FUNCTION - $MESSAGE"
set_status STOPPED set_status STOPPED
cleanup cleanup
exit 1 exit 1
fi fi
} }
erase_ppss () { erase_ppss () {
@ -1224,11 +1223,9 @@ download_item () {
upload_item () { upload_item () {
ITEM="$1" ITEM="$1"
ITEMDIR="$2" ITEMDIR="$2"
log DEBUG "Uploading item $ITEM." log DEBUG "Uploading item $ITEM."
if [ "$SECURE_COPY" == "1" ] if [ "$SECURE_COPY" == "1" ]
then then
@ -1297,7 +1294,7 @@ get_all_items () {
then then
if [ "$RECURSION" == "1" ] if [ "$RECURSION" == "1" ]
then then
ITEMS=`exec_cmd "find $SRC_DIR ! -type d"` ITEMS=`exec_cmd "find $SRC_DIR/ ! -type d"`
check_status "$?" "$FUNCNAME" "Could not list files within remote source directory." check_status "$?" "$FUNCNAME" "Could not list files within remote source directory."
else else
log DEBUG "Recursion is disabled." log DEBUG "Recursion is disabled."
@ -1309,10 +1306,12 @@ get_all_items () {
then then
if [ "$RECURSION" == "1" ] if [ "$RECURSION" == "1" ]
then then
ITEMS=`find "$SRC_DIR" ! -type d` ITEMS=`find "$SRC_DIR/" ! -type d`
check_status "$?" "$FUNCNAME" "Could not list files within local source directory."
else else
log DEBUG "Recursion is disabled." log DEBUG "Recursion is disabled."
ITEMS=`ls -1 "$SRC_DIR"` ITEMS=`ls -1 "$SRC_DIR"`
check_status "$?" "$FUNCNAME" "Could not list files within local source directory."
fi fi
else else
ITEMS="" ITEMS=""
@ -1932,6 +1931,7 @@ main () {
status ) status )
LOGFILE=/dev/null LOGFILE=/dev/null
display_header display_header
get_all_items
show_status show_status
exit 0 exit 0
;; ;;

View File

@ -41,7 +41,7 @@ oneTimeSetUp () {
testVersion () { testVersion () {
RES=`./$PPSS -v` RES=`$PPSS -v`
for x in $RES for x in $RES
do do
@ -95,7 +95,7 @@ testRecursion () {
createDirectoryWithSomeFiles createDirectoryWithSomeFiles
#Execution of PPSS with recursion disabled. #Execution of PPSS with recursion disabled.
RES=$( { ./$PPSS -d /tmp/$TMP_DIR -c 'ls -alh ' -r >> /dev/null ; } 2>&1 ) RES=$( { $PPSS -d /tmp/$TMP_DIR -c 'ls -alh ' -r >> /dev/null ; } 2>&1 )
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
NUMBER=`find /tmp/$TMP_DIR ! -type d | wc -l` NUMBER=`find /tmp/$TMP_DIR ! -type d | wc -l`
@ -111,7 +111,7 @@ testSpacesInFilenames () {
createDirectoryWithSomeFiles createDirectoryWithSomeFiles
#Regular execution of PPSS #Regular execution of PPSS
RES=$( { ./$PPSS -d /tmp/$TMP_DIR -c 'ls -alh ' >> /dev/null ; } 2>&1 ) RES=$( { $PPSS -d /tmp/$TMP_DIR -c 'ls -alh ' >> /dev/null ; } 2>&1 )
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
assertNull "PPSS retured some errors..." "$RES" assertNull "PPSS retured some errors..." "$RES"
@ -133,7 +133,7 @@ testSpacesInFilenames () {
testSpecialCharacterHandling () { testSpecialCharacterHandling () {
RES=$( { ./$PPSS -f "$INPUTFILESPECIAL" -c 'echo ' >> /dev/null ; } 2>&1 ) RES=$( { $PPSS -f "$INPUTFILESPECIAL" -c 'echo ' >> /dev/null ; } 2>&1 )
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
assertNull "PPSS retured some errors..." "$RES" assertNull "PPSS retured some errors..." "$RES"
@ -158,28 +158,28 @@ testSkippingOfProcessedItems () {
createDirectoryWithSomeFiles createDirectoryWithSomeFiles
RES=$( { ./$PPSS -d /tmp/$TMP_DIR -c 'echo ' >> /dev/null ; } 2>&1 ) RES=$( { $PPSS -d /tmp/$TMP_DIR -c 'echo ' >> /dev/null ; } 2>&1 )
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
assertNull "PPSS retured some errors..." "$RES" assertNull "PPSS retured some errors..." "$RES"
RES=$( { ./$PPSS -d /tmp/$TMP_DIR -c 'echo ' >> /dev/null ; } 2>&1 ) RES=$( { $PPSS -d /tmp/$TMP_DIR -c 'echo ' >> /dev/null ; } 2>&1 )
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
assertNull "PPSS retured some errors..." "$RES" assertNull "PPSS retured some errors..." "$RES"
grep -i skip ./$PPSS_dir/* >> /dev/null 2>&1 grep -i skip ./$PPSS_DIR/* >> /dev/null 2>&1
assertEquals "Skipping of items went wrong." 0 "$?" assertEquals "Skipping of items went wrong." 0 "$?"
rename-ppss-dir $FUNCNAME-1 rename-ppss-dir $FUNCNAME-1
RES=$( { ./$PPSS -f $INPUTFILESPECIAL -c 'echo ' >> /dev/null ; } 2>&1 ) RES=$( { $PPSS -f $INPUTFILESPECIAL -c 'echo ' >> /dev/null ; } 2>&1 )
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
assertNull "PPSS retured some errors..." "$RES" assertNull "PPSS retured some errors..." "$RES"
RES=$( { ./$PPSS -f $INPUTFILESPECIAL -c 'echo ' >> /dev/null ; } 2>&1 ) RES=$( { $PPSS -f $INPUTFILESPECIAL -c 'echo ' >> /dev/null ; } 2>&1 )
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
assertNull "PPSS retured some errors..." "$RES" assertNull "PPSS retured some errors..." "$RES"
grep -i skip ./$PPSS_dir/* >> /dev/null 2>&1 grep -i skip ./$PPSS_DIR/* >> /dev/null 2>&1
assertEquals "Skipping of items went wrong." 0 "$?" assertEquals "Skipping of items went wrong." 0 "$?"
rm -rf "/tmp/$TMP_DIR" rm -rf "/tmp/$TMP_DIR"
@ -188,7 +188,7 @@ testSkippingOfProcessedItems () {
testExistLogFiles () { testExistLogFiles () {
./$PPSS -f "$INPUTFILENORMAL" -c 'echo "$ITEM"' >> /dev/null $PPSS -f "$INPUTFILENORMAL" -c 'echo "$ITEM"' >> /dev/null
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
for x in $NORMALTESTFILES for x in $NORMALTESTFILES
@ -205,11 +205,11 @@ getStatusOfJob () {
if [ "$EXPECTED" == "SUCCESS" ] if [ "$EXPECTED" == "SUCCESS" ]
then then
./$PPSS -f "$INPUTFILENORMAL" -c 'echo ' >> /dev/null $PPSS -f "$INPUTFILENORMAL" -c 'echo ' >> /dev/null
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
elif [ "$EXPECTED" == "FAILURE" ] elif [ "$EXPECTED" == "FAILURE" ]
then then
./$PPSS -f "$INPUTFILENORMAL" -c 'thiscommandfails ' >> /dev/null $PPSS -f "$INPUTFILENORMAL" -c 'thiscommandfails ' >> /dev/null
assertEquals "PPSS did not execute properly." 0 "$?" assertEquals "PPSS did not execute properly." 0 "$?"
fi fi