From 66c5287ec0ab5647953a22019b1928a8f5e17e76 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Wed, 31 Jan 2018 13:02:42 -0500 Subject: [PATCH] lib: add luLast to get last found luCommand regex match Signed-off-by: Lou Berger --- tests/topotests/lib/lutil.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/topotests/lib/lutil.py b/tests/topotests/lib/lutil.py index fdb1af053..f00f7ab71 100755 --- a/tests/topotests/lib/lutil.py +++ b/tests/topotests/lib/lutil.py @@ -43,6 +43,7 @@ class lUtil: l_pass = 0 l_fail = 0 l_filename = '' + l_last = None l_line = 0 fout = '' @@ -245,6 +246,11 @@ def luCommand(target, command, regexp='.', op='none', result='', time=10): else: return LUtil.wait(target, command, regexp, op, result, time) +def luLast(): + if LUtil.l_last != None: + LUtil.log('luLast:%s:' % LUtil.l_last.group()) + return LUtil.l_last + def luInclude(filename, CallOnFail=None): tstFile = LUtil.base_script_dir + '/' + filename LUtil.setFilename(filename) -- 2.39.2