public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
To: openembedded-core@lists.openembedded.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 Joshua Watt <jpewhacker@gmail.com>,
	 Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Subject: [PATCH v2 2/2] oeqa: runtime: weston: Remove tear down method
Date: Thu, 16 Oct 2025 09:50:26 +0200	[thread overview]
Message-ID: <20251016-mathieu-test-clean-setup-v2-2-c4295b9334b8@bootlin.com> (raw)
In-Reply-To: <20251016-mathieu-test-clean-setup-v2-0-c4295b9334b8@bootlin.com>

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 <mathieu.dubois-briand@bootlin.com>
---
 meta/lib/oeqa/runtime/cases/weston.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oeqa/runtime/cases/weston.py b/meta/lib/oeqa/runtime/cases/weston.py
index e2cecffe8353..b0dccee73bf4 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):
@@ -67,6 +63,10 @@ class WestonTest(OERuntimeTestCase):
         existing_wl_processes = self.get_processes_of('weston-desktop-shell', 'existing')
         existing_weston_processes = self.get_processes_of('weston', 'existing')
 
+        # weston log file should be removed, except if test_weston_supports_xwayland() test has to be run.
+        if 'x11' not in self.td.get('DISTRO_FEATURES'):
+            self.addCleanup(self.target.run, 'rm -f %s' % self.weston_log_file)
+
         weston_thread = threading.Thread(target=self.run_weston_init)
         weston_thread.start()
         new_wl_processes, try_cnt = self.get_new_wayland_processes(existing_wl_processes)
@@ -83,6 +83,7 @@ class WestonTest(OERuntimeTestCase):
     @skipIfNotFeature('x11', 'Test requires x11 to be in DISTRO_FEATURES')
     @OEHasPackage(['weston'])
     def test_weston_supports_xwayland(self):
+        self.addCleanup(self.target.run, 'rm -f %s' % self.weston_log_file)
         cmd ='cat %s | grep "xserver listening on display"' % self.weston_log_file
         status, output = self.target.run(cmd)
         msg = ('xwayland does not appear to be running')

-- 
2.47.3



      parent reply	other threads:[~2025-10-16  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16  7:50 [PATCH v2 0/2] oeqa: runtime: Clean setup/tear down function on weston and logrotate Mathieu Dubois-Briand
2025-10-16  7:50 ` [PATCH v2 1/2] oeqa: runtime: logrotate: Remove setup and tear down methods Mathieu Dubois-Briand
2025-10-16  7:50 ` Mathieu Dubois-Briand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251016-mathieu-test-clean-setup-v2-2-c4295b9334b8@bootlin.com \
    --to=mathieu.dubois-briand@bootlin.com \
    --cc=jpewhacker@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox