summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2016-01-07 11:29:53 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-11 23:26:30 +0000
commit235606f31b720094fdeb3bb3eb0c09347c23ee5d (patch)
treeea018a57e5f6f47b265e10c5f7d81f364d401061 /meta/lib/oeqa
parentcce6c3ed9ad5b62226edfe3843b2a16356c555c8 (diff)
downloadpoky-235606f31b720094fdeb3bb3eb0c09347c23ee5d.tar.gz
oeqa/runtime/logrotate: fix hardcoded root directory
Use $HOME instead of /home/root in case user changes the default root directory by ROOT_HOME (From OE-Core rev: 123ca1c3457e472bd3dab5563f7ba5312a9864bf) Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/runtime/logrotate.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/lib/oeqa/runtime/logrotate.py b/meta/lib/oeqa/runtime/logrotate.py
index 86d791c300..de300bf55f 100644
--- a/meta/lib/oeqa/runtime/logrotate.py
+++ b/meta/lib/oeqa/runtime/logrotate.py
@@ -14,9 +14,9 @@ class LogrotateTest(oeRuntimeTest):
14 14
15 @skipUnlessPassed("test_ssh") 15 @skipUnlessPassed("test_ssh")
16 def test_1_logrotate_setup(self): 16 def test_1_logrotate_setup(self):
17 (status, output) = self.target.run('mkdir /home/root/logrotate_dir') 17 (status, output) = self.target.run('mkdir $HOME/logrotate_dir')
18 self.assertEqual(status, 0, msg = "Could not create logrotate_dir. Output: %s" % output) 18 self.assertEqual(status, 0, msg = "Could not create logrotate_dir. Output: %s" % output)
19 (status, output) = self.target.run("sed -i 's#wtmp {#wtmp {\\n olddir /home/root/logrotate_dir#' /etc/logrotate.conf") 19 (status, output) = self.target.run("sed -i \"s#wtmp {#wtmp {\\n olddir $HOME/logrotate_dir#\" /etc/logrotate.conf")
20 self.assertEqual(status, 0, msg = "Could not write to logrotate.conf file. Status and output: %s and %s)" % (status, output)) 20 self.assertEqual(status, 0, msg = "Could not write to logrotate.conf file. Status and output: %s and %s)" % (status, output))
21 21
22 @testcase(289) 22 @testcase(289)
@@ -24,5 +24,5 @@ class LogrotateTest(oeRuntimeTest):
24 def test_2_logrotate(self): 24 def test_2_logrotate(self):
25 (status, output) = self.target.run('logrotate -f /etc/logrotate.conf') 25 (status, output) = self.target.run('logrotate -f /etc/logrotate.conf')
26 self.assertEqual(status, 0, msg = "logrotate service could not be reloaded. Status and output: %s and %s" % (status, output)) 26 self.assertEqual(status, 0, msg = "logrotate service could not be reloaded. Status and output: %s and %s" % (status, output))
27 output = self.target.run('ls -la /home/root/logrotate_dir/ | wc -l')[1] 27 output = self.target.run('ls -la $HOME/logrotate_dir/ | wc -l')[1]
28 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/root/logrotate_dir')[1])) 28 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]))