Skip to contentSkip to conversation

lib/oeqa/runtime/systemd: Add a basic runtime test for the journal

PATCH In review Randy Witt 1 participant 2 messages Mar 11, 2015

lore
Share & tools
lore

Randy Witt

author
#0 lore raw

PATCH 1/1 lib/oeqa/runtime/systemd: Add a basic runtime test for the journal

The test_systemd_journal() test will fail if journalctl exits with a non-zero exit status. The exit status is non-zero even if there are no journal files, which is what drove the creation of this test.

[Yocto #7388]

---
 meta/lib/oeqa/runtime/systemd.py | 6 ++++++
 1 file changed, 6 insertions(+)
meta/lib/oeqa/runtime/systemd.py +6 -0
index 1451698..5935edd 100644
@@ -86,3 +86,9 @@ class SystemdServiceTests(SystemdTest):
         self.systemctl('is-enabled', 'avahi-daemon.service', expected=1)
         self.systemctl('enable', 'avahi-daemon.service')
         self.systemctl('is-enabled', 'avahi-daemon.service')
+
+class SystemdJournalTests(SystemdTest):
+    @skipUnlessPassed('test_ssh')
+    def test_systemd_journal(self):
+        (status, output) = self.target.run('journalctl')
+        self.assertEqual(status, 0, output)
Signature · 1 line
1.9.3
author
#1 lore raw

Sorry, please ignore this previously submitted patch.

Quoted 25 lines · Randy Witt

The test_systemd_journal() test will fail if journalctl exits with a non-zero exit status. The exit status is non-zero even if there are no journal files, which is what drove the creation of this test. [Yocto #7388]

---
  meta/lib/oeqa/runtime/systemd.py | 6 ++++++
  1 file changed, 6 insertions(+)
meta/lib/oeqa/runtime/systemd.py +6 -0
index 1451698..5935edd 100644
@@ -86,3 +86,9 @@ class SystemdServiceTests(SystemdTest):
          self.systemctl('is-enabled', 'avahi-daemon.service', expected=1)
          self.systemctl('enable', 'avahi-daemon.service')
          self.systemctl('is-enabled', 'avahi-daemon.service')
+
+class SystemdJournalTests(SystemdTest):
+    @skipUnlessPassed('test_ssh')
+    def test_systemd_journal(self):
+        (status, output) = self.target.run('journalctl')
+        self.assertEqual(status, 0, output)