summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime
diff options
context:
space:
mode:
authorWes Lindauer <wesley.lindauer@gmail.com>2021-04-11 23:50:34 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-30 14:37:25 +0100
commitd652d25f2a2b237b312a7c2036424d3f1467a8a4 (patch)
tree81b49185983e7ac98627f243a758b3c2bc847ecb /meta/lib/oeqa/runtime
parentd390ebc18ba4c57a1dff8456f77773603cea3243 (diff)
downloadpoky-d652d25f2a2b237b312a7c2036424d3f1467a8a4.tar.gz
oeqa/runtime/cases: Only disable/enable for current boot
Previously doing a stop/start worked, but using a disable/enable does not work on a read-only rootfs. Add a --runtime flag to systemctl so that systemd only modifies the current boot and does not attempt to write to the filesystem. This also keeps the test from making a permanent (one could argue policy) change to the running system being tested. i.e. What if the image being tested had intentionally disabled the timesyncd service in preference to using chrony or ntpd? The test shouldn't assume that the user wants the timesyncd service enabled. (From OE-Core rev: 49a6632aa789fca8085a91b5b7c749aef3db4e0e) Signed-off-by: Wes Lindauer <wesley.lindauer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 43dd83b6a325589368c980a3f17cab90935aaeb0) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r--meta/lib/oeqa/runtime/cases/date.py4
-rw-r--r--meta/lib/oeqa/runtime/cases/rtc.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/meta/lib/oeqa/runtime/cases/date.py b/meta/lib/oeqa/runtime/cases/date.py
index fdd2a6ae58..e14322911d 100644
--- a/meta/lib/oeqa/runtime/cases/date.py
+++ b/meta/lib/oeqa/runtime/cases/date.py
@@ -13,12 +13,12 @@ class DateTest(OERuntimeTestCase):
13 def setUp(self): 13 def setUp(self):
14 if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd': 14 if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
15 self.logger.debug('Stopping systemd-timesyncd daemon') 15 self.logger.debug('Stopping systemd-timesyncd daemon')
16 self.target.run('systemctl disable --now systemd-timesyncd') 16 self.target.run('systemctl disable --now --runtime systemd-timesyncd')
17 17
18 def tearDown(self): 18 def tearDown(self):
19 if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd': 19 if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
20 self.logger.debug('Starting systemd-timesyncd daemon') 20 self.logger.debug('Starting systemd-timesyncd daemon')
21 self.target.run('systemctl enable --now systemd-timesyncd') 21 self.target.run('systemctl enable --now --runtime systemd-timesyncd')
22 22
23 @OETestDepends(['ssh.SSHTest.test_ssh']) 23 @OETestDepends(['ssh.SSHTest.test_ssh'])
24 @OEHasPackage(['coreutils', 'busybox']) 24 @OEHasPackage(['coreutils', 'busybox'])
diff --git a/meta/lib/oeqa/runtime/cases/rtc.py b/meta/lib/oeqa/runtime/cases/rtc.py
index a34c101a9d..c4e6681324 100644
--- a/meta/lib/oeqa/runtime/cases/rtc.py
+++ b/meta/lib/oeqa/runtime/cases/rtc.py
@@ -9,12 +9,12 @@ class RTCTest(OERuntimeTestCase):
9 def setUp(self): 9 def setUp(self):
10 if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd': 10 if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
11 self.logger.debug('Stopping systemd-timesyncd daemon') 11 self.logger.debug('Stopping systemd-timesyncd daemon')
12 self.target.run('systemctl disable --now systemd-timesyncd') 12 self.target.run('systemctl disable --now --runtime systemd-timesyncd')
13 13
14 def tearDown(self): 14 def tearDown(self):
15 if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd': 15 if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
16 self.logger.debug('Starting systemd-timesyncd daemon') 16 self.logger.debug('Starting systemd-timesyncd daemon')
17 self.target.run('systemctl enable --now systemd-timesyncd') 17 self.target.run('systemctl enable --now --runtime systemd-timesyncd')
18 18
19 @OETestDepends(['ssh.SSHTest.test_ssh']) 19 @OETestDepends(['ssh.SSHTest.test_ssh'])
20 @OEHasPackage(['coreutils', 'busybox']) 20 @OEHasPackage(['coreutils', 'busybox'])