From patchwork Mon Oct 13 11:06:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 72138 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFE5ECCD18E for ; Mon, 13 Oct 2025 11:07:18 +0000 (UTC) Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.web10.40886.1760353631490754412 for ; Mon, 13 Oct 2025 04:07:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=sEt/vaeM; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: mathieu.dubois-briand@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 80167C093AB for ; Mon, 13 Oct 2025 11:06:50 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 69911606D7 for ; Mon, 13 Oct 2025 11:07:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A16FE102F225C; Mon, 13 Oct 2025 13:07:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760353628; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=vIgp/uc7qNSs3YbJWCN4Kx/GitTLsSBZ2FnBNaV29jY=; b=sEt/vaeMvYRCfncf1nO2HMaKlx+7cGbcwj9XLrFzar9OzQgTdPZmBPf67pEK/63z2i+a1I ikTvfmauVorjQ4WcOxUsPIviB2BLTrwmCxG0NRTIaaWqUKm0Ko7SHU6vwusRQVq1dytJPo Hbja1ugT+8RvRFK6YToSD6S75PgXIm3np2oaUB1xSWide88bWQiy3aC8uNydKjiQk7mQ/C r6+XS3u7w2v5Nk71ZMDUoFZ7i68SozwJ92ykhGl/BH+ast6aVd59ZUHYIp3VJQO4l2Jwuv oOlwKOYeHcNxvnMtOovmCGy+kMMdRl3kmgtUhm1jpSItk/uqwG472i2yHGWktw== From: Mathieu Dubois-Briand Date: Mon, 13 Oct 2025 13:06:43 +0200 Subject: [PATCH 1/3] oeqa: runtime: logrotate: Fix typos and add comments MIME-Version: 1.0 Message-Id: <20251013-mathieu-test-clean-setup-v1-1-6cea9936d79b@bootlin.com> References: <20251013-mathieu-test-clean-setup-v1-0-6cea9936d79b@bootlin.com> In-Reply-To: <20251013-mathieu-test-clean-setup-v1-0-6cea9936d79b@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Thomas Petazzoni , Mathieu Dubois-Briand X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760353627; l=5235; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=aC6Qy20PkWWEtWZ8xw4ObjxOp6AhLQwTbFBcZyd0QLs=; b=dpOHxfHKvgc06/NoYZF9XXUq4xWR7BqmA+fZT8XilLZre9xoWQ+Hmg6JKJ2LysIh6mDjRbUUj 0PkqJjMkuNvDTZOzGWyMDFqSEnzscUQTktq9J6zmePS1Bm5rh9x9ogB X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 13 Oct 2025 11:07:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224774 Signed-off-by: Mathieu Dubois-Briand --- meta/lib/oeqa/runtime/cases/logrotate.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/meta/lib/oeqa/runtime/cases/logrotate.py b/meta/lib/oeqa/runtime/cases/logrotate.py index 7cb43d98c56d..0d4b9ac60baa 100644 --- a/meta/lib/oeqa/runtime/cases/logrotate.py +++ b/meta/lib/oeqa/runtime/cases/logrotate.py @@ -20,55 +20,56 @@ class LogrotateTest(OERuntimeTestCase): @classmethod def tearDownClass(cls): - cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf /var/log//logrotate_dir', ignore_ssh_fails=True) + cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf /var/log/logrotate_dir', ignore_ssh_fails=True) cls.tc.target.run('rm -rf /var/log/logrotate_testfile && rm -rf /etc/logrotate.d/logrotate_testfile', ignore_ssh_fails=True) @OETestDepends(['ssh.SSHTest.test_ssh']) @OEHasPackage(['logrotate']) def test_logrotate_wtmp(self): - # /var/log/wtmp may not always exist initially, so use touch to ensure it is present status, output = self.target.run('touch /var/log/wtmp') msg = ('Could not create/update /var/log/wtmp with touch') self.assertEqual(status, 0, msg = msg) - status, output = self.target.run('mkdir /var/log//logrotate_dir') + # Create a folder to store rotated file and add the corresponding + # configuration option + status, output = self.target.run('mkdir /var/log/logrotate_dir') msg = ('Could not create logrotate_dir. Output: %s' % output) self.assertEqual(status, 0, msg = msg) - status, output = self.target.run('echo "create \n olddir /var/log//logrotate_dir \n include /etc/logrotate.d/wtmp" > /tmp/logrotate-test.conf') + status, output = self.target.run('echo "create \n olddir /var/log/logrotate_dir \n include /etc/logrotate.d/wtmp" > /tmp/logrotate-test.conf') msg = ('Could not write to /tmp/logrotate-test.conf') self.assertEqual(status, 0, msg = msg) - + + # Call logrotate -f to force the rotation immediately # If logrotate fails to rotate the log, view the verbose output of logrotate to see what prevented it _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test.conf') - status, _ = self.target.run('find /var/log//logrotate_dir -type f | grep wtmp.1') + status, _ = self.target.run('find /var/log/logrotate_dir -type f | grep wtmp.1') msg = ("logrotate did not successfully rotate the wtmp log. Output from logrotate -vf: \n%s" % (logrotate_output)) self.assertEqual(status, 0, msg = msg) - + @OETestDepends(['logrotate.LogrotateTest.test_logrotate_wtmp']) def test_logrotate_newlog(self): - status, output = self.target.run('echo "oeqa logrotate test file" > /var/log/logrotate_testfile') msg = ('Could not create logrotate test file in /var/log') self.assertEqual(status, 0, msg = msg) - - status, output = self.target.run('echo "/var/log/logrotate_testfile {\n missingok \n monthly \n rotate 1" > /etc/logrotate.d/logrotate_testfile') + + # Create a new configuration file dedicated to a /var/log/logrotate_testfile + status, output = self.target.run('echo "/var/log/logrotate_testfile {\n missingok \n monthly \n rotate 1}" > /etc/logrotate.d/logrotate_testfile') msg = ('Could not write to /etc/logrotate.d/logrotate_testfile') self.assertEqual(status, 0, msg = msg) - status, output = self.target.run('echo "create \n olddir /var/log//logrotate_dir \n include /etc/logrotate.d/logrotate_testfile" > /tmp/logrotate-test2.conf') + status, output = self.target.run('echo "create \n olddir /var/log/logrotate_dir \n include /etc/logrotate.d/logrotate_testfile" > /tmp/logrotate-test2.conf') msg = ('Could not write to /tmp/logrotate_test2.conf') self.assertEqual(status, 0, msg = msg) - status, output = self.target.run('find /var/log//logrotate_dir -type f | grep logrotate_testfile.1') + status, output = self.target.run('find /var/log/logrotate_dir -type f | grep logrotate_testfile.1') msg = ('A rotated log for logrotate_testfile is already present in logrotate_dir') self.assertEqual(status, 1, msg = msg) + # Call logrotate -f to force the rotation immediately # If logrotate fails to rotate the log, view the verbose output of logrotate instead of just listing the files in olddir _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test2.conf') - status, _ = self.target.run('find /var/log//logrotate_dir -type f | grep logrotate_testfile.1') + status, _ = self.target.run('find /var/log/logrotate_dir -type f | grep logrotate_testfile.1') msg = ('logrotate did not successfully rotate the logrotate_test log. Output from logrotate -vf: \n%s' % (logrotate_output)) self.assertEqual(status, 0, msg = msg) - - From patchwork Mon Oct 13 11:06:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 72139 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBF86CCD190 for ; Mon, 13 Oct 2025 11:07:18 +0000 (UTC) Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.web11.41128.1760353631231379467 for ; Mon, 13 Oct 2025 04:07:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=sewQmD56; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: mathieu.dubois-briand@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id F12CEC093AC for ; Mon, 13 Oct 2025 11:06:50 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E2D90606C6 for ; Mon, 13 Oct 2025 11:07:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 38D15102F2261; Mon, 13 Oct 2025 13:07:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760353629; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=4R81aTo6mj2dZGQKv5Wlx+5sIE7BJ7Ab+5SNQQPC2+k=; b=sewQmD56CAIClCnxjSHjOdiuSGlqh8sq/dvRfCvt+4LL3xUOg6T/vZIO+cWeanTB7wUd1L Y7yHjo1bZjKuvu/6/shp6wt4d6K5TW7NNR34cxKVBH54GMbn1i2tmrCuHBwT8vR8C0Kv7V /vkboJbNeJfUHgGl46JCqw8wi3ZJ89CXqksGcV/gUOSWtn9tJQnaxLKPhDFxCxDz9EZUQG I2unGkjrJNQeoEPBJOX7XTMqstmRVdD8i6T5uttxN1jS711ZHfaj15BIE65NTEK8S3ITBH 6aeBKbQvnOMzrhCSthUyGL1tgKpQ3ZffmR1nzLQHXs/BKXbKu/qFfItKFiOBiA== From: Mathieu Dubois-Briand Date: Mon, 13 Oct 2025 13:06:44 +0200 Subject: [PATCH 2/3] oeqa: runtime: logrotate: Remove setup and tear down methods MIME-Version: 1.0 Message-Id: <20251013-mathieu-test-clean-setup-v1-2-6cea9936d79b@bootlin.com> References: <20251013-mathieu-test-clean-setup-v1-0-6cea9936d79b@bootlin.com> In-Reply-To: <20251013-mathieu-test-clean-setup-v1-0-6cea9936d79b@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Thomas Petazzoni , Mathieu Dubois-Briand X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760353627; l=8790; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=KKqfegGDY8Qo0y2eyQtotqKK5Ed41DpKZLKUFN1N0G4=; b=mfuGroSNMNY8FlMchVQ92nsjFExgbTXH0VOqNoDI5N4HYESOPcxxc5Mm4YQ+f2SOUQWMd+mCS v6rF4TsHGtsCQIwTaP5Eog3BIRV21v2g1+su0DVD470R36NKS/XaObc X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 13 Oct 2025 11:07:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224773 Setup and tear down methods are executed even when the tests are disabled. This lead to SSH being used to run commands on the target, and as it might fail when no SSH server is present, we had to use ignore_ssh_fails=True here. Instead, run cleanup tasks in tests themselves and remove the tear down method. Also, the wtmp configuration file is not modified since the test was modified a few years ago: there is no need to backup and restore it. Signed-off-by: Mathieu Dubois-Briand --- meta/lib/oeqa/runtime/cases/logrotate.py | 100 ++++++++++++++++--------------- 1 file changed, 52 insertions(+), 48 deletions(-) diff --git a/meta/lib/oeqa/runtime/cases/logrotate.py b/meta/lib/oeqa/runtime/cases/logrotate.py index 0d4b9ac60baa..4b9915b99ba5 100644 --- a/meta/lib/oeqa/runtime/cases/logrotate.py +++ b/meta/lib/oeqa/runtime/cases/logrotate.py @@ -12,64 +12,68 @@ from oeqa.core.decorator.depends import OETestDepends from oeqa.runtime.decorator.package import OEHasPackage class LogrotateTest(OERuntimeTestCase): - - @classmethod - def setUpClass(cls): - cls.tc.target.run('cp /etc/logrotate.d/wtmp $HOME/wtmp.oeqabak', - ignore_ssh_fails=True) - - @classmethod - def tearDownClass(cls): - cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf /var/log/logrotate_dir', ignore_ssh_fails=True) - cls.tc.target.run('rm -rf /var/log/logrotate_testfile && rm -rf /etc/logrotate.d/logrotate_testfile', ignore_ssh_fails=True) - @OETestDepends(['ssh.SSHTest.test_ssh']) @OEHasPackage(['logrotate']) def test_logrotate_wtmp(self): - # /var/log/wtmp may not always exist initially, so use touch to ensure it is present - status, output = self.target.run('touch /var/log/wtmp') - msg = ('Could not create/update /var/log/wtmp with touch') - self.assertEqual(status, 0, msg = msg) + try: + # /var/log/wtmp may not always exist initially, so use touch to ensure it is present + status, output = self.target.run('touch /var/log/wtmp') + msg = ('Could not create/update /var/log/wtmp with touch') + self.assertEqual(status, 0, msg = msg) - # Create a folder to store rotated file and add the corresponding - # configuration option - status, output = self.target.run('mkdir /var/log/logrotate_dir') - msg = ('Could not create logrotate_dir. Output: %s' % output) - self.assertEqual(status, 0, msg = msg) + # Create a folder to store rotated file and add the corresponding + # configuration option + status, output = self.target.run('mkdir /var/log/logrotate_dir') + msg = ('Could not create logrotate_dir. Output: %s' % output) + self.assertEqual(status, 0, msg = msg) - status, output = self.target.run('echo "create \n olddir /var/log/logrotate_dir \n include /etc/logrotate.d/wtmp" > /tmp/logrotate-test.conf') - msg = ('Could not write to /tmp/logrotate-test.conf') - self.assertEqual(status, 0, msg = msg) + status, output = self.target.run('echo "create \n olddir /var/log/logrotate_dir \n include /etc/logrotate.d/wtmp" > /tmp/logrotate-test.conf') + msg = ('Could not write to /tmp/logrotate-test.conf') + self.assertEqual(status, 0, msg = msg) - # Call logrotate -f to force the rotation immediately - # If logrotate fails to rotate the log, view the verbose output of logrotate to see what prevented it - _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test.conf') - status, _ = self.target.run('find /var/log/logrotate_dir -type f | grep wtmp.1') - msg = ("logrotate did not successfully rotate the wtmp log. Output from logrotate -vf: \n%s" % (logrotate_output)) - self.assertEqual(status, 0, msg = msg) + # Call logrotate -f to force the rotation immediately + # If logrotate fails to rotate the log, view the verbose output of logrotate to see what prevented it + _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test.conf') + status, _ = self.target.run('find /var/log/logrotate_dir -type f | grep wtmp.1') + msg = ("logrotate did not successfully rotate the wtmp log. Output from logrotate -vf: \n%s" % (logrotate_output)) + self.assertEqual(status, 0, msg = msg) + + finally: + # Clean files created in the test + self.target.run('rm -rf /var/log/logrotate_dir') @OETestDepends(['logrotate.LogrotateTest.test_logrotate_wtmp']) def test_logrotate_newlog(self): - status, output = self.target.run('echo "oeqa logrotate test file" > /var/log/logrotate_testfile') - msg = ('Could not create logrotate test file in /var/log') - self.assertEqual(status, 0, msg = msg) + try: + status, output = self.target.run('echo "oeqa logrotate test file" > /var/log/logrotate_testfile') + msg = ('Could not create logrotate test file in /var/log') + self.assertEqual(status, 0, msg = msg) + + # Create a new configuration file dedicated to a /var/log/logrotate_testfile + status, output = self.target.run('echo "/var/log/logrotate_testfile {\n missingok \n monthly \n rotate 1}" > /etc/logrotate.d/logrotate_testfile') + msg = ('Could not write to /etc/logrotate.d/logrotate_testfile') + self.assertEqual(status, 0, msg = msg) + + status, output = self.target.run('mkdir /var/log/logrotate_dir') + msg = ('Could not create logrotate_dir. Output: %s' % output) + self.assertEqual(status, 0, msg = msg) - # Create a new configuration file dedicated to a /var/log/logrotate_testfile - status, output = self.target.run('echo "/var/log/logrotate_testfile {\n missingok \n monthly \n rotate 1}" > /etc/logrotate.d/logrotate_testfile') - msg = ('Could not write to /etc/logrotate.d/logrotate_testfile') - self.assertEqual(status, 0, msg = msg) + status, output = self.target.run('echo "create \n olddir /var/log/logrotate_dir \n include /etc/logrotate.d/logrotate_testfile" > /tmp/logrotate-test2.conf') + msg = ('Could not write to /tmp/logrotate_test2.conf') + self.assertEqual(status, 0, msg = msg) - status, output = self.target.run('echo "create \n olddir /var/log/logrotate_dir \n include /etc/logrotate.d/logrotate_testfile" > /tmp/logrotate-test2.conf') - msg = ('Could not write to /tmp/logrotate_test2.conf') - self.assertEqual(status, 0, msg = msg) + status, output = self.target.run('find /var/log/logrotate_dir -type f | grep logrotate_testfile.1') + msg = ('A rotated log for logrotate_testfile is already present in logrotate_dir') + self.assertEqual(status, 1, msg = msg) - status, output = self.target.run('find /var/log/logrotate_dir -type f | grep logrotate_testfile.1') - msg = ('A rotated log for logrotate_testfile is already present in logrotate_dir') - self.assertEqual(status, 1, msg = msg) + # Call logrotate -f to force the rotation immediately + # If logrotate fails to rotate the log, view the verbose output of logrotate instead of just listing the files in olddir + _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test2.conf') + status, _ = self.target.run('find /var/log/logrotate_dir -type f | grep logrotate_testfile.1') + msg = ('logrotate did not successfully rotate the logrotate_test log. Output from logrotate -vf: \n%s' % (logrotate_output)) + self.assertEqual(status, 0, msg = msg) - # Call logrotate -f to force the rotation immediately - # If logrotate fails to rotate the log, view the verbose output of logrotate instead of just listing the files in olddir - _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test2.conf') - status, _ = self.target.run('find /var/log/logrotate_dir -type f | grep logrotate_testfile.1') - msg = ('logrotate did not successfully rotate the logrotate_test log. Output from logrotate -vf: \n%s' % (logrotate_output)) - self.assertEqual(status, 0, msg = msg) + finally: + # Clean files created in the test + self.target.run('rm -rf /var/log/logrotate_dir') + self.target.run('rm -rf /var/log/logrotate_testfile && rm -rf /etc/logrotate.d/logrotate_testfile') From patchwork Mon Oct 13 11:06:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 72137 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B72EFCCD185 for ; Mon, 13 Oct 2025 11:07:18 +0000 (UTC) Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.web10.40887.1760353631696821324 for ; Mon, 13 Oct 2025 04:07:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=CYQFMfDL; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: mathieu.dubois-briand@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 721EBC093AD for ; Mon, 13 Oct 2025 11:06:51 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 63C5A606C6 for ; Mon, 13 Oct 2025 11:07:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C6E65102F2263; Mon, 13 Oct 2025 13:07:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760353630; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=DTF/nXWLZ08ucMtTr8kM0yndWzXZc3hF5jygtr8reD0=; b=CYQFMfDLsa4Fl0MfKzMuvQCUbEFt94FX5H+ZCHOjAO9NMaiXWL70V8d3o8WC34lxaZRjKa 57MimX22mE/uLNmr7ZT7LSUEdz0bR0kodg5SST1ArjfmbauPUWzzVyjSwT4/LJ3KChxX1K huRsX90gf7EdEvsAARNUYb+fsgavBQJmQY289TxZG02ei/nvCATh1feBIMkOPOFIeX21G7 tIo4gHqVNWHwqCb7MeTX/Ry52TxytyASWfG+4s9zA/jgXVlqjtGpjRCMWRmmJZqj8jJltD wWpjB0FNFitwUvxx+6Xx6PDRojcE6uFNGGlT6DRxel4xGFbjf+uTjYx7+9GZgQ== From: Mathieu Dubois-Briand Date: Mon, 13 Oct 2025 13:06:45 +0200 Subject: [PATCH 3/3] oeqa: runtime: weston: Remove tear down method MIME-Version: 1.0 Message-Id: <20251013-mathieu-test-clean-setup-v1-3-6cea9936d79b@bootlin.com> References: <20251013-mathieu-test-clean-setup-v1-0-6cea9936d79b@bootlin.com> In-Reply-To: <20251013-mathieu-test-clean-setup-v1-0-6cea9936d79b@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Thomas Petazzoni , Mathieu Dubois-Briand X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760353627; l=1745; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=4GZMa1sgsaI0iXccFd0RoD58TZn0Ao5lgY99Y2ceRZU=; b=Y9RMYAPK3hZhnIDOipguhseZO3BfZDPth+al+AdgvanrI1bmo4ssyr4xRsofs+w6TYINGtuGu gLKQDay1CPgB+cfTJIfY5mTFAw2em3KwcnNfzo8k1L3YVG4DXUf6bLr X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 13 Oct 2025 11:07:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224775 Tear down method is executed even when the tests are disabled. This lead to SSH being used to run commands on the target, and as it might fail when no SSH server is present, we had to use ignore_ssh_fails=True here. Instead, remove log file just before it is created: it will remain on the target after the test is run, but this should be acceptable. Signed-off-by: Mathieu Dubois-Briand --- meta/lib/oeqa/runtime/cases/weston.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/meta/lib/oeqa/runtime/cases/weston.py b/meta/lib/oeqa/runtime/cases/weston.py index e2cecffe8353..443b85efe8cd 100644 --- a/meta/lib/oeqa/runtime/cases/weston.py +++ b/meta/lib/oeqa/runtime/cases/weston.py @@ -14,10 +14,6 @@ import time class WestonTest(OERuntimeTestCase): weston_log_file = '/tmp/weston-2.log' - @classmethod - def tearDownClass(cls): - cls.tc.target.run('rm %s' % cls.weston_log_file, ignore_ssh_fails=True) - @OETestDepends(['ssh.SSHTest.test_ssh']) @OEHasPackage(['weston']) def test_weston_running(self): @@ -36,6 +32,7 @@ class WestonTest(OERuntimeTestCase): return 'export XDG_RUNTIME_DIR=/run/user/`id -u weston`; export WAYLAND_DISPLAY=wayland-1; %s' % cmd def run_weston_init(self): + self.target.run('rm -f %s' % self.weston_log_file) if 'systemd' in self.tc.td['VIRTUAL-RUNTIME_init_manager']: self.target.run('systemd-run --collect --unit=weston-ptest.service --uid=0 -p PAMName=login -p TTYPath=/dev/tty6 -E XDG_RUNTIME_DIR=/tmp -E WAYLAND_DISPLAY=wayland-0 /usr/bin/weston --socket=wayland-1 --log=%s' % self.weston_log_file) else: