diff options
| -rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 7e5f588f60..9ef7629c11 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py | |||
| @@ -195,6 +195,7 @@ class QemuRunner: | |||
| 195 | time.sleep(1) | 195 | time.sleep(1) |
| 196 | 196 | ||
| 197 | out = self.getOutput(output) | 197 | out = self.getOutput(output) |
| 198 | netconf = False # network configuration is not required by default | ||
| 198 | if self.is_alive(): | 199 | if self.is_alive(): |
| 199 | logger.info("qemu started - qemu procces pid is %s" % self.qemupid) | 200 | logger.info("qemu started - qemu procces pid is %s" % self.qemupid) |
| 200 | if get_ip: | 201 | if get_ip: |
| @@ -215,6 +216,10 @@ class QemuRunner: | |||
| 215 | out, re.MULTILINE|re.DOTALL) | 216 | out, re.MULTILINE|re.DOTALL) |
| 216 | if match: | 217 | if match: |
| 217 | self.ip, self.server_ip, self.netmask = match.groups() | 218 | self.ip, self.server_ip, self.netmask = match.groups() |
| 219 | # network configuration is required as we couldn't get it | ||
| 220 | # from the runqemu command line, so qemu doesn't run kernel | ||
| 221 | # and guest networking is not configured | ||
| 222 | netconf = True | ||
| 218 | else: | 223 | else: |
| 219 | logger.error("Couldn't get ip from qemu command line and runqemu output! " | 224 | logger.error("Couldn't get ip from qemu command line and runqemu output! " |
| 220 | "Here is the qemu command line used:\n%s\n" | 225 | "Here is the qemu command line used:\n%s\n" |
| @@ -287,6 +292,14 @@ class QemuRunner: | |||
| 287 | if re.search("root@[a-zA-Z0-9\-]+:~#", output): | 292 | if re.search("root@[a-zA-Z0-9\-]+:~#", output): |
| 288 | self.logged = True | 293 | self.logged = True |
| 289 | logger.info("Logged as root in serial console") | 294 | logger.info("Logged as root in serial console") |
| 295 | if netconf: | ||
| 296 | # configure guest networking | ||
| 297 | cmd = "ifconfig eth0 %s netmask %s up\n" % (self.ip, self.netmask) | ||
| 298 | output = self.run_serial(cmd, raw=True)[1] | ||
| 299 | if re.search("root@[a-zA-Z0-9\-]+:~#", output): | ||
| 300 | logger.info("configured ip address %s", self.ip) | ||
| 301 | else: | ||
| 302 | logger.info("Couldn't configure guest networking") | ||
| 290 | else: | 303 | else: |
| 291 | logger.info("Couldn't login into serial console" | 304 | logger.info("Couldn't login into serial console" |
| 292 | " as root using blank password") | 305 | " as root using blank password") |
