mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
nixos/tests/anbox: init
This commit is contained in:
parent
eaa7d28b97
commit
b3bb611ce6
@ -109,6 +109,7 @@ in {
|
||||
allTerminfo = handleTest ./all-terminfo.nix {};
|
||||
alps = handleTest ./alps.nix {};
|
||||
amazon-init-shell = handleTest ./amazon-init-shell.nix {};
|
||||
anbox = runTest ./anbox.nix;
|
||||
anuko-time-tracker = handleTest ./anuko-time-tracker.nix {};
|
||||
apcupsd = handleTest ./apcupsd.nix {};
|
||||
apfs = runTest ./apfs.nix;
|
||||
|
40
nixos/tests/anbox.nix
Normal file
40
nixos/tests/anbox.nix
Normal file
@ -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"))
|
||||
'';
|
||||
}
|
@ -25,6 +25,7 @@
|
||||
, systemd
|
||||
, writeText
|
||||
, writeShellScript
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
let
|
||||
@ -152,6 +153,8 @@ stdenv.mkDerivation rec {
|
||||
chmod +x $out/bin/anbox-application-manager
|
||||
'';
|
||||
|
||||
passthru.tests = { inherit (nixosTests) anbox; };
|
||||
|
||||
passthru.image = callPackage ./postmarketos-image.nix { };
|
||||
passthru.postmarketos-image = callPackage ./anbox-image.nix { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user