nixos/tests: fix mpd test
This commit is contained in:
parent
1eea0f52b8
commit
4d9899ef13
|
@ -1,4 +1,4 @@
|
||||||
import ./make-test.nix ({ pkgs, ... }:
|
import ./make-test.nix ({ pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
track = pkgs.fetchurl {
|
track = pkgs.fetchurl {
|
||||||
# Sourced from http://freemusicarchive.org/music/Blue_Wave_Theory/Surf_Music_Month_Challenge/Skyhawk_Beach_fade_in
|
# Sourced from http://freemusicarchive.org/music/Blue_Wave_Theory/Surf_Music_Month_Challenge/Skyhawk_Beach_fade_in
|
||||||
|
@ -46,38 +46,51 @@ import ./make-test.nix ({ pkgs, ... }:
|
||||||
};
|
};
|
||||||
|
|
||||||
nodes =
|
nodes =
|
||||||
{ client =
|
{ client =
|
||||||
{ ... }: { };
|
{ ... }: { };
|
||||||
|
|
||||||
serverALSA =
|
serverALSA =
|
||||||
{ ... }: (mkServer {
|
{ ... }: lib.mkMerge [
|
||||||
mpd = defaultMpdCfg // {
|
(mkServer {
|
||||||
network.listenAddress = "any";
|
mpd = defaultMpdCfg // {
|
||||||
extraConfig = ''
|
network.listenAddress = "any";
|
||||||
audio_output {
|
extraConfig = ''
|
||||||
type "alsa"
|
audio_output {
|
||||||
name "ALSA"
|
type "alsa"
|
||||||
mixer_type "null"
|
name "ALSA"
|
||||||
}
|
mixer_type "null"
|
||||||
'';
|
}
|
||||||
};
|
'';
|
||||||
|
};
|
||||||
musicService = with defaultMpdCfg; musicService { inherit user group musicDirectory; };
|
musicService = with defaultMpdCfg; musicService { inherit user group musicDirectory; };
|
||||||
}) // { networking.firewall.allowedTCPPorts = [ 6600 ]; };
|
})
|
||||||
|
{ networking.firewall.allowedTCPPorts = [ 6600 ]; }
|
||||||
|
];
|
||||||
|
|
||||||
serverPulseAudio =
|
serverPulseAudio =
|
||||||
{ ... }: (mkServer {
|
{ ... }: lib.mkMerge [
|
||||||
mpd = defaultMpdCfg // {
|
(mkServer {
|
||||||
extraConfig = ''
|
mpd = defaultMpdCfg // {
|
||||||
audio_output {
|
extraConfig = ''
|
||||||
type "pulse"
|
audio_output {
|
||||||
name "The Pulse"
|
type "pulse"
|
||||||
}
|
name "The Pulse"
|
||||||
'';
|
}
|
||||||
};
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
musicService = with defaultCfg; musicService { inherit user group musicDirectory; };
|
musicService = with defaultCfg; musicService { inherit user group musicDirectory; };
|
||||||
}) // { hardware.pulseaudio.enable = true; };
|
})
|
||||||
|
{
|
||||||
|
hardware.pulseaudio = {
|
||||||
|
enable = true;
|
||||||
|
systemWide = true;
|
||||||
|
tcp.enable = true;
|
||||||
|
tcp.anonymousClients.allowAll = true;
|
||||||
|
};
|
||||||
|
systemd.services.mpd.environment.PULSE_SERVER = "localhost";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
|
@ -110,6 +123,7 @@ import ./make-test.nix ({ pkgs, ... }:
|
||||||
play_some_music($serverALSA);
|
play_some_music($serverALSA);
|
||||||
play_some_music($serverPulseAudio);
|
play_some_music($serverPulseAudio);
|
||||||
|
|
||||||
|
$client->waitForUnit("multi-user.target");
|
||||||
$client->succeed("$mpc -h serverALSA status");
|
$client->succeed("$mpc -h serverALSA status");
|
||||||
|
|
||||||
# The PulseAudio-based server is configured not to accept external client connections
|
# The PulseAudio-based server is configured not to accept external client connections
|
||||||
|
|
Loading…
Reference in a new issue