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 -e "Running PPSS on a client as part of a cluster."
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
}
@ -792,12 +792,11 @@ check_status () {
if [ ! "$ERROR" == "0" ]
then
log INFO "$FUNCTION - $MESSAGE"
log DSPLY "$FUNCTION - $MESSAGE"
set_status STOPPED
cleanup
exit 1
fi
}
erase_ppss () {
@ -1224,11 +1223,9 @@ download_item () {
upload_item () {
ITEM="$1"
ITEMDIR="$2"
log DEBUG "Uploading item $ITEM."
if [ "$SECURE_COPY" == "1" ]
then
@ -1297,7 +1294,7 @@ get_all_items () {
then
if [ "$RECURSION" == "1" ]
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."
else
log DEBUG "Recursion is disabled."
@ -1309,10 +1306,12 @@ get_all_items () {
then
if [ "$RECURSION" == "1" ]
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
log DEBUG "Recursion is disabled."
ITEMS=`ls -1 "$SRC_DIR"`
check_status "$?" "$FUNCNAME" "Could not list files within local source directory."
fi
else
ITEMS=""
@ -1932,6 +1931,7 @@ main () {
status )
LOGFILE=/dev/null
display_header
get_all_items
show_status
exit 0
;;

View File

@ -41,7 +41,7 @@ oneTimeSetUp () {
testVersion () {
RES=`./$PPSS -v`
RES=`$PPSS -v`
for x in $RES
do
@ -95,7 +95,7 @@ testRecursion () {
createDirectoryWithSomeFiles
#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 "$?"
NUMBER=`find /tmp/$TMP_DIR ! -type d | wc -l`
@ -111,7 +111,7 @@ testSpacesInFilenames () {
createDirectoryWithSomeFiles
#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 "$?"
assertNull "PPSS retured some errors..." "$RES"
@ -133,7 +133,7 @@ testSpacesInFilenames () {
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 "$?"
assertNull "PPSS retured some errors..." "$RES"
@ -158,28 +158,28 @@ testSkippingOfProcessedItems () {
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 "$?"
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 "$?"
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 "$?"
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 "$?"
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 "$?"
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 "$?"
rm -rf "/tmp/$TMP_DIR"
@ -188,7 +188,7 @@ testSkippingOfProcessedItems () {
testExistLogFiles () {
./$PPSS -f "$INPUTFILENORMAL" -c 'echo "$ITEM"' >> /dev/null
$PPSS -f "$INPUTFILENORMAL" -c 'echo "$ITEM"' >> /dev/null
assertEquals "PPSS did not execute properly." 0 "$?"
for x in $NORMALTESTFILES
@ -205,11 +205,11 @@ getStatusOfJob () {
if [ "$EXPECTED" == "SUCCESS" ]
then
./$PPSS -f "$INPUTFILENORMAL" -c 'echo ' >> /dev/null
$PPSS -f "$INPUTFILENORMAL" -c 'echo ' >> /dev/null
assertEquals "PPSS did not execute properly." 0 "$?"
elif [ "$EXPECTED" == "FAILURE" ]
then
./$PPSS -f "$INPUTFILENORMAL" -c 'thiscommandfails ' >> /dev/null
$PPSS -f "$INPUTFILENORMAL" -c 'thiscommandfails ' >> /dev/null
assertEquals "PPSS did not execute properly." 0 "$?"
fi