summaryrefslogtreecommitdiff
blob: 5d8d55b886f40756a2e47fe8fb600ab8ca0e3926 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
Index: ltp-full-20120903/runltp
===================================================================
--- ltp-full-20120903.orig/runltp
+++ ltp-full-20120903/runltp
@@ -76,7 +76,7 @@ setup()
         echo "FATAL: unable to change directory to $(dirname $0)"
         exit 1
     }
-    export LTPROOT=${PWD}
+    export LTPROOT=/usr/libexec/ltp
     export TMPBASE="/tmp"
     export PATH="${PATH}:${LTPROOT}/testcases/bin"
 
@@ -230,7 +230,7 @@ main()
             /*)
                 FAILCMDFILE="-C $OPTARG" ;;
             *)    
-                FAILCMDFILE="-C $LTPROOT/output/$OPTARG"
+                FAILCMDFILE="-C $TMPBASE/output/$OPTARG"
                 ALT_DIR_OUT=1 ;;
             esac ;;
                    
@@ -298,7 +298,7 @@ main()
             /*)
                 HTMLFILE="$OPTARG";;
             *)
-                HTMLFILE="$LTPROOT/output/$OPTARG";;
+                HTMLFILE="$TMPBASE/output/$OPTARG";;
             esac
             ALT_DIR_OUT=1 
             ALT_HTML_OUT=1;;
@@ -319,7 +319,7 @@ main()
         	   /*)
                 	DMESG_DIR="$OPTARG-dmesg-output-`echo $$-``date +%X | tr -d ' '`";;
 	            *)
-        	        DMESG_DIR="$LTPROOT/output/$OPTARG-dmesg-output-`echo $$-``date +%X | tr -d ' '`";;
+        	        DMESG_DIR="$TMPBASE/output/$OPTARG-dmesg-output-`echo $$-``date +%X | tr -d ' '`";;
 	    esac
             mkdir -p $DMESG_DIR
             ALT_DMESG_OUT=1;;
@@ -329,7 +329,7 @@ main()
             /*)
                 LOGFILE="-l $OPTARG" ;;
             *)    
-                LOGFILE="-l $LTPROOT/results/$OPTARG"
+                LOGFILE="-l $TMPBASE/results/$OPTARG"
                 ALT_DIR_RES=1 ;;
             esac ;;
     
@@ -384,7 +384,7 @@ main()
             /*)
                 OUTPUTFILE="-o $OPTARG";;
             *)
-                OUTPUTFILE="-o $LTPROOT/output/$OPTARG"
+                OUTPUTFILE="-o $TMPBASE/output/$OPTARG"
                 ALT_DIR_OUT=1 ;;
             esac ;;
     
@@ -431,7 +431,7 @@ main()
     ## It would be nice to create a default log file even if the user has not mentioned
     if [ ! "$LOGFILE" ]; then                                ## User has not mentioned about Log File name
        LOGFILE_NAME=$DEFAULT_FILE_NAME_GENERATION_TIME
-       LOGFILE="-l $LTPROOT/results/LTP_RUN_ON-$LOGFILE_NAME.log"
+       LOGFILE="-l $TMPBASE/results/LTP_RUN_ON-$LOGFILE_NAME.log"
        ALT_DIR_RES=1
        PRETTY_PRT=" -p "
     fi
@@ -443,14 +443,14 @@ main()
          if [ ! "$OUTPUTFILE" ]; then		             ## User has not mentioned about Output File name either
             if [ ! "$LOGFILE" ]; then                        ## User has not mentioned about Log File name either
                FAILED_FILE_NAME=$DEFAULT_FILE_NAME_GENERATION_TIME
-               FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed"
+               FAILCMDFILE="-C $TMPBASE/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed"
             else					     ## User Fortunately wanted a log file,
                FAILED_FILE_NAME=`basename $LOGFILE_NAME`     ## Extract log file name and use it to construct Failed file name
-               FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed"
+               FAILCMDFILE="-C $TMPBASE/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed"
             fi
          else                                                ## User Fortunately wanted a Output file
                FAILED_FILE_NAME=`basename $OUTPUTFILE_NAME`  ## Extract output file name and use it to construct Failed file name
-               FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed"
+               FAILCMDFILE="-C $TMPBASE/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed"
          fi
     fi
 
@@ -459,11 +459,11 @@ main()
                                                              ## which the HTML parser will require
        if [ ! "$OUTPUTFILE" ]; then                          ## User has not mentioned about the Outputfile name, then we need to definitely generate one
           OUTPUTFILE_NAME=$DEFAULT_FILE_NAME_GENERATION_TIME
-          OUTPUTFILE="-o $LTPROOT/output/LTP_RUN_ON-$OUTPUTFILE_NAME.output"
+          OUTPUTFILE="-o $TMPBASE/output/LTP_RUN_ON-$OUTPUTFILE_NAME.output"
           ALT_DIR_OUT=1
           if [ ! "$HTMLFILE" ] ; then                        ## User has not mentioned HTML File name, We need to create one
              HTMLFILE_NAME=`basename $OUTPUTFILE_NAME`
-             HTMLFILE="$LTPROOT/output/$HTMLFILE_NAME.html"
+             HTMLFILE="$TMPBASE/output/$HTMLFILE_NAME.html"
           fi
        fi
     fi
@@ -471,12 +471,12 @@ main()
     # If we need, create the output directory
     [ "$ALT_DIR_OUT" -eq 1 ] && \
     {
-        [ ! -d $LTPROOT/output ] && \
+        [ ! -d $TMPBASE/output ] && \
         {
-           echo "INFO: creating $LTPROOT/output directory"
-           mkdir -p $LTPROOT/output || \
+           echo "INFO: creating $TMPBASE/output directory"
+           mkdir -p $TMPBASE/output || \
            {
-               echo "ERROR: failed to create $LTPROOT/output"
+               echo "ERROR: failed to create $TMPBASE/output"
                exit 1
             }
         }
@@ -484,12 +484,12 @@ main()
     # If we need, create the results directory
     [ "$ALT_DIR_RES" -eq 1 ] && \
     {
-        echo "INFO: creating $LTPROOT/results directory"
-        [ ! -d $LTPROOT/results ] && \
+        echo "INFO: creating $TMPBASE/results directory"
+        [ ! -d $TMPBASE/results ] && \
         {
-           mkdir -p $LTPROOT/results || \
+           mkdir -p $TMPBASE/results || \
            {
-               echo "ERROR: failed to create $LTPROOT/results"
+               echo "ERROR: failed to create $TMPBASE/results"
                exit 1
             }
         }
@@ -867,8 +867,8 @@ main()
        export TEST_START_TIME=$test_start_time
        export TEST_END_TIME=$(date)
        OUTPUT_DIRECTORY=`echo $OUTPUTFILE | cut -c4-`
-       LOGS_DIRECTORY="$LTPROOT/results"
-       export TEST_OUTPUT_DIRECTORY="$LTPROOT/output"
+       LOGS_DIRECTORY="$TMPBASE/results"
+       export TEST_OUTPUT_DIRECTORY="$TMPBASE/output"
        export TEST_LOGS_DIRECTORY=$LOGS_DIRECTORY
        echo "Generating HTML Output.....!!"
        ( perl $LTPROOT/bin/genhtml.pl $LTPROOT/bin/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_DIRECTORY  > $HTMLFILE; )   
@@ -884,37 +884,37 @@ main()
        else
            TAR_FILE_NAME=LTP_RUN_$version_date$DEFAULT_FILE_NAME_GENERATION_TIME.tar
            if [ "$HTMLFILE_NAME" ] ; then                          ## HTML file Exists
-              if [ "$ALT_HTML_OUT" -ne 1 ] ; then                  ## The HTML file path is absolute and not $LTPROOT/output
-                 mkdir -p $LTPROOT/output                          ## We need to create this Directory
-                 cp $HTMLFILE_NAME $LTPROOT/output/
+              if [ "$ALT_HTML_OUT" -ne 1 ] ; then                  ## The HTML file path is absolute and not $TMPBASE/output
+                 mkdir -p $TMPBASE/output                          ## We need to create this Directory
+                 cp $HTMLFILE_NAME $TMPBASE/output/
               fi
            fi
            if [ "$OUTPUTFILE_NAME" ] ; then                        ## Output file exists
-              if [ "$ALT_DIR_OUT" -ne 1 ] ; then                   ## The Output file path is absolute and not $LTPROOT/output
-                 mkdir -p $LTPROOT/output                          ## We need to create this Directory
-                 cp $OUTPUTFILE_NAME $LTPROOT/output/
+              if [ "$ALT_DIR_OUT" -ne 1 ] ; then                   ## The Output file path is absolute and not $TMPBASE/output
+                 mkdir -p $TMPBASE/output                          ## We need to create this Directory
+                 cp $OUTPUTFILE_NAME $TMPBASE/output/
               fi
            fi
            if [ "$LOGFILE_NAME" ] ; then                           ## Log file exists
-              if [ "$ALT_DIR_RES" -ne 1 ] ; then                   ## The Log file path is absolute and not $LTPROOT/results
-                 mkdir -p $LTPROOT/results                         ## We need to create this Directory
-                 cp $LOGFILE_NAME $LTPROOT/results/
+              if [ "$ALT_DIR_RES" -ne 1 ] ; then                   ## The Log file path is absolute and not $TMPBASE/results
+                 mkdir -p $TMPBASE/results                         ## We need to create this Directory
+                 cp $LOGFILE_NAME $TMPBASE/results/
               fi
            fi
-           if [ -d $LTPROOT/output ] ; then
-              tar -cf  ./$TAR_FILE_NAME $LTPROOT/output
+           if [ -d $TMPBASE/output ] ; then
+              tar -cf  ./$TAR_FILE_NAME $TMPBASE/output
               if [ $? -eq 0 ]; then
-                 echo "Created TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/output"
+                 echo "Created TAR File: ./$TAR_FILE_NAME successfully, added $TMPBASE/output"
               else
-                 echo "Cannot Create TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/output"
+                 echo "Cannot Create TAR File: ./$TAR_FILE_NAME for adding $TMPBASE/output"
               fi
            fi
-           if [ -d $LTPROOT/results ] ; then
-              tar -uf ./$TAR_FILE_NAME $LTPROOT/results
+           if [ -d $TMPBASE/results ] ; then
+              tar -uf ./$TAR_FILE_NAME $TMPBASE/results
               if [ $? -eq 0 ]; then
-                 echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/results"
+                 echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added $TMPBASE/results"
               else
-                 echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/results"
+                 echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding $TMPBASE/results"
               fi
            fi
            if [ -e $LTPROOT/nohup.out ] ; then                     ## If User would have Chosen nohup to do ltprun