More small fixes.
This commit is contained in:
		
							parent
							
								
									f2ccafefc6
								
							
						
					
					
						commit
						7d0815528e
					
				
							
								
								
									
										79
									
								
								ppss-test.sh
									
									
									
									
									
								
							
							
						
						
									
										79
									
								
								ppss-test.sh
									
									
									
									
									
								
							@ -2,6 +2,7 @@
 | 
			
		||||
 | 
			
		||||
DEBUG="$1"
 | 
			
		||||
VERSION=2.45
 | 
			
		||||
TMP_DIR="ppss"
 | 
			
		||||
 | 
			
		||||
cleanup () {
 | 
			
		||||
 | 
			
		||||
@ -14,6 +15,16 @@ cleanup () {
 | 
			
		||||
    done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
parseJobStatus () {
 | 
			
		||||
 | 
			
		||||
    TMP_FILE="$1"
 | 
			
		||||
 | 
			
		||||
    RES=`grep "Status:" "$JOBLOG/$TMP_FILE"`
 | 
			
		||||
    STATUS=`echo "$RES" | awk '{ print $2 }'`
 | 
			
		||||
    echo "$STATUS"
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
oneTimeSetUp () {
 | 
			
		||||
 | 
			
		||||
	NORMALTESTFILES=`echo test-{a..z}`
 | 
			
		||||
@ -70,6 +81,39 @@ oneTimeTearDown () {
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
createDirectoryWithSomeFiles () {
 | 
			
		||||
 | 
			
		||||
    A="File with Spaces"
 | 
			
		||||
    B="File\With\Slashes"
 | 
			
		||||
 | 
			
		||||
    mkdir "/tmp/$TMP_DIR"
 | 
			
		||||
    for x in "$A" "$B"
 | 
			
		||||
    do
 | 
			
		||||
        TMP_FILE="/tmp/$TMP_DIR/$x"
 | 
			
		||||
        touch "$TMP_FILE"
 | 
			
		||||
    done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
testSpacesInFilenames () {
 | 
			
		||||
 | 
			
		||||
    createDirectoryWithSomeFiles
 | 
			
		||||
 | 
			
		||||
    RES=$( { ./ppss.sh -d /tmp/$TMP_DIR -c 'ls -alh ' >> /dev/null ; } 2>&1 )  
 | 
			
		||||
	assertEquals "PPSS did not execute properly." 0 "$?"
 | 
			
		||||
 | 
			
		||||
    assertNull "PPSS retured some errors..." "$RES"
 | 
			
		||||
    if [ ! "$?" == "0" ]
 | 
			
		||||
    then
 | 
			
		||||
        echo "RES IS $RES"
 | 
			
		||||
    fi
 | 
			
		||||
    
 | 
			
		||||
    grep "SUCCESS" $JOBLOG/* >> /dev/null 2>&1
 | 
			
		||||
    assertEquals "Found error with space in filename $TMP_FILE" "0" "$?"
 | 
			
		||||
 | 
			
		||||
    rm -rf "/tmp/$TMP_DIR"   
 | 
			
		||||
    rename-ppss-dir $FUNCNAME
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
testSpecialCharacterHandling () {
 | 
			
		||||
 | 
			
		||||
    RES=$( { ./ppss.sh -f "$INPUTFILESPECIAL" -c 'echo ' >> /dev/null ; } 2>&1 )  
 | 
			
		||||
@ -92,6 +136,38 @@ testSpecialCharacterHandling () {
 | 
			
		||||
    rename-ppss-dir $FUNCNAME
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
testSkippingOfProcessedItems () {
 | 
			
		||||
 | 
			
		||||
    createDirectoryWithSomeFiles    
 | 
			
		||||
 | 
			
		||||
    RES=$( { ./ppss.sh -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.sh -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/* >> /dev/null 2>&1
 | 
			
		||||
    assertEquals "Skipping of items went wrong." 0 "$?"
 | 
			
		||||
 | 
			
		||||
    rename-ppss-dir $FUNCNAME-1
 | 
			
		||||
 | 
			
		||||
    RES=$( { ./ppss.sh -f $INPUTFILESPECIAL -c 'echo ' >> /dev/null ; } 2>&1 )
 | 
			
		||||
    assertEquals "PPSS did not execute properly." 0 "$?"
 | 
			
		||||
    assertNull "PPSS retured some errors..." "$RES"
 | 
			
		||||
 | 
			
		||||
    RES=$( { ./ppss.sh -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/* >> /dev/null 2>&1
 | 
			
		||||
    assertEquals "Skipping of items went wrong." 0 "$?"
 | 
			
		||||
 | 
			
		||||
    rm -rf "/tmp/$TMP_DIR"   
 | 
			
		||||
    rename-ppss-dir $FUNCNAME-2
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
testExistLogFiles () {
 | 
			
		||||
 | 
			
		||||
	./ppss.sh -f "$INPUTFILENORMAL" -c 'echo "$ITEM"' >> /dev/null
 | 
			
		||||
@ -121,8 +197,7 @@ getStatusOfJob () {
 | 
			
		||||
 | 
			
		||||
	for x in $NORMALTESTFILES
 | 
			
		||||
	do
 | 
			
		||||
		RES=`grep "Status:" "$JOBLOG/$x"`
 | 
			
		||||
        STATUS=`echo "$RES" | awk '{ print $2 }'`
 | 
			
		||||
        STATUS=`parseJobStatus "$x"`
 | 
			
		||||
        assertEquals "FAILED WITH STATUS $STATUS." "$EXPECTED" "$STATUS"
 | 
			
		||||
    done
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								ppss.sh
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								ppss.sh
									
									
									
									
									
								
							@ -1403,7 +1403,7 @@ commando () {
 | 
			
		||||
        ITEM="./$PPSS_LOCAL_TMPDIR/$ITEM_NO_PATH"
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    LOG_FILE_NAME=`echo "$ITEM" | sed s/^\\\.//g | sed s/^\\\.\\\.//g | sed s/\\\///g`
 | 
			
		||||
    LOG_FILE_NAME=`echo "$ITEM" | sed s/^\\\.//g | sed s/^\\\.\\\.//g | sed s/\\\///g | sed s/\\ /_/g`
 | 
			
		||||
    ITEM_LOG_FILE="$JOB_LOG_DIR/$LOG_FILE_NAME"
 | 
			
		||||
 | 
			
		||||
    OUTPUT_DIR=$PPSS_LOCAL_OUTPUT/"$LOG_FILE_NAME"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user