1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/nixos/tests/anbox.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
933 B
Nix
Raw Normal View History

2020-11-02 20:05:23 +00:00
{ lib, pkgs, ... }:
{
name = "anbox";
meta.maintainers = with lib.maintainers; [ mvnetbiz ];
nodes.machine =
{ pkgs, config, ... }:
{
imports = [
./common/user-account.nix
./common/x11.nix
];
2020-11-02 20:05:23 +00:00
environment.systemPackages = with pkgs; [ android-tools ];
2020-11-02 20:05:23 +00:00
test-support.displayManager.auto.user = "alice";
2020-11-02 20:05:23 +00:00
virtualisation.anbox.enable = true;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_5_15;
2020-11-02 20:05:23 +00:00
virtualisation.memorySize = 2500;
};
2020-11-02 20:05:23 +00:00
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()
2020-11-02 20:05:23 +00:00
machine.wait_until_succeeds(
"sudo -iu alice ${bus} anbox wait-ready"
)
2020-11-02 20:05:23 +00:00
machine.wait_until_succeeds("adb shell true")
2020-11-02 20:05:23 +00:00
print(machine.succeed("adb devices"))
'';
}