Update regex to get verification_id 83/55683/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Fri, 13 Apr 2018 14:56:04 +0000 (16:56 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Fri, 13 Apr 2018 14:56:27 +0000 (16:56 +0200)
Rally changes the sentence which our testcase was unable to parse.

Change-Id: I9bab3109adc37d349c6fbec73cea9052d09cedb1
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/opnfv_tests/openstack/tempest/tempest.py

index 4660439..4e823da 100644 (file)
@@ -181,12 +181,10 @@ class TempestCommon(testcase.TestCase):
             for line in iter(proc.stdout.readline, b''):
                 if re.search(r"\} tempest\.", line):
                     LOGGER.info(line.replace('\n', ''))
-                elif re.search('Starting verification', line):
-                    LOGGER.info(line.replace('\n', ''))
-                    first_pos = line.index("UUID=") + len("UUID=")
-                    last_pos = line.index(") for deployment")
-                    self.verification_id = line[first_pos:last_pos]
-                    LOGGER.debug('Verification UUID: %s', self.verification_id)
+                elif re.search(r'(?=\(UUID=(.*)\))', line):
+                    self.verification_id = re.search(
+                        r'(?=\(UUID=(.*)\))', line).group(1)
+                    LOGGER.info('Verification UUID: %s', self.verification_id)
                 f_stdout.write(line)
         proc.wait()