mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
lib/oeqa/runtime: add tests for syslog and df
Add tests for free space and syslog.
Changed in v2:
- limit df's output to /
- syslog: fix restart in case of systemd
(From OE-Core rev: 1b39d57e7b5c9b69d565cf4d188ebc2f14e66ae6)
Signed-off-by: Alexandru Palalau <alexandru.palalau@intel.com>
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7f57d3c524
commit
2079a30b1f
@@ -0,0 +1,37 @@
|
||||
import unittest
|
||||
from oeqa.oetest import oeRuntimeTest, skipModule
|
||||
from oeqa.utils.decorators import *
|
||||
|
||||
def setUpModule():
|
||||
if not oeRuntimeTest.hasPackage("syslog"):
|
||||
skipModule("No syslog package in image")
|
||||
|
||||
class SyslogTest(oeRuntimeTest):
|
||||
|
||||
@skipUnlessPassed("test_ssh")
|
||||
def test_syslog_help(self):
|
||||
(status,output) = self.target.run('/sbin/syslogd --help')
|
||||
self.assertEqual(status, 1, msg="status and output: %s and %s" % (status,output))
|
||||
|
||||
@skipUnlessPassed("test_syslog_help")
|
||||
def test_syslogd_running(self):
|
||||
(status,output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [s]yslogd')
|
||||
self.assertEqual(status, 0, msg="no syslogd process, ps output: %s" % self.target.run(oeRuntimeTest.pscmd)[1])
|
||||
|
||||
class SyslogTestConfig(oeRuntimeTest):
|
||||
|
||||
def setUp(self):
|
||||
self.target.run('echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf')
|
||||
|
||||
@skipUnlessPassed("test_syslogd_running")
|
||||
def test_syslogd_configurable(self):
|
||||
if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"):
|
||||
(status,output) = self.target.run('/etc/init.d/syslog restart')
|
||||
else:
|
||||
(status,output) = self.target.run('systemctl restart syslog.service')
|
||||
self.assertEqual(status, 0, msg="Could not restart syslog service. Status and output: %s and %s" % (status,output))
|
||||
(status,output) = self.target.run('logger foobar && grep foobar /var/log/test')
|
||||
self.assertEqual(status, 0, msg="Test log string not found. Output: %s " % output)
|
||||
|
||||
def tearDown(self):
|
||||
self.target.run("sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf")
|
||||
Reference in New Issue
Block a user