1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 19:51:17 +00:00
nixpkgs/nixos/tests/anbox.nix
Sergei Trofimovich 64395b676f nixosTests.allDrivers.anbox: avoid use of aliases
Before the change eval of a test failed with disabled aliases as:

    $ nix build -f. nixosTests.allDrivers.anbox --arg config '{ allowAliases = false; }'
    ...
    error: attribute 'linuxPackages_5_15' missing
2023-12-27 18:36:19 +00:00

37 lines
873 B
Nix

{ lib, pkgs, ... }:
{
name = "anbox";
meta.maintainers = with lib.maintainers; [ mvnetbiz ];
nodes.machine = { pkgs, config, ... }: {
imports = [
./common/user-account.nix
./common/x11.nix
];
environment.systemPackages = with pkgs; [ android-tools ];
test-support.displayManager.auto.user = "alice";
virtualisation.anbox.enable = true;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_5_15;
virtualisation.memorySize = 2500;
};
testScript = { nodes, ... }: let
user = nodes.machine.users.users.alice;
bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus";
in ''
machine.wait_for_x()
machine.wait_until_succeeds(
"sudo -iu alice ${bus} anbox wait-ready"
)
machine.wait_until_succeeds("adb shell true")
print(machine.succeed("adb devices"))
'';
}