summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/targetcontrol.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/targetcontrol.py')
-rw-r--r--meta/lib/oeqa/targetcontrol.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index ea89538002..40a2589cc9 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -18,6 +18,8 @@ from oeqa.utils.dump import TargetDumper
18from oeqa.controllers.testtargetloader import TestTargetLoader 18from oeqa.controllers.testtargetloader import TestTargetLoader
19from abc import ABCMeta, abstractmethod 19from abc import ABCMeta, abstractmethod
20 20
21logger = logging.getLogger('BitBake.QemuRunner')
22
21def get_target_controller(d): 23def get_target_controller(d):
22 testtarget = d.getVar("TEST_TARGET") 24 testtarget = d.getVar("TEST_TARGET")
23 # old, simple names 25 # old, simple names
@@ -63,7 +65,7 @@ class BaseTarget(object, metaclass=ABCMeta):
63 if os.path.islink(sshloglink): 65 if os.path.islink(sshloglink):
64 os.unlink(sshloglink) 66 os.unlink(sshloglink)
65 os.symlink(self.sshlog, sshloglink) 67 os.symlink(self.sshlog, sshloglink)
66 bb.note("SSH log file: %s" % self.sshlog) 68 logger.info("SSH log file: %s" % self.sshlog)
67 69
68 @abstractmethod 70 @abstractmethod
69 def start(self, params=None, ssh=True, extra_bootparams=None): 71 def start(self, params=None, ssh=True, extra_bootparams=None):
@@ -140,7 +142,6 @@ class QemuTarget(BaseTarget):
140 import oe.path 142 import oe.path
141 bb.utils.mkdirhier(self.testdir) 143 bb.utils.mkdirhier(self.testdir)
142 self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime) 144 self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime)
143 logger = logging.getLogger('BitBake.QemuRunner')
144 loggerhandler = logging.FileHandler(self.qemurunnerlog) 145 loggerhandler = logging.FileHandler(self.qemurunnerlog)
145 loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s")) 146 loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
146 logger.addHandler(loggerhandler) 147 logger.addHandler(loggerhandler)
@@ -177,8 +178,8 @@ class QemuTarget(BaseTarget):
177 os.unlink(qemuloglink) 178 os.unlink(qemuloglink)
178 os.symlink(self.qemulog, qemuloglink) 179 os.symlink(self.qemulog, qemuloglink)
179 180
180 bb.note("rootfs file: %s" % self.rootfs) 181 logger.info("rootfs file: %s" % self.rootfs)
181 bb.note("Qemu log file: %s" % self.qemulog) 182 logger.info("Qemu log file: %s" % self.qemulog)
182 super(QemuTarget, self).deploy() 183 super(QemuTarget, self).deploy()
183 184
184 def start(self, params=None, ssh=True, extra_bootparams='', runqemuparams='', launch_cmd=''): 185 def start(self, params=None, ssh=True, extra_bootparams='', runqemuparams='', launch_cmd=''):
@@ -230,14 +231,14 @@ class SimpleRemoteTarget(BaseTarget):
230 self.port = addr.split(":")[1] 231 self.port = addr.split(":")[1]
231 except IndexError: 232 except IndexError:
232 self.port = None 233 self.port = None
233 bb.note("Target IP: %s" % self.ip) 234 logger.info("Target IP: %s" % self.ip)
234 self.server_ip = d.getVar("TEST_SERVER_IP") 235 self.server_ip = d.getVar("TEST_SERVER_IP")
235 if not self.server_ip: 236 if not self.server_ip:
236 try: 237 try:
237 self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1] 238 self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
238 except Exception as e: 239 except Exception as e:
239 bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e) 240 bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e)
240 bb.note("Server IP: %s" % self.server_ip) 241 logger.info("Server IP: %s" % self.server_ip)
241 242
242 def deploy(self): 243 def deploy(self):
243 super(SimpleRemoteTarget, self).deploy() 244 super(SimpleRemoteTarget, self).deploy()