summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-09 13:19:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-08 23:47:14 +0000
commite92679a6eb3ae7ee0288071d459d7fe1a5adc39c (patch)
tree5363c786841025054bf351af4e1aa9fb764d3972
parentf979c500290b7ac38a338693c4856f3ed7930a2b (diff)
downloadpoky-e92679a6eb3ae7ee0288071d459d7fe1a5adc39c.tar.gz
oeqa/parselogs: Don't use cwd for file transfers
If you run: MACHINE=A bitbake <image> -c testimage MACHINE=B bitbake <image> -c testimage and A has errors in parselogs, machine B can pick these up and cause immense confusion. This is because the test transfers the log files to cwd which is usually TOPDIR. This is clearly bad and this patch uses a subdir of WORKDIR to ensure machines don't contaminate each other. Also ensure any previous logs are cleaned up from any existing transfer directory. (From OE-Core rev: ac8f1e58ca3a0945795087cad9443be3e3e6ead8) (From OE-Core rev: 64ff5be5909705395b2db8d64e8d2c2c76092e1c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/runtime/parselogs.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/lib/oeqa/runtime/parselogs.py b/meta/lib/oeqa/runtime/parselogs.py
index 116cb0b03d..477b0511d2 100644
--- a/meta/lib/oeqa/runtime/parselogs.py
+++ b/meta/lib/oeqa/runtime/parselogs.py
@@ -169,6 +169,9 @@ class ParseLogsTest(oeRuntimeTest):
169 def getMachine(self): 169 def getMachine(self):
170 return oeRuntimeTest.tc.d.getVar("MACHINE", True) 170 return oeRuntimeTest.tc.d.getVar("MACHINE", True)
171 171
172 def getWorkdir(self):
173 return oeRuntimeTest.tc.d.getVar("WORKDIR", True)
174
172 #get some information on the CPU of the machine to display at the beginning of the output. This info might be useful in some cases. 175 #get some information on the CPU of the machine to display at the beginning of the output. This info might be useful in some cases.
173 def getHardwareInfo(self): 176 def getHardwareInfo(self):
174 hwi = "" 177 hwi = ""
@@ -206,16 +209,19 @@ class ParseLogsTest(oeRuntimeTest):
206 209
207 #copy the log files to be parsed locally 210 #copy the log files to be parsed locally
208 def transfer_logs(self, log_list): 211 def transfer_logs(self, log_list):
209 target_logs = 'target_logs' 212 workdir = self.getWorkdir()
213 self.target_logs = workdir + '/' + 'target_logs'
214 target_logs = self.target_logs
210 if not os.path.exists(target_logs): 215 if not os.path.exists(target_logs):
211 os.makedirs(target_logs) 216 os.makedirs(target_logs)
217 bb.utils.remove(self.target_logs + "/*")
212 for f in log_list: 218 for f in log_list:
213 self.target.copy_from(f, target_logs) 219 self.target.copy_from(f, target_logs)
214 220
215 #get the local list of logs 221 #get the local list of logs
216 def get_local_log_list(self, log_locations): 222 def get_local_log_list(self, log_locations):
217 self.transfer_logs(self.getLogList(log_locations)) 223 self.transfer_logs(self.getLogList(log_locations))
218 logs = [ os.path.join('target_logs',f) for f in os.listdir('target_logs') if os.path.isfile(os.path.join('target_logs',f)) ] 224 logs = [ os.path.join(self.target_logs, f) for f in os.listdir(self.target_logs) if os.path.isfile(os.path.join(self.target_logs, f)) ]
219 return logs 225 return logs
220 226
221 #build the grep command to be used with filters and exclusions 227 #build the grep command to be used with filters and exclusions