summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa/runtime
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2016-01-14 15:08:37 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-19 17:37:23 +0000
commitbfc8304d4c10b5601a618011893369831baaf511 (patch)
tree3f83d9a47b7acacd347e30f8b4604f5735c08111 /meta/lib/oeqa/runtime
parent7f6a5d2721631de5d6d2ce672c5a2879897354c4 (diff)
downloadopenembedded-core-bfc8304d4c10b5601a618011893369831baaf511.tar.gz
openembedded-core-bfc8304d4c10b5601a618011893369831baaf511.tar.bz2
openembedded-core-bfc8304d4c10b5601a618011893369831baaf511.zip
oeqa/runtime/parselogs: use -F to search fixed strings for grep
The grep output is not correct if the log message contains special characters. Use -F which tells grep to search for fixed strings, not expressions and pass lists instead of strings to subprocess. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r--meta/lib/oeqa/runtime/parselogs.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/meta/lib/oeqa/runtime/parselogs.py b/meta/lib/oeqa/runtime/parselogs.py
index fc2bc38935..5a2d50f0a3 100644
--- a/meta/lib/oeqa/runtime/parselogs.py
+++ b/meta/lib/oeqa/runtime/parselogs.py
@@ -221,9 +221,8 @@ class ParseLogsTest(oeRuntimeTest):
results[log.replace('target_logs/','')] = {}
rez = result.splitlines()
for xrez in rez:
- command = "grep \"\\"+str(xrez)+"\" -B "+str(lines_before)+" -A "+str(lines_after)+" "+str(log)
try:
- grep_output = subprocess.check_output(command, shell=True)
+ grep_output = subprocess.check_output(['grep', '-F', xrez, '-B', str(lines_before), '-A', str(lines_after), log])
except:
pass
results[log.replace('target_logs/','')][xrez]=grep_output