summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Jörns <ejo@pengutronix.de>2023-03-31 12:26:22 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-31 23:30:36 +0100
commitd59756912cd450b0af3d8893b822c66dafe42544 (patch)
treef3e36f71bb14de19619d05200feb337282996fa8
parent4651c42cabd3c3a165589d2a7f1d26f41e81a0b8 (diff)
downloadpoky-d59756912cd450b0af3d8893b822c66dafe42544.tar.gz
oeqa: whitespace and indentation cleanups
(From OE-Core rev: 4922221d1259e2f78233f17bb901cdac5b9aa520) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/runqemu.py12
-rw-r--r--meta/lib/oeqa/targetcontrol.py4
-rw-r--r--meta/lib/oeqa/utils/commands.py2
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py14
4 files changed, 16 insertions, 16 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py
index af45c048a4..e1093c67c7 100644
--- a/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -13,6 +13,7 @@ from oeqa.core.decorator.data import skipIfNotArch, skipIfNotMachine
13from oeqa.selftest.case import OESelftestTestCase 13from oeqa.selftest.case import OESelftestTestCase
14from oeqa.utils.commands import bitbake, runqemu, get_bb_var 14from oeqa.utils.commands import bitbake, runqemu, get_bb_var
15 15
16
16@OETestTag("runqemu") 17@OETestTag("runqemu")
17class RunqemuTests(OESelftestTestCase): 18class RunqemuTests(OESelftestTestCase):
18 """Runqemu test class""" 19 """Runqemu test class"""
@@ -23,8 +24,8 @@ class RunqemuTests(OESelftestTestCase):
23 def setUpLocal(self): 24 def setUpLocal(self):
24 super(RunqemuTests, self).setUpLocal() 25 super(RunqemuTests, self).setUpLocal()
25 self.recipe = 'core-image-minimal' 26 self.recipe = 'core-image-minimal'
26 self.machine = self.td['MACHINE'] 27 self.machine = self.td['MACHINE']
27 self.image_link_name = get_bb_var('IMAGE_LINK_NAME', self.recipe) 28 self.image_link_name = get_bb_var('IMAGE_LINK_NAME', self.recipe)
28 29
29 self.fstypes = "ext4" 30 self.fstypes = "ext4"
30 if self.td["HOST_ARCH"] in ('i586', 'i686', 'x86_64'): 31 if self.td["HOST_ARCH"] in ('i586', 'i686', 'x86_64'):
@@ -102,7 +103,6 @@ SYSLINUX_TIMEOUT = "10"
102 with open(qemu.qemurunnerlog) as f: 103 with open(qemu.qemurunnerlog) as f:
103 self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) 104 self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read()))
104 105
105
106 @skipIfNotArch(['i586', 'i686', 'x86_64']) 106 @skipIfNotArch(['i586', 'i686', 'x86_64'])
107 def test_boot_deploy_hddimg(self): 107 def test_boot_deploy_hddimg(self):
108 """Test runqemu deploy_dir_image hddimg""" 108 """Test runqemu deploy_dir_image hddimg"""
@@ -166,9 +166,9 @@ class QemuTest(OESelftestTestCase):
166 def setUpClass(cls): 166 def setUpClass(cls):
167 super(QemuTest, cls).setUpClass() 167 super(QemuTest, cls).setUpClass()
168 cls.recipe = 'core-image-minimal' 168 cls.recipe = 'core-image-minimal'
169 cls.machine = get_bb_var('MACHINE') 169 cls.machine = get_bb_var('MACHINE')
170 cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') 170 cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
171 cls.image_link_name = get_bb_var('IMAGE_LINK_NAME', cls.recipe) 171 cls.image_link_name = get_bb_var('IMAGE_LINK_NAME', cls.recipe)
172 cls.cmd_common = "runqemu nographic" 172 cls.cmd_common = "runqemu nographic"
173 cls.qemuboot_conf = "%s.qemuboot.conf" % (cls.image_link_name) 173 cls.qemuboot_conf = "%s.qemuboot.conf" % (cls.image_link_name)
174 cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf) 174 cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf)
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index f5f2ce2f12..d686fe07ec 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -38,7 +38,7 @@ class BaseTarget(object, metaclass=ABCMeta):
38 if os.path.islink(sshloglink): 38 if os.path.islink(sshloglink):
39 os.unlink(sshloglink) 39 os.unlink(sshloglink)
40 os.symlink(self.sshlog, sshloglink) 40 os.symlink(self.sshlog, sshloglink)
41 self.logger.info("SSH log file: %s" % self.sshlog) 41 self.logger.info("SSH log file: %s" % self.sshlog)
42 42
43 @abstractmethod 43 @abstractmethod
44 def start(self, params=None, ssh=True, extra_bootparams=None): 44 def start(self, params=None, ssh=True, extra_bootparams=None):
@@ -159,7 +159,7 @@ class QemuTarget(BaseTarget):
159 os.unlink(qemuloglink) 159 os.unlink(qemuloglink)
160 os.symlink(self.qemulog, qemuloglink) 160 os.symlink(self.qemulog, qemuloglink)
161 161
162 self.logger.info("rootfs file: %s" % self.rootfs) 162 self.logger.info("rootfs file: %s" % self.rootfs)
163 self.logger.info("Qemu log file: %s" % self.qemulog) 163 self.logger.info("Qemu log file: %s" % self.qemulog)
164 super(QemuTarget, self).deploy() 164 super(QemuTarget, self).deploy()
165 165
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 9b07227f12..c1f533802e 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -115,7 +115,7 @@ class Command(object):
115 else: 115 else:
116 deadline = time.time() + self.timeout 116 deadline = time.time() + self.timeout
117 for thread in self.threads: 117 for thread in self.threads:
118 timeout = deadline - time.time() 118 timeout = deadline - time.time()
119 if timeout < 0: 119 if timeout < 0:
120 timeout = 0 120 timeout = 0
121 thread.join(timeout) 121 thread.join(timeout)
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index c6e4a34bce..6734cee48d 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -238,7 +238,7 @@ class QemuRunner:
238 self.origchldhandler = signal.getsignal(signal.SIGCHLD) 238 self.origchldhandler = signal.getsignal(signal.SIGCHLD)
239 signal.signal(signal.SIGCHLD, self.handleSIGCHLD) 239 signal.signal(signal.SIGCHLD, self.handleSIGCHLD)
240 240
241 self.logger.debug('launchcmd=%s'%(launch_cmd)) 241 self.logger.debug('launchcmd=%s' % (launch_cmd))
242 242
243 # FIXME: We pass in stdin=subprocess.PIPE here to work around stty 243 # FIXME: We pass in stdin=subprocess.PIPE here to work around stty
244 # blocking at the end of the runqemu script when using this within 244 # blocking at the end of the runqemu script when using this within
@@ -332,8 +332,8 @@ class QemuRunner:
332 try: 332 try:
333 os.chdir(os.path.dirname(qmp_port)) 333 os.chdir(os.path.dirname(qmp_port))
334 try: 334 try:
335 from qmp.legacy import QEMUMonitorProtocol 335 from qmp.legacy import QEMUMonitorProtocol
336 self.qmp = QEMUMonitorProtocol(os.path.basename(qmp_port)) 336 self.qmp = QEMUMonitorProtocol(os.path.basename(qmp_port))
337 except OSError as msg: 337 except OSError as msg:
338 self.logger.warning("Failed to initialize qemu monitor socket: %s File: %s" % (msg, msg.filename)) 338 self.logger.warning("Failed to initialize qemu monitor socket: %s File: %s" % (msg, msg.filename))
339 return False 339 return False
@@ -343,8 +343,8 @@ class QemuRunner:
343 self.logger.debug("QMP Port does not exist waiting for it to be created") 343 self.logger.debug("QMP Port does not exist waiting for it to be created")
344 endtime = time.time() + self.runqemutime 344 endtime = time.time() + self.runqemutime
345 while not os.path.exists(qmp_port) and self.is_alive() and time.time() < endtime: 345 while not os.path.exists(qmp_port) and self.is_alive() and time.time() < endtime:
346 self.logger.info("QMP port does not exist yet!") 346 self.logger.info("QMP port does not exist yet!")
347 time.sleep(0.5) 347 time.sleep(0.5)
348 if not os.path.exists(qmp_port) and self.is_alive(): 348 if not os.path.exists(qmp_port) and self.is_alive():
349 self.logger.warning("QMP Port still does not exist but QEMU is alive") 349 self.logger.warning("QMP Port still does not exist but QEMU is alive")
350 return False 350 return False
@@ -419,7 +419,7 @@ class QemuRunner:
419 except (IndexError, ValueError): 419 except (IndexError, ValueError):
420 # Try to get network configuration from runqemu output 420 # Try to get network configuration from runqemu output
421 match = re.match(r'.*Network configuration: (?:ip=)*([0-9.]+)::([0-9.]+):([0-9.]+).*', 421 match = re.match(r'.*Network configuration: (?:ip=)*([0-9.]+)::([0-9.]+):([0-9.]+).*',
422 out, re.MULTILINE|re.DOTALL) 422 out, re.MULTILINE | re.DOTALL)
423 if match: 423 if match:
424 self.ip, self.server_ip, self.netmask = match.groups() 424 self.ip, self.server_ip, self.netmask = match.groups()
425 # network configuration is required as we couldn't get it 425 # network configuration is required as we couldn't get it
@@ -548,7 +548,7 @@ class QemuRunner:
548 if e.errno != errno.ESRCH: 548 if e.errno != errno.ESRCH:
549 raise 549 raise
550 try: 550 try:
551 outs, errs = self.runqemu.communicate(timeout = self.runqemutime) 551 outs, errs = self.runqemu.communicate(timeout=self.runqemutime)
552 if outs: 552 if outs:
553 self.logger.info("Output from runqemu:\n%s", outs.decode("utf-8")) 553 self.logger.info("Output from runqemu:\n%s", outs.decode("utf-8"))
554 if errs: 554 if errs: