summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucian Musat <george.l.musat@intel.com>2015-06-26 13:36:40 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-27 22:42:55 +0100
commit608bf2228d2903e5be80f1281f0e8dcaf7716143 (patch)
treef1e8857de0b61b3bf2a4e84592932c7aaf7daec2
parent871efa6a8266919292b51a7e60519ed1c8ca82e1 (diff)
downloadpoky-608bf2228d2903e5be80f1281f0e8dcaf7716143.tar.gz
oeqa/parselogs: Fixed a problem in parselogs
When the test passed it returned an error because grep did not return any error and the variable that held the results was being referenced but not assigned any value. (From OE-Core rev: 0f5c2fb975010cf6e8154384b764a2c9da1b371e) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/runtime/parselogs.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/lib/oeqa/runtime/parselogs.py b/meta/lib/oeqa/runtime/parselogs.py
index a9ab9a3462..7095a365b4 100644
--- a/meta/lib/oeqa/runtime/parselogs.py
+++ b/meta/lib/oeqa/runtime/parselogs.py
@@ -198,6 +198,7 @@ class ParseLogsTest(oeRuntimeTest):
198 def parse_logs(self, errors, ignore_errors, logs, lines_before = 10, lines_after = 10): 198 def parse_logs(self, errors, ignore_errors, logs, lines_before = 10, lines_after = 10):
199 results = {} 199 results = {}
200 rez = [] 200 rez = []
201 grep_output = ''
201 for log in logs: 202 for log in logs:
202 result = None 203 result = None
203 thegrep = self.build_grepcmd(errors, ignore_errors, log) 204 thegrep = self.build_grepcmd(errors, ignore_errors, log)
@@ -211,10 +212,10 @@ class ParseLogsTest(oeRuntimeTest):
211 for xrez in rez: 212 for xrez in rez:
212 command = "grep \"\\"+str(xrez)+"\" -B "+str(lines_before)+" -A "+str(lines_after)+" "+str(log) 213 command = "grep \"\\"+str(xrez)+"\" -B "+str(lines_before)+" -A "+str(lines_after)+" "+str(log)
213 try: 214 try:
214 yrez = subprocess.check_output(command, shell=True) 215 grep_output = subprocess.check_output(command, shell=True)
215 except: 216 except:
216 pass 217 pass
217 results[log.replace('target_logs/','')][xrez]=yrez 218 results[log.replace('target_logs/','')][xrez]=grep_output
218 return results 219 return results
219 220
220 #get the output of dmesg and write it in a file. This file is added to log_locations. 221 #get the output of dmesg and write it in a file. This file is added to log_locations.