forked from mirrors/nixpkgs
nixos/tests/phosh: init
This commit is contained in:
parent
8b2d34fa5e
commit
3d185562b5
|
@ -491,6 +491,7 @@ in {
|
|||
pgadmin4-standalone = handleTest ./pgadmin4-standalone.nix {};
|
||||
pgjwt = handleTest ./pgjwt.nix {};
|
||||
pgmanage = handleTest ./pgmanage.nix {};
|
||||
phosh = handleTest ./phosh.nix {};
|
||||
php = handleTest ./php {};
|
||||
php80 = handleTest ./php { php = pkgs.php80; };
|
||||
php81 = handleTest ./php { php = pkgs.php81; };
|
||||
|
|
65
nixos/tests/phosh.nix
Normal file
65
nixos/tests/phosh.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
import ./make-test-python.nix ({ pkgs, ...}: let
|
||||
pin = "1234";
|
||||
in {
|
||||
name = "phosh";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [ zhaofengli ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
phone = { config, pkgs, ... }: {
|
||||
users.users.nixos = {
|
||||
isNormalUser = true;
|
||||
password = pin;
|
||||
};
|
||||
|
||||
services.xserver.desktopManager.phosh = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
group = "users";
|
||||
|
||||
phocConfig = {
|
||||
outputs.Virtual-1 = {
|
||||
scale = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.phosh = {
|
||||
environment = {
|
||||
# Accelerated graphics fail on phoc 0.20 (wlroots 0.15)
|
||||
"WLR_RENDERER" = "pixman";
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.resolution = { x = 720; y = 1440; };
|
||||
virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci,xres=720,yres=1440" ];
|
||||
};
|
||||
};
|
||||
|
||||
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")
|
||||
'';
|
||||
})
|
|
@ -28,6 +28,7 @@
|
|||
, polkit
|
||||
, libsecret
|
||||
, evolution-data-server
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
@ -122,6 +123,8 @@ stdenv.mkDerivation rec {
|
|||
providedSessions = [
|
||||
"sm.puri.Phosh"
|
||||
];
|
||||
|
||||
tests.phosh = nixosTests.phosh;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
|
Loading…
Reference in a new issue