diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/runtime/syslog.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/meta/lib/oeqa/runtime/syslog.py b/meta/lib/oeqa/runtime/syslog.py index cec4f978c2..5ff29620cb 100644 --- a/meta/lib/oeqa/runtime/syslog.py +++ b/meta/lib/oeqa/runtime/syslog.py | |||
@@ -14,24 +14,33 @@ class SyslogTest(oeRuntimeTest): | |||
14 | self.assertEqual(status, 1, msg="status and output: %s and %s" % (status,output)) | 14 | self.assertEqual(status, 1, msg="status and output: %s and %s" % (status,output)) |
15 | 15 | ||
16 | @skipUnlessPassed("test_syslog_help") | 16 | @skipUnlessPassed("test_syslog_help") |
17 | def test_syslogd_running(self): | 17 | def test_syslog_running(self): |
18 | (status,output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [s]yslogd') | 18 | (status,output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [s]yslogd') |
19 | self.assertEqual(status, 0, msg="no syslogd process, ps output: %s" % self.target.run(oeRuntimeTest.pscmd)[1]) | 19 | self.assertEqual(status, 0, msg="no syslogd process, ps output: %s" % self.target.run(oeRuntimeTest.pscmd)[1]) |
20 | 20 | ||
21 | |||
21 | class SyslogTestConfig(oeRuntimeTest): | 22 | class SyslogTestConfig(oeRuntimeTest): |
22 | 23 | ||
23 | def setUp(self): | 24 | @skipUnlessPassed("test_syslog_running") |
24 | self.target.run('echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf') | 25 | def test_syslog_logger(self): |
26 | (status,output) = self.target.run('logger foobar && grep foobar /var/log/messages') | ||
27 | self.assertEqual(status, 0, msg="Test log string not found in /var/log/messages. Output: %s " % output) | ||
25 | 28 | ||
26 | @skipUnlessPassed("test_syslogd_running") | 29 | @skipUnlessPassed("test_syslog_running") |
27 | def test_syslogd_configurable(self): | 30 | def test_syslog_restart(self): |
28 | if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"): | 31 | if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"): |
29 | (status,output) = self.target.run('/etc/init.d/syslog restart') | 32 | (status,output) = self.target.run('/etc/init.d/syslog restart') |
30 | else: | 33 | else: |
31 | (status,output) = self.target.run('systemctl restart syslog.service') | 34 | (status,output) = self.target.run('systemctl restart syslog.service') |
35 | |||
36 | @skipUnlessPassed("test_syslog_restart") | ||
37 | @skipUnlessPassed("test_syslog_logger") | ||
38 | @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"), "Not appropiate for systemd image") | ||
39 | def test_syslog_startup_config(self): | ||
40 | self.target.run('echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf') | ||
41 | (status,output) = self.target.run('/etc/init.d/syslog restart') | ||
32 | self.assertEqual(status, 0, msg="Could not restart syslog service. Status and output: %s and %s" % (status,output)) | 42 | self.assertEqual(status, 0, msg="Could not restart syslog service. Status and output: %s and %s" % (status,output)) |
33 | (status,output) = self.target.run('logger foobar && grep foobar /var/log/test') | 43 | (status,output) = self.target.run('logger foobar && grep foobar /var/log/test') |
34 | self.assertEqual(status, 0, msg="Test log string not found. Output: %s " % output) | 44 | self.assertEqual(status, 0, msg="Test log string not found. Output: %s " % output) |
35 | |||
36 | def tearDown(self): | ||
37 | self.target.run("sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf") | 45 | self.target.run("sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf") |
46 | self.target.run('/etc/init.d/syslog restart') | ||