]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runtime/date: stop systemd-timesyncd during test
authorRoss Burton <ross.burton@intel.com>
Wed, 9 Sep 2015 20:05:26 +0000 (21:05 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 Sep 2015 22:38:02 +0000 (23:38 +0100)
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@intel.com>
meta/lib/oeqa/runtime/date.py

index 97e8ee42ad049d9b65cc28e2ef68f2016cd298a0..3a8fe84817ffcbb12ee90e5e6202c110ade9808f 100644 (file)
@@ -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):