]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oeqa: runtime: weston: Remove tear down method
authorMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Thu, 9 Oct 2025 13:37:28 +0000 (15:37 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Oct 2025 16:58:15 +0000 (16:58 +0000)
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

index e2cecffe83536c9bfeaae62892bad832f75cb541..b0dccee73bf484eb0e2f9edfd8fc229006b69f32 100644 (file)
@@ -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')