]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: add luLast to get last found luCommand regex match
authorLou Berger <lberger@labn.net>
Wed, 31 Jan 2018 18:02:42 +0000 (13:02 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
tests/topotests/lib/lutil.py

index fdb1af05390986c0b921034579db970f27c29fd4..f00f7ab71bcc40ca644175d33dbae416c96245ce 100755 (executable)
@@ -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)