diff options
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/oe_syslog.py')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/oe_syslog.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/meta/lib/oeqa/runtime/cases/oe_syslog.py b/meta/lib/oeqa/runtime/cases/oe_syslog.py index f3c2bedbaf..adb876160d 100644 --- a/meta/lib/oeqa/runtime/cases/oe_syslog.py +++ b/meta/lib/oeqa/runtime/cases/oe_syslog.py | |||
@@ -1,4 +1,6 @@ | |||
1 | # | 1 | # |
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
2 | # SPDX-License-Identifier: MIT | 4 | # SPDX-License-Identifier: MIT |
3 | # | 5 | # |
4 | 6 | ||
@@ -114,18 +116,23 @@ class SyslogTestConfig(OERuntimeTestCase): | |||
114 | @OETestDepends(['oe_syslog.SyslogTestConfig.test_syslog_logger']) | 116 | @OETestDepends(['oe_syslog.SyslogTestConfig.test_syslog_logger']) |
115 | @OEHasPackage(["busybox-syslog"]) | 117 | @OEHasPackage(["busybox-syslog"]) |
116 | @skipIfDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd', | 118 | @skipIfDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd', |
117 | 'Not appropiate for systemd image') | 119 | 'Not appropriate for systemd image') |
118 | def test_syslog_startup_config(self): | 120 | def test_syslog_startup_config(self): |
119 | cmd = 'echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf' | 121 | cmd = 'echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf' |
120 | self.target.run(cmd) | 122 | self.target.run(cmd) |
121 | 123 | ||
122 | self.test_syslog_restart() | 124 | self.test_syslog_restart() |
123 | 125 | ||
124 | cmd = 'logger foobar && grep foobar /var/log/test' | 126 | cmd = 'logger foobar' |
125 | status,output = self.target.run(cmd) | 127 | status, output = self.target.run(cmd) |
126 | msg = 'Test log string not found. Output: %s ' % output | 128 | msg = 'Logger command failed, %s. Output: %s ' % (status, output) |
127 | self.assertEqual(status, 0, msg=msg) | 129 | self.assertEqual(status, 0, msg=msg) |
128 | 130 | ||
131 | cmd = 'cat /var/log/test' | ||
132 | status, output = self.target.run(cmd) | ||
133 | if "foobar" not in output or status: | ||
134 | self.fail("'foobar' not found in logfile, status %s, contents %s" % (status, output)) | ||
135 | |||
129 | cmd = "sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf" | 136 | cmd = "sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf" |
130 | self.target.run(cmd) | 137 | self.target.run(cmd) |
131 | self.test_syslog_restart() | 138 | self.test_syslog_restart() |