diff options
Diffstat (limited to 'meta/lib/oeqa/runtime_cases/logrotate.py')
| -rw-r--r-- | meta/lib/oeqa/runtime_cases/logrotate.py | 30 |
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 | |||
| 4 | import unittest | ||
| 5 | from oeqa.oetest import oeRuntimeTest, skipModule | ||
| 6 | from oeqa.utils.decorators import * | ||
| 7 | |||
| 8 | def setUpModule(): | ||
| 9 | if not oeRuntimeTest.hasPackage("logrotate"): | ||
| 10 | skipModule("No logrotate package in image") | ||
| 11 | |||
| 12 | |||
| 13 | class 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') | ||
