mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
nixos/tests/phosh: fix
This fixes multiple problems that caused the test to fail: - Setting the time to the year 2022 with `timedatectl set-time` would fail with "Failed to set time: Requested to set the clock to time before build time, refusing.". To fix this, use `date -s` instead, since this command does no such validation. - Sometimes it would happen that the system time was set to 2022 but then the RTC would be read and it would override the time. To work around this, wait for the RTC device to exist and then to be extra safe, also write the desired date (and time) to the RTC. - We're using a different on-screen keyboard for phosh now which no longer shows up automatically. Therefore the text "123" would never appear on the screen. To fix this, simply remove the whole subtest.
This commit is contained in:
@@ -54,11 +54,16 @@ in
|
||||
import time
|
||||
|
||||
start_all()
|
||||
|
||||
# Prevent the RTC from setting the time to an undesired value after we already set it to a different value
|
||||
phone.wait_for_file("/dev/rtc0")
|
||||
phone.succeed("hwclock --set --date '2022-01-01 07:00'")
|
||||
|
||||
phone.wait_for_unit("phosh.service")
|
||||
|
||||
with subtest("Check that we can see the lock screen info page"):
|
||||
# Saturday, January 1
|
||||
phone.succeed("timedatectl set-time '2022-01-01 07:00'")
|
||||
phone.succeed("date -s '2022-01-01 07:00'")
|
||||
|
||||
phone.wait_for_text("Saturday")
|
||||
phone.screenshot("01lockinfo")
|
||||
@@ -73,14 +78,10 @@ in
|
||||
phone.wait_for_text("All Apps")
|
||||
phone.screenshot("03launcher")
|
||||
|
||||
with subtest("Check the on-screen keyboard shows"):
|
||||
phone.send_chars("mobile setting", delay=0.2)
|
||||
phone.wait_for_text("123") # A button on the OSK
|
||||
phone.screenshot("04osk")
|
||||
|
||||
with subtest("Check mobile-phosh-settings starts"):
|
||||
phone.send_chars("mobile setting", delay=0.2)
|
||||
phone.send_chars("\n")
|
||||
phone.wait_for_text("Tweak advanced mobile settings");
|
||||
phone.screenshot("05settings")
|
||||
phone.screenshot("04settings")
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user