diff options
| -rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index dfab1bd5f1..d40b3b808b 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py | |||
| @@ -238,13 +238,13 @@ class QemuRunner: | |||
| 238 | # because is possible to have control characters | 238 | # because is possible to have control characters |
| 239 | cmdline = re_control_char.sub(' ', cmdline) | 239 | cmdline = re_control_char.sub(' ', cmdline) |
| 240 | try: | 240 | try: |
| 241 | ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1]) | 241 | ips = re.findall(r"((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1]) |
| 242 | self.ip = ips[0] | 242 | self.ip = ips[0] |
| 243 | self.server_ip = ips[1] | 243 | self.server_ip = ips[1] |
| 244 | self.logger.debug("qemu cmdline used:\n{}".format(cmdline)) | 244 | self.logger.debug("qemu cmdline used:\n{}".format(cmdline)) |
| 245 | except (IndexError, ValueError): | 245 | except (IndexError, ValueError): |
| 246 | # Try to get network configuration from runqemu output | 246 | # Try to get network configuration from runqemu output |
| 247 | match = re.match('.*Network configuration: ([0-9.]+)::([0-9.]+):([0-9.]+)$.*', | 247 | match = re.match(r'.*Network configuration: ([0-9.]+)::([0-9.]+):([0-9.]+)$.*', |
| 248 | out, re.MULTILINE|re.DOTALL) | 248 | out, re.MULTILINE|re.DOTALL) |
| 249 | if match: | 249 | if match: |
| 250 | self.ip, self.server_ip, self.netmask = match.groups() | 250 | self.ip, self.server_ip, self.netmask = match.groups() |
| @@ -331,14 +331,14 @@ class QemuRunner: | |||
| 331 | # If we are not able to login the tests can continue | 331 | # If we are not able to login the tests can continue |
| 332 | try: | 332 | try: |
| 333 | (status, output) = self.run_serial("root\n", raw=True) | 333 | (status, output) = self.run_serial("root\n", raw=True) |
| 334 | if re.search("root@[a-zA-Z0-9\-]+:~#", output): | 334 | if re.search(r"root@[a-zA-Z0-9\-]+:~#", output): |
| 335 | self.logged = True | 335 | self.logged = True |
| 336 | self.logger.debug("Logged as root in serial console") | 336 | self.logger.debug("Logged as root in serial console") |
| 337 | if netconf: | 337 | if netconf: |
| 338 | # configure guest networking | 338 | # configure guest networking |
| 339 | cmd = "ifconfig eth0 %s netmask %s up\n" % (self.ip, self.netmask) | 339 | cmd = "ifconfig eth0 %s netmask %s up\n" % (self.ip, self.netmask) |
| 340 | output = self.run_serial(cmd, raw=True)[1] | 340 | output = self.run_serial(cmd, raw=True)[1] |
| 341 | if re.search("root@[a-zA-Z0-9\-]+:~#", output): | 341 | if re.search(r"root@[a-zA-Z0-9\-]+:~#", output): |
| 342 | self.logger.debug("configured ip address %s", self.ip) | 342 | self.logger.debug("configured ip address %s", self.ip) |
| 343 | else: | 343 | else: |
| 344 | self.logger.debug("Couldn't configure guest networking") | 344 | self.logger.debug("Couldn't configure guest networking") |
| @@ -436,7 +436,7 @@ class QemuRunner: | |||
| 436 | if answer: | 436 | if answer: |
| 437 | data += answer.decode('utf-8') | 437 | data += answer.decode('utf-8') |
| 438 | # Search the prompt to stop | 438 | # Search the prompt to stop |
| 439 | if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data): | 439 | if re.search(r"[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data): |
| 440 | break | 440 | break |
| 441 | else: | 441 | else: |
| 442 | raise Exception("No data on serial console socket") | 442 | raise Exception("No data on serial console socket") |
