summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime_cases/logrotate.py
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-11-01 07:48:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:20 +0000
commitb569aa0e0056a97b29577f5bda611ef3dd539db3 (patch)
tree64f4d7856959435abfc7c49258688f64861f6d7c /meta/lib/oeqa/runtime_cases/logrotate.py
parent3857e5c91da678d7bdc07712a1df9daa14354986 (diff)
downloadpoky-b569aa0e0056a97b29577f5bda611ef3dd539db3.tar.gz
oeqa/runtime/cases: Migrate runtime tests.
This migrates current runtime test suite to be used with the new framework. [YOCTO #10234] (From OE-Core rev: b39c61f2d442c79d03b73e8ffd104996fcb2177e) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime_cases/logrotate.py')
-rw-r--r--meta/lib/oeqa/runtime_cases/logrotate.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/meta/lib/oeqa/runtime_cases/logrotate.py b/meta/lib/oeqa/runtime_cases/logrotate.py
deleted file mode 100644
index 063280b5f7..0000000000
--- a/meta/lib/oeqa/runtime_cases/logrotate.py
+++ /dev/null
@@ -1,30 +0,0 @@
1# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=289 testcase
2# Note that the image under test must have logrotate installed
3
4import unittest
5from oeqa.oetest import oeRuntimeTest, skipModule
6from oeqa.utils.decorators import *
7
8def setUpModule():
9 if not oeRuntimeTest.hasPackage("logrotate"):
10 skipModule("No logrotate package in image")
11
12
13class LogrotateTest(oeRuntimeTest):
14
15 @testcase(1544)
16 @skipUnlessPassed("test_ssh")
17 def test_1_logrotate_setup(self):
18 (status, output) = self.target.run('mkdir $HOME/logrotate_dir')
19 self.assertEqual(status, 0, msg = "Could not create logrotate_dir. Output: %s" % output)
20 (status, output) = self.target.run("sed -i \"s#wtmp {#wtmp {\\n olddir $HOME/logrotate_dir#\" /etc/logrotate.conf")
21 self.assertEqual(status, 0, msg = "Could not write to logrotate.conf file. Status and output: %s and %s)" % (status, output))
22
23 @testcase(1542)
24 @skipUnlessPassed("test_1_logrotate_setup")
25 def test_2_logrotate(self):
26 (status, output) = self.target.run('logrotate -f /etc/logrotate.conf')
27 self.assertEqual(status, 0, msg = "logrotate service could not be reloaded. Status and output: %s and %s" % (status, output))
28 output = self.target.run('ls -la $HOME/logrotate_dir/ | wc -l')[1]
29 self.assertTrue(int(output)>=3, msg = "new logfile could not be created. List of files within log directory: %s" %(self.target.run('ls -la $HOME/logrotate_dir')[1]))
30 self.target.run('rm -rf $HOME/logrotate_dir')