From 44ae903e30245e4e8825e1805b5ab6c3fb19ff33 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Wed, 9 Sep 2015 21:05:26 +0100 Subject: 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. (From OE-Core rev: 5334f1b1e9363fa9c128289b51ade55c7ae1a0a3) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/lib/oeqa/runtime/date.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'meta/lib/oeqa') diff --git a/meta/lib/oeqa/runtime/date.py b/meta/lib/oeqa/runtime/date.py index 97e8ee42ad..3a8fe84817 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): -- cgit v1.2.3-54-g00ecf