summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/testimage.bbclass4
-rw-r--r--meta/lib/oeqa/runtime/df.py13
-rw-r--r--meta/lib/oeqa/runtime/syslog.py37
3 files changed, 52 insertions, 2 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index f66f514904..22f0a9269d 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -2,8 +2,8 @@ TEST_LOG_DIR ?= "${WORKDIR}/testimage"
2 2
3DEFAULT_TEST_SUITES = "ping auto" 3DEFAULT_TEST_SUITES = "ping auto"
4DEFAULT_TEST_SUITES_pn-core-image-minimal = "ping" 4DEFAULT_TEST_SUITES_pn-core-image-minimal = "ping"
5DEFAULT_TEST_SUITES_pn-core-image-sato = "ping ssh connman rpm smart xorg dmesg" 5DEFAULT_TEST_SUITES_pn-core-image-sato = "ping ssh connman df rpm smart xorg syslog dmesg"
6DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "ping ssh connman rpm smart gcc xorg dmesg" 6DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "ping ssh connman df rpm smart gcc xorg syslog dmesg"
7 7
8TEST_SUITES ?= "${DEFAULT_TEST_SUITES}" 8TEST_SUITES ?= "${DEFAULT_TEST_SUITES}"
9 9
diff --git a/meta/lib/oeqa/runtime/df.py b/meta/lib/oeqa/runtime/df.py
new file mode 100644
index 0000000000..c9119898dc
--- /dev/null
+++ b/meta/lib/oeqa/runtime/df.py
@@ -0,0 +1,13 @@
1import unittest
2from oeqa.oetest import oeRuntimeTest
3from oeqa.utils.decorators import *
4
5def setUpModule():
6 skipModuleUnless(oeRuntimeTest.tc.target.run('which df')[0] == 0, "No df in image or no connection")
7
8class DfTest(oeRuntimeTest):
9
10 @skipUnlessPassed("test_ssh")
11 def test_df(self):
12 (status,output) = self.target.run("df / | sed -n '2p' | awk '{print $4}'")
13 self.assertTrue(int(output)>5120, msg="Not enough space on image. Current size is %s" % output)
diff --git a/meta/lib/oeqa/runtime/syslog.py b/meta/lib/oeqa/runtime/syslog.py
new file mode 100644
index 0000000000..cec4f978c2
--- /dev/null
+++ b/meta/lib/oeqa/runtime/syslog.py
@@ -0,0 +1,37 @@
1import unittest
2from oeqa.oetest import oeRuntimeTest, skipModule
3from oeqa.utils.decorators import *
4
5def setUpModule():
6 if not oeRuntimeTest.hasPackage("syslog"):
7 skipModule("No syslog package in image")
8
9class SyslogTest(oeRuntimeTest):
10
11 @skipUnlessPassed("test_ssh")
12 def test_syslog_help(self):
13 (status,output) = self.target.run('/sbin/syslogd --help')
14 self.assertEqual(status, 1, msg="status and output: %s and %s" % (status,output))
15
16 @skipUnlessPassed("test_syslog_help")
17 def test_syslogd_running(self):
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])
20
21class SyslogTestConfig(oeRuntimeTest):
22
23 def setUp(self):
24 self.target.run('echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf')
25
26 @skipUnlessPassed("test_syslogd_running")
27 def test_syslogd_configurable(self):
28 if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"):
29 (status,output) = self.target.run('/etc/init.d/syslog restart')
30 else:
31 (status,output) = self.target.run('systemctl restart syslog.service')
32 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')
34 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")