summaryrefslogtreecommitdiffstats
path: root/scripts/oe-selftest
diff options
context:
space:
mode:
authorCostin Constantin <costin.c.constantin@intel.com>2015-12-22 10:36:29 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-28 09:25:17 +0000
commitb6d191d95f3ccb360bf900573b25e55aa0ec04e9 (patch)
tree436866f503741dc05542878eb811bf26fb0d36f3 /scripts/oe-selftest
parentab792876882116baf0216ba93b9f90fafbe75ed6 (diff)
downloadpoky-b6d191d95f3ccb360bf900573b25e55aa0ec04e9.tar.gz
scripts/oe-selftest: Add support for selftest log with timestamp
Each time oe-selftest runs, the oe-selftest.log file is overwritten. This patch solves it by adding time stamp to each selftest log file and doing a symlink named as oe-selftest.log to the last one created. (From OE-Core rev: da8097480ad70e7a75608d733c63c3ae5a337974) Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-selftest')
-rwxr-xr-xscripts/oe-selftest7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index f989e87010..08a5af3952 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -31,6 +31,7 @@ import unittest
31import logging 31import logging
32import argparse 32import argparse
33import subprocess 33import subprocess
34import time as t
34 35
35sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib') 36sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib')
36import scriptpath 37import scriptpath
@@ -44,10 +45,14 @@ from oeqa.utils.commands import runCmd, get_bb_var, get_test_layer
44from oeqa.selftest.base import oeSelfTest 45from oeqa.selftest.base import oeSelfTest
45 46
46def logger_create(): 47def logger_create():
48 log_file = "oe-selftest-" + t.strftime("%Y-%m-%d_%H:%M:%S") + ".log"
49 if os.path.exists("oe-selftest.log"): os.remove("oe-selftest.log")
50 os.symlink(log_file, "oe-selftest.log")
51
47 log = logging.getLogger("selftest") 52 log = logging.getLogger("selftest")
48 log.setLevel(logging.DEBUG) 53 log.setLevel(logging.DEBUG)
49 54
50 fh = logging.FileHandler(filename='oe-selftest.log', mode='w') 55 fh = logging.FileHandler(filename=log_file, mode='w')
51 fh.setLevel(logging.DEBUG) 56 fh.setLevel(logging.DEBUG)
52 57
53 ch = logging.StreamHandler(sys.stdout) 58 ch = logging.StreamHandler(sys.stdout)