From nobody Sun Sep 28 16:34:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1758696197; cv=none; d=zohomail.com; s=zohoarc; b=WNicspcvgSkCf1McWsQ/oRX8QJBPOsIJYGA6Jw5pUNYpOgMdGW/CO/3wnN+yq9lPmSMLOlyw97Wtki/N8uvJMAopN29YE6N59lgr/JnlbSGj3Nyt5pkuptFJsRVaarT8R7OPg3/ADI82AXWvcxXjkbmkdjFiwFM67WIQPCoKmGw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758696197; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=io+NV+Ev+q4WrO5LChFMvPvsyJ+x/EqfXtbfwMi7ajU=; b=YDQbbfRez022sBzP+xEqiIXaAaQcl5W/Ja5fQRtsPZr317NfUkjcEHbkSCXUKrxXHRWm+a6ouFidFJ2d+6YWfVFEJvpyE9titUGmybp/mQC//ONmtWNe9SUyzHXX+aK0aShVe/X1f66Elv+l6cfED3mFc3pMQTZQMpyxmDykWpU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758696197780596.2395422466507; Tue, 23 Sep 2025 23:43:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v1JBe-0002fd-B6; Wed, 24 Sep 2025 02:41:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v1JB5-0002Wd-HF for qemu-devel@nongnu.org; Wed, 24 Sep 2025 02:40:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v1JAn-0006iw-Ek for qemu-devel@nongnu.org; Wed, 24 Sep 2025 02:40:33 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-198-X-o0bXckONmzPXv_Dmy0lg-1; Wed, 24 Sep 2025 02:40:12 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70C4F19560AF; Wed, 24 Sep 2025 06:40:11 +0000 (UTC) Received: from thuth-p1g4.str.redhat.com (dhcp-192-176.str.redhat.com [10.33.192.176]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 58F3E1955F22; Wed, 24 Sep 2025 06:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758696016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=io+NV+Ev+q4WrO5LChFMvPvsyJ+x/EqfXtbfwMi7ajU=; b=aztj5SDJZLuYvCofs2mvrW5lkrZN17IxItBuUiAwIyIOe5VsOG1tKqAxudAjFR3Gh10iEL QSbIa6e0N8dn4Ad9S5w1Vkhh1psAiQWgJGGqbvQhKGlTvnk1A0qdJWtgEQFLiN9xewqPlY gaGcOraQPgTS0ng0VcwYedH1UuQG6ak= X-MC-Unique: X-o0bXckONmzPXv_Dmy0lg-1 X-Mimecast-MFC-AGG-ID: X-o0bXckONmzPXv_Dmy0lg_1758696011 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 07/12] tests/functional: use self.log for all logging Date: Wed, 24 Sep 2025 08:39:51 +0200 Message-ID: <20250924063956.519792-8-thuth@redhat.com> In-Reply-To: <20250924063956.519792-1-thuth@redhat.com> References: <20250924063956.519792-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.442, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1758696199700116600 From: Daniel P. Berrang=C3=A9 Some tests are creating their on logger category which means any output they log is not captured in base.log. Signed-off-by: Daniel P. Berrang=C3=A9 [thuth: drop changes to reverse_debugging.py (it's WIP in other patches)] Message-ID: <20250912182200.643909-7-berrange@redhat.com> Signed-off-by: Thomas Huth --- tests/functional/aarch64/test_virt.py | 4 +-- tests/functional/arm/test_integratorcp.py | 3 +-- tests/functional/mips64el/test_malta.py | 3 +-- tests/functional/replay_kernel.py | 16 +++++------- tests/functional/x86_64/test_acpi_bits.py | 31 +++++++++++------------ 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/tests/functional/aarch64/test_virt.py b/tests/functional/aarch= 64/test_virt.py index 4d0ad90ff89..63071f9b517 100755 --- a/tests/functional/aarch64/test_virt.py +++ b/tests/functional/aarch64/test_virt.py @@ -72,8 +72,6 @@ def common_aarch64_virt(self, machine): self.set_machine('virt') self.require_accelerator("tcg") =20 - logger =3D logging.getLogger('aarch64_virt') - kernel_path =3D self.ASSET_KERNEL.fetch() =20 self.vm.set_console() @@ -91,7 +89,7 @@ def common_aarch64_virt(self, machine): 'rng-random,id=3Drng0,filename=3D/dev/urandom') =20 # Also add a scratch block device - logger.info('creating scratch qcow2 image') + self.log.info('creating scratch qcow2 image') image_path =3D self.scratch_file('scratch.qcow2') qemu_img =3D get_qemu_img(self) check_call([qemu_img, 'create', '-f', 'qcow2', image_path, '8M'], diff --git a/tests/functional/arm/test_integratorcp.py b/tests/functional/a= rm/test_integratorcp.py index 4f00924aa03..23ae919359d 100755 --- a/tests/functional/arm/test_integratorcp.py +++ b/tests/functional/arm/test_integratorcp.py @@ -77,7 +77,6 @@ def test_framebuffer_tux_logo(self): command_line=3D'screendump %s' % screendump_path) if 'unknown command' in res: self.skipTest('screendump not available') - logger =3D logging.getLogger('framebuffer') =20 cpu_count =3D 1 match_threshold =3D 0.92 @@ -88,7 +87,7 @@ def test_framebuffer_tux_logo(self): loc =3D np.where(result >=3D match_threshold) tux_count =3D 0 for tux_count, pt in enumerate(zip(*loc[::-1]), start=3D1): - logger.debug('found Tux at position [x, y] =3D %s', pt) + self.log.debug('found Tux at position [x, y] =3D %s', pt) self.assertGreaterEqual(tux_count, cpu_count) =20 if __name__ =3D=3D '__main__': diff --git a/tests/functional/mips64el/test_malta.py b/tests/functional/mip= s64el/test_malta.py index 8fdc49b3005..170147bfcc2 100755 --- a/tests/functional/mips64el/test_malta.py +++ b/tests/functional/mips64el/test_malta.py @@ -159,7 +159,6 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_coun= t): command_line=3D'screendump %s' % screendump_path) if 'unknown command' in res: self.skipTest('screendump not available') - logger =3D logging.getLogger('framebuffer') =20 match_threshold =3D 0.95 screendump_bgr =3D cv2.imread(screendump_path, cv2.IMREAD_COLOR) @@ -171,7 +170,7 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_coun= t): h, w =3D tuxlogo_bgr.shape[:2] debug_png =3D os.getenv('QEMU_TEST_CV2_SCREENDUMP_PNG_PATH') for tuxlogo_count, pt in enumerate(zip(*loc[::-1]), start=3D1): - logger.debug('found Tux at position (x, y) =3D %s', pt) + self.log.debug('found Tux at position (x, y) =3D %s', pt) cv2.rectangle(screendump_bgr, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), 2) if debug_png: diff --git a/tests/functional/replay_kernel.py b/tests/functional/replay_ke= rnel.py index 80795eb0520..acb1d29a1b5 100644 --- a/tests/functional/replay_kernel.py +++ b/tests/functional/replay_kernel.py @@ -32,15 +32,14 @@ def run_vm(self, kernel_path, kernel_command_line, cons= ole_pattern, # icount requires TCG to be available self.require_accelerator('tcg') =20 - logger =3D logging.getLogger('replay') start_time =3D time.time() vm =3D self.get_vm(name=3D'recording' if record else 'replay') vm.set_console() if record: - logger.info('recording the execution...') + self.log.info('recording the execution...') mode =3D 'record' else: - logger.info('replaying the execution...') + self.log.info('replaying the execution...') mode =3D 'replay' vm.add_args('-icount', 'shift=3D%s,rr=3D%s,rrfile=3D%s' % (shift, mode, replay_path), @@ -54,15 +53,15 @@ def run_vm(self, kernel_path, kernel_command_line, cons= ole_pattern, self.wait_for_console_pattern(console_pattern, vm) if record: vm.shutdown() - logger.info('finished the recording with log size %s bytes' + self.log.info('finished the recording with log size %s bytes' % os.path.getsize(replay_path)) self.run_replay_dump(replay_path) - logger.info('successfully tested replay-dump.py') + self.log.info('successfully tested replay-dump.py') else: vm.wait() - logger.info('successfully finished the replay') + self.log.info('successfully finished the replay') elapsed =3D time.time() - start_time - logger.info('elapsed time %.2f sec' % elapsed) + self.log.info('elapsed time %.2f sec' % elapsed) return elapsed =20 def run_replay_dump(self, replay_path): @@ -80,5 +79,4 @@ def run_rr(self, kernel_path, kernel_command_line, consol= e_pattern, True, shift, args, replay_path) t2 =3D self.run_vm(kernel_path, kernel_command_line, console_patte= rn, False, shift, args, replay_path) - logger =3D logging.getLogger('replay') - logger.info('replay overhead {:.2%}'.format(t2 / t1 - 1)) + self.log.info('replay overhead {:.2%}'.format(t2 / t1 - 1)) diff --git a/tests/functional/x86_64/test_acpi_bits.py b/tests/functional/x= 86_64/test_acpi_bits.py index 8e0563a97b1..9a2816533d6 100755 --- a/tests/functional/x86_64/test_acpi_bits.py +++ b/tests/functional/x86_64/test_acpi_bits.py @@ -121,10 +121,10 @@ def __init__(self, *args, **kwargs): self._debugcon_log =3D 'debugcon-log.txt' =20 def _print_log(self, log): - self.logger.info('\nlogs from biosbits follows:') - self.logger.info('=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D\n') - self.logger.info(log) - self.logger.info('=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D\n') + self.log.info('\nlogs from biosbits follows:') + self.log.info('=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= \n') + self.log.info(log) + self.log.info('=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= \n') =20 def copy_bits_config(self): """ copies the bios bits config file into bits. @@ -138,8 +138,8 @@ def copy_bits_config(self): self.assertTrue(os.path.exists(bits_config_file)) self.assertTrue(os.path.exists(target_config_dir)) shutil.copy2(bits_config_file, target_config_dir) - self.logger.info('copied config file %s to %s', - bits_config_file, target_config_dir) + self.log.info('copied config file %s to %s', + bits_config_file, target_config_dir) =20 def copy_test_scripts(self): """copies the python test scripts into bits. """ @@ -163,8 +163,8 @@ def copy_test_scripts(self): newfilename =3D os.path.splitext(filename)[0] + '.py' shutil.copy2(os.path.join(bits_test_dir, filename), os.path.join(target_test_dir, newfilename)) - self.logger.info('copied test file %s to %s', - filename, target_test_dir) + self.log.info('copied test file %s to %s', + filename, target_test_dir) =20 # now remove the pyc test file if it exists, otherwise the # changes in the python test script won't be executed. @@ -172,9 +172,9 @@ def copy_test_scripts(self): if os.access(os.path.join(target_test_dir, testfile_pyc), os.F_OK): os.remove(os.path.join(target_test_dir, testfile_pyc)) - self.logger.info('removed compiled file %s', - os.path.join(target_test_dir, - testfile_pyc)) + self.log.info('removed compiled file %s', + os.path.join(target_test_dir, + testfile_pyc)) =20 def fix_mkrescue(self, mkrescue): """ grub-mkrescue is a bash script with two variables, 'prefix' and @@ -216,7 +216,7 @@ def generate_bits_iso(self): =20 self.fix_mkrescue(mkrescue_script) =20 - self.logger.info('using grub-mkrescue for generating biosbits iso = ...') + self.log.info('using grub-mkrescue for generating biosbits iso ...= ') =20 try: if os.getenv('V') or os.getenv('BITS_DEBUG'): @@ -225,7 +225,7 @@ def generate_bits_iso(self): stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT, check=3DTrue) - self.logger.info("grub-mkrescue output %s" % proc.stdout) + self.log.info("grub-mkrescue output %s" % proc.stdout) else: subprocess.check_call([mkrescue_script, '-o', iso_file, bits_dir], @@ -238,11 +238,10 @@ def generate_bits_iso(self): =20 self.assertTrue(os.access(iso_file, os.R_OK)) =20 - self.logger.info('iso file %s successfully generated.', iso_file) + self.log.info('iso file %s successfully generated.', iso_file) =20 def setUp(self): # pylint: disable=3Darguments-differ super().setUp() - self.logger =3D self.log =20 prebuiltDir =3D self.scratch_file('prebuilt') if not os.path.isdir(prebuiltDir): @@ -333,7 +332,7 @@ def test_acpi_smbios_bits(self): # in batch mode and then automatically initiate a vm shutdown. self._vm.event_wait('SHUTDOWN', timeout=3DBITS_TIMEOUT) self._vm.wait(timeout=3DNone) - self.logger.debug("Checking console output ...") + self.log.debug("Checking console output ...") self.parse_log() =20 if __name__ =3D=3D '__main__': --=20 2.51.0