]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runtime/cases: Disable and stop systemd-timesyncd
authorAlex Kiernan <alex.kiernan@gmail.com>
Thu, 26 Mar 2020 08:54:25 +0000 (08:54 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 28 Mar 2020 10:24:40 +0000 (10:24 +0000)
Stopping systemd-timesyncd doesn't prevent it being restarted by a
different transaction within systemd. Disable the service instead during
the date test to ensure it can't be restarted.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/date.py

index 7750a7293f8e3fe7114072c080dad33dc168afd8..fdd2a6ae587e9bb343e74f1931d6d15ebad31507 100644 (file)
@@ -13,12 +13,12 @@ class DateTest(OERuntimeTestCase):
     def setUp(self):
         if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
             self.logger.debug('Stopping systemd-timesyncd daemon')
-            self.target.run('systemctl stop systemd-timesyncd')
+            self.target.run('systemctl disable --now systemd-timesyncd')
 
     def tearDown(self):
         if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
             self.logger.debug('Starting systemd-timesyncd daemon')
-            self.target.run('systemctl start systemd-timesyncd')
+            self.target.run('systemctl enable --now systemd-timesyncd')
 
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     @OEHasPackage(['coreutils', 'busybox'])