[oe-commits] Ross Burton : oeqa/runtime/date: stop systemd-timesyncd during test

git at git.openembedded.org git at git.openembedded.org
Fri Sep 11 22:42:03 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 5334f1b1e9363fa9c128289b51ade55c7ae1a0a3
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=5334f1b1e9363fa9c128289b51ade55c7ae1a0a3

Author: Ross Burton <ross.burton at intel.com>
Date:   Wed Sep  9 21:05:26 2015 +0100

oeqa/runtime/date: stop systemd-timesyncd during test

There's a race between systemd-timesyncd manipulating the system time (with NTP
lookups) and the test case's time manipulation.  Prevent this by stopping
systemd-timesyncd for the duration of the test case.

Thanks to Khem Raj for root-causing this.

Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/lib/oeqa/runtime/date.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/lib/oeqa/runtime/date.py b/meta/lib/oeqa/runtime/date.py
index 97e8ee4..3a8fe84 100644
--- a/meta/lib/oeqa/runtime/date.py
+++ b/meta/lib/oeqa/runtime/date.py
@@ -4,6 +4,14 @@ import re
 
 class DateTest(oeRuntimeTest):
 
+    def setUp(self):
+        if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
+            self.target.run('systemctl stop systemd-timesyncd')
+
+    def tearDown(self):
+        if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
+            self.target.run('systemctl start systemd-timesyncd')
+
     @testcase(211)
     @skipUnlessPassed("test_ssh")
     def test_date(self):



More information about the Openembedded-commits mailing list