summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorMikko Rapeli <mikko.rapeli@linaro.org>2023-03-13 19:51:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-01 20:23:23 +0100
commit1f1d3d26477a9a43c060cc53b227d4c35bacc405 (patch)
tree7aed1aafae617e90e673f7b618a4068322604752 /meta/lib/oeqa
parent07f99e3deafcf458095eebceb1bfe094e804ff20 (diff)
downloadpoky-1f1d3d26477a9a43c060cc53b227d4c35bacc405.tar.gz
oeqa rtc.py: skip if read-only-rootfs
hwclock command fails on read-only-rootfs: AssertionError: 1 != 0 : Failed to reset RTC time, output: hwclock: cannot open /etc/adjtime: Read-only file system (From OE-Core rev: 5b85a6fa84b02e7ebae011979456d33b8774dd21) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 017bf8c160f6ab67d9f8e8d9e30b15bf84f73807) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/runtime/cases/rtc.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/lib/oeqa/runtime/cases/rtc.py b/meta/lib/oeqa/runtime/cases/rtc.py
index c4e6681324..39f4d29f23 100644
--- a/meta/lib/oeqa/runtime/cases/rtc.py
+++ b/meta/lib/oeqa/runtime/cases/rtc.py
@@ -1,5 +1,6 @@
1from oeqa.runtime.case import OERuntimeTestCase 1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.core.decorator.depends import OETestDepends 2from oeqa.core.decorator.depends import OETestDepends
3from oeqa.core.decorator.data import skipIfFeature
3from oeqa.runtime.decorator.package import OEHasPackage 4from oeqa.runtime.decorator.package import OEHasPackage
4 5
5import re 6import re
@@ -16,12 +17,14 @@ class RTCTest(OERuntimeTestCase):
16 self.logger.debug('Starting systemd-timesyncd daemon') 17 self.logger.debug('Starting systemd-timesyncd daemon')
17 self.target.run('systemctl enable --now --runtime systemd-timesyncd') 18 self.target.run('systemctl enable --now --runtime systemd-timesyncd')
18 19
20 @skipIfFeature('read-only-rootfs',
21 'Test does not work with read-only-rootfs in IMAGE_FEATURES')
19 @OETestDepends(['ssh.SSHTest.test_ssh']) 22 @OETestDepends(['ssh.SSHTest.test_ssh'])
20 @OEHasPackage(['coreutils', 'busybox']) 23 @OEHasPackage(['coreutils', 'busybox'])
21 def test_rtc(self): 24 def test_rtc(self):
22 (status, output) = self.target.run('hwclock -r') 25 (status, output) = self.target.run('hwclock -r')
23 self.assertEqual(status, 0, msg='Failed to get RTC time, output: %s' % output) 26 self.assertEqual(status, 0, msg='Failed to get RTC time, output: %s' % output)
24 27
25 (status, current_datetime) = self.target.run('date +"%m%d%H%M%Y"') 28 (status, current_datetime) = self.target.run('date +"%m%d%H%M%Y"')
26 self.assertEqual(status, 0, msg='Failed to get system current date & time, output: %s' % current_datetime) 29 self.assertEqual(status, 0, msg='Failed to get system current date & time, output: %s' % current_datetime)
27 30
@@ -32,7 +35,6 @@ class RTCTest(OERuntimeTestCase):
32 35
33 (status, output) = self.target.run('date %s' % current_datetime) 36 (status, output) = self.target.run('date %s' % current_datetime)
34 self.assertEqual(status, 0, msg='Failed to reset system date & time, output: %s' % output) 37 self.assertEqual(status, 0, msg='Failed to reset system date & time, output: %s' % output)
35 38
36 (status, output) = self.target.run('hwclock -w') 39 (status, output) = self.target.run('hwclock -w')
37 self.assertEqual(status, 0, msg='Failed to reset RTC time, output: %s' % output) 40 self.assertEqual(status, 0, msg='Failed to reset RTC time, output: %s' % output)
38