2022-08-02 19:34:37 +00:00
|
|
|
import ./make-test-python.nix (
|
|
|
|
{ pkgs, ... }:
|
|
|
|
let
|
|
|
|
pin = "1234";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
name = "phosh";
|
|
|
|
meta = with pkgs.lib.maintainers; {
|
2024-05-31 00:47:29 +00:00
|
|
|
maintainers = [ zhaofengli ];
|
2022-08-02 19:34:37 +00:00
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-02 19:34:37 +00:00
|
|
|
nodes = {
|
|
|
|
phone =
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
{
|
|
|
|
users.users.nixos = {
|
|
|
|
isNormalUser = true;
|
|
|
|
password = pin;
|
|
|
|
};
|
|
|
|
|
2024-03-17 02:23:52 +00:00
|
|
|
services.xserver.desktopManager.phosh = {
|
|
|
|
enable = true;
|
2022-08-02 19:34:37 +00:00
|
|
|
user = "nixos";
|
2024-03-17 02:23:52 +00:00
|
|
|
group = "users";
|
|
|
|
|
2022-08-02 19:34:37 +00:00
|
|
|
phocConfig = {
|
|
|
|
outputs.Virtual-1 = {
|
|
|
|
scale = 2;
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
2022-08-02 19:34:37 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = [
|
2024-03-17 02:23:52 +00:00
|
|
|
pkgs.phosh-mobile-settings
|
2022-08-02 19:34:37 +00:00
|
|
|
];
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-02 19:34:37 +00:00
|
|
|
systemd.services.phosh = {
|
2024-03-17 02:23:52 +00:00
|
|
|
environment = {
|
2022-08-02 19:34:37 +00:00
|
|
|
# Accelerated graphics fail on phoc 0.20 (wlroots 0.15)
|
|
|
|
"WLR_RENDERER" = "pixman";
|
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
|
|
|
|
2022-08-02 19:34:37 +00:00
|
|
|
virtualisation.resolution = {
|
|
|
|
x = 720;
|
|
|
|
y = 1440;
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
2022-08-02 19:34:37 +00:00
|
|
|
virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci,xres=720,yres=1440" ];
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
2022-08-02 19:34:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enableOCR = true;
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
import time
|
|
|
|
|
|
|
|
start_all()
|
|
|
|
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.wait_for_text("Saturday")
|
|
|
|
phone.screenshot("01lockinfo")
|
|
|
|
|
|
|
|
with subtest("Check that we can unlock the screen"):
|
|
|
|
phone.send_chars("${pin}", delay=0.2)
|
|
|
|
time.sleep(1)
|
|
|
|
phone.screenshot("02unlock")
|
|
|
|
|
|
|
|
phone.send_chars("\n")
|
|
|
|
|
|
|
|
phone.wait_for_text("All Apps")
|
|
|
|
phone.screenshot("03launcher")
|
2022-11-23 08:42:21 +00:00
|
|
|
|
|
|
|
with subtest("Check the on-screen keyboard shows"):
|
2024-03-17 02:23:52 +00:00
|
|
|
phone.send_chars("mobile setting", delay=0.2)
|
2022-11-23 08:42:21 +00:00
|
|
|
phone.wait_for_text("123") # A button on the OSK
|
|
|
|
phone.screenshot("04osk")
|
2024-03-17 02:23:52 +00:00
|
|
|
|
|
|
|
with subtest("Check mobile-phosh-settings starts"):
|
|
|
|
phone.send_chars("\n")
|
|
|
|
phone.wait_for_text("Tweak advanced mobile settings");
|
|
|
|
phone.screenshot("05settings")
|
2022-08-02 19:34:37 +00:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|