summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime
diff options
context:
space:
mode:
authorMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>2025-10-07 19:38:07 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-09 10:58:07 +0100
commit55f1f00d25d465e687665c7687b2edbc38c3f357 (patch)
treebb9492ca7154355d39268ef44f8dff93cbc40532 /meta/lib/oeqa/runtime
parent8810c1deb029f1d8dba915c39f7aae92e9e9f2ad (diff)
downloadpoky-55f1f00d25d465e687665c7687b2edbc38c3f357.tar.gz
oeqa: runtime: Ignore SSH errors during setup and tear down
Tests using SSH will fail when no SSH server is present on the target. These tests are disabled in these cases, by being marked with a dependency on ssh.SSHTest.test_ssh, which in turns has a dependency on having either dropbear or openssh-sshd in the image. But setUpClass() and tearDownClass() functions are always executed, even on tests failing the dependency checks, leading to unexpected failed tests. Ignoring SSH errors in setup and tear down allows to avoid these test errors. (From OE-Core rev: 5bcc914cf5a193137cddc004f3b38b7b04af9ecb) Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r--meta/lib/oeqa/runtime/cases/logrotate.py7
-rw-r--r--meta/lib/oeqa/runtime/cases/weston.py2
2 files changed, 5 insertions, 4 deletions
diff --git a/meta/lib/oeqa/runtime/cases/logrotate.py b/meta/lib/oeqa/runtime/cases/logrotate.py
index 6ad980cb6a..7cb43d98c5 100644
--- a/meta/lib/oeqa/runtime/cases/logrotate.py
+++ b/meta/lib/oeqa/runtime/cases/logrotate.py
@@ -15,12 +15,13 @@ class LogrotateTest(OERuntimeTestCase):
15 15
16 @classmethod 16 @classmethod
17 def setUpClass(cls): 17 def setUpClass(cls):
18 cls.tc.target.run('cp /etc/logrotate.d/wtmp $HOME/wtmp.oeqabak') 18 cls.tc.target.run('cp /etc/logrotate.d/wtmp $HOME/wtmp.oeqabak',
19 ignore_ssh_fails=True)
19 20
20 @classmethod 21 @classmethod
21 def tearDownClass(cls): 22 def tearDownClass(cls):
22 cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf /var/log//logrotate_dir') 23 cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf /var/log//logrotate_dir', ignore_ssh_fails=True)
23 cls.tc.target.run('rm -rf /var/log/logrotate_testfile && rm -rf /etc/logrotate.d/logrotate_testfile') 24 cls.tc.target.run('rm -rf /var/log/logrotate_testfile && rm -rf /etc/logrotate.d/logrotate_testfile', ignore_ssh_fails=True)
24 25
25 @OETestDepends(['ssh.SSHTest.test_ssh']) 26 @OETestDepends(['ssh.SSHTest.test_ssh'])
26 @OEHasPackage(['logrotate']) 27 @OEHasPackage(['logrotate'])
diff --git a/meta/lib/oeqa/runtime/cases/weston.py b/meta/lib/oeqa/runtime/cases/weston.py
index ee4d336482..e2cecffe83 100644
--- a/meta/lib/oeqa/runtime/cases/weston.py
+++ b/meta/lib/oeqa/runtime/cases/weston.py
@@ -16,7 +16,7 @@ class WestonTest(OERuntimeTestCase):
16 16
17 @classmethod 17 @classmethod
18 def tearDownClass(cls): 18 def tearDownClass(cls):
19 cls.tc.target.run('rm %s' % cls.weston_log_file) 19 cls.tc.target.run('rm %s' % cls.weston_log_file, ignore_ssh_fails=True)
20 20
21 @OETestDepends(['ssh.SSHTest.test_ssh']) 21 @OETestDepends(['ssh.SSHTest.test_ssh'])
22 @OEHasPackage(['weston']) 22 @OEHasPackage(['weston'])