summaryrefslogtreecommitdiffstats
path: root/meta/lib
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-03-25 23:00:14 +0000
commit69973e7cb0a94a4bb0a962329510785823300fde (patch)
treeaa098b67cd54513577902d3b7ff1dd35d759daa2 /meta/lib
parent50bd6e11c4279257f4c53b0727fea6cb0d013877 (diff)
downloadpoky-69973e7cb0a94a4bb0a962329510785823300fde.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: 0bb93dce6abdaf09d73d2f9f71781ca20d111601) 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')
-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 b2159b1134..6e45c5db4f 100644
--- a/meta/lib/oeqa/runtime/cases/rtc.py
+++ b/meta/lib/oeqa/runtime/cases/rtc.py
@@ -5,6 +5,7 @@
5# 5#
6from oeqa.runtime.case import OERuntimeTestCase 6from oeqa.runtime.case import OERuntimeTestCase
7from oeqa.core.decorator.depends import OETestDepends 7from oeqa.core.decorator.depends import OETestDepends
8from oeqa.core.decorator.data import skipIfFeature
8from oeqa.runtime.decorator.package import OEHasPackage 9from oeqa.runtime.decorator.package import OEHasPackage
9 10
10import re 11import re
@@ -21,12 +22,14 @@ class RTCTest(OERuntimeTestCase):
21 self.logger.debug('Starting systemd-timesyncd daemon') 22 self.logger.debug('Starting systemd-timesyncd daemon')
22 self.target.run('systemctl enable --now --runtime systemd-timesyncd') 23 self.target.run('systemctl enable --now --runtime systemd-timesyncd')
23 24
25 @skipIfFeature('read-only-rootfs',
26 'Test does not work with read-only-rootfs in IMAGE_FEATURES')
24 @OETestDepends(['ssh.SSHTest.test_ssh']) 27 @OETestDepends(['ssh.SSHTest.test_ssh'])
25 @OEHasPackage(['coreutils', 'busybox']) 28 @OEHasPackage(['coreutils', 'busybox'])
26 def test_rtc(self): 29 def test_rtc(self):
27 (status, output) = self.target.run('hwclock -r') 30 (status, output) = self.target.run('hwclock -r')
28 self.assertEqual(status, 0, msg='Failed to get RTC time, output: %s' % output) 31 self.assertEqual(status, 0, msg='Failed to get RTC time, output: %s' % output)
29 32
30 (status, current_datetime) = self.target.run('date +"%m%d%H%M%Y"') 33 (status, current_datetime) = self.target.run('date +"%m%d%H%M%Y"')
31 self.assertEqual(status, 0, msg='Failed to get system current date & time, output: %s' % current_datetime) 34 self.assertEqual(status, 0, msg='Failed to get system current date & time, output: %s' % current_datetime)
32 35
@@ -37,7 +40,6 @@ class RTCTest(OERuntimeTestCase):
37 40
38 (status, output) = self.target.run('date %s' % current_datetime) 41 (status, output) = self.target.run('date %s' % current_datetime)
39 self.assertEqual(status, 0, msg='Failed to reset system date & time, output: %s' % output) 42 self.assertEqual(status, 0, msg='Failed to reset system date & time, output: %s' % output)
40 43
41 (status, output) = self.target.run('hwclock -w') 44 (status, output) = self.target.run('hwclock -w')
42 self.assertEqual(status, 0, msg='Failed to reset RTC time, output: %s' % output) 45 self.assertEqual(status, 0, msg='Failed to reset RTC time, output: %s' % output)
43