diff options
author | Matt Votava <mvnetbiz@gmail.com> | 2020-11-02 12:05:23 -0800 |
---|---|---|
committer | rnhmjoj <rnhmjoj@inventati.org> | 2023-09-05 10:09:45 +0200 |
commit | b3bb611ce6c0829944287fe6206adb5fd5a61fa7 (patch) | |
tree | c229b4fd10a980d82c98869cc0df68f6d8ce2c60 /nixos/tests/anbox.nix | |
parent | eaa7d28b97e7e41c0c2e56fe0749fcf9fbd1a8e5 (diff) |
nixos/tests/anbox: init
Diffstat (limited to 'nixos/tests/anbox.nix')
-rw-r--r-- | nixos/tests/anbox.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/nixos/tests/anbox.nix b/nixos/tests/anbox.nix new file mode 100644 index 0000000000000..d78f63ec761fc --- /dev/null +++ b/nixos/tests/anbox.nix @@ -0,0 +1,40 @@ +{ 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.linuxPackages_5_15; + + # The AArch64 anbox image will not start. + # Meanwhile the postmarketOS images work just fine. + virtualisation.anbox.image = pkgs.anbox.postmarketos-image; + 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")) + ''; +} |