1 # This test runs rabbitmq and checks if rabbitmq is up and running.
3 import ./make-test-python.nix ({ pkgs, ... }:
5 # in real life, you would keep this out of your repo and deploy it to a safe
6 # location using safe means.
7 configKeyPath = pkgs.writeText "fake-config-key" "hOjWzSEn2Z7cHzKOcf6i183O2NdjurSuoMDIIv01";
11 meta = with pkgs.lib.maintainers; {
12 maintainers = [ offline ];
18 managementPlugin.enable = true;
21 # rabbitmqctl --quiet encode --cipher blowfish_cfb64 --hash sha256 \
22 # --iterations 10000 '<<"dJT8isYu6t0Xb6u56rPglSj1vK51SlNVlXfwsRxw">>' \
23 # "hOjWzSEn2Z7cHzKOcf6i183O2NdjurSuoMDIIv01" ;
26 , [ {default_user, <<"alice">>}
28 , {encrypted,<<"oKKxyTze9PYmsEfl6FG1MxIUhxY7WPQL7HBoMPRC/1ZOdOZbtr9+DxjWW3e1D5SL48n3D9QOsGD0cOgYG7Qdvb7Txrepw8w=">>}
30 , {config_entry_decoder
31 , [ {passphrase, {file, <<"${configKeyPath}">>}}
32 , {cipher, blowfish_cfb64}
37 % , {rabbitmq_management, [{path_prefix, "/_queues"}]}
43 # Ensure there is sufficient extra disk space for rabbitmq to be happy
44 virtualisation.diskSize = 1024;
50 machine.wait_for_unit("rabbitmq.service")
51 machine.wait_until_succeeds(
52 'su -s ${pkgs.runtimeShell} rabbitmq -c "rabbitmqctl status"'
54 machine.wait_for_open_port(15672)
56 # The password is the plaintext that was encrypted with rabbitmqctl encode above.
57 machine.wait_until_succeeds(
58 '${pkgs.rabbitmq-java-client}/bin/PerfTest --time 10 --uri amqp://alice:dJT8isYu6t0Xb6u56rPglSj1vK51SlNVlXfwsRxw@localhost'