Merge: matrix-synapse: 1.122.0 -> 1.123.0 (#378018)
[NixPkgs.git] / pkgs / development / python-modules / soundcard / test.nix
blob844544690897f538f337fe3870230e910565ecd1
2   name = "Python Soundcard Library Test";
4   nodes.machine =
5     { pkgs, ... }:
6     {
7       environment.systemPackages = [ (pkgs.python3.withPackages (ps: [ ps.soundcard ])) ];
9       services.pulseaudio.enable = true;
10       services.pulseaudio.systemWide = true;
12       virtualisation.qemu.options = [
13         "-device virtio-sound-pci,audiodev=my_audiodev"
14         "-audiodev wav,id=my_audiodev"
15       ];
16     };
18   interactive.nodes.machine =
19     { ... }:
20     {
21       services.openssh.enable = true;
22       services.openssh.settings.PermitRootLogin = "yes";
23       users.extraUsers.root.initialPassword = "";
24       users.extraUsers.root.hashedPassword = null;
25       users.extraUsers.root.hashedPasswordFile = null;
26       users.extraUsers.root.initialHashedPassword = null;
27       virtualisation.forwardPorts = [
28         {
29           from = "host";
30           host.port = 2222;
31           guest.port = 22;
32         }
33       ];
34     };
36   testScript =
37     let
38       script = builtins.toFile "import.py" ''
39         import soundcard
40       '';
41     in
42     ''
43       start_all()
44       machine.wait_for_unit("multi-user.target")
45       machine.succeed("python ${script}")
46     '';