2014-04-14 16:02:44 +04:00
|
|
|
# This test runs rabbitmq and checks if rabbitmq is up and running.
|
2014-03-10 14:10:32 +04:00
|
|
|
|
2019-11-25 12:35:19 +03:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
2014-06-28 18:04:49 +04:00
|
|
|
name = "rabbitmq";
|
2021-01-10 22:08:30 +03:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2019-02-22 18:14:13 +03:00
|
|
|
maintainers = [ eelco offline ];
|
2015-07-12 13:09:40 +03:00
|
|
|
};
|
2014-03-10 14:10:32 +04:00
|
|
|
|
2019-11-25 12:35:19 +03:00
|
|
|
machine = {
|
2021-08-30 11:11:49 +03:00
|
|
|
services.rabbitmq = {
|
|
|
|
enable = true;
|
|
|
|
managementPlugin.enable = true;
|
|
|
|
};
|
2021-08-02 16:23:07 +03:00
|
|
|
# Ensure there is sufficient extra disk space for rabbitmq to be happy
|
|
|
|
virtualisation.diskSize = 1024;
|
2014-03-10 14:10:32 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-11-25 12:35:19 +03:00
|
|
|
machine.start()
|
2014-04-14 16:02:44 +04:00
|
|
|
|
2019-11-25 12:35:19 +03:00
|
|
|
machine.wait_for_unit("rabbitmq.service")
|
|
|
|
machine.wait_until_succeeds(
|
2020-04-07 09:25:48 +03:00
|
|
|
'su -s ${pkgs.runtimeShell} rabbitmq -c "rabbitmqctl status"'
|
2019-11-25 12:35:19 +03:00
|
|
|
)
|
2021-08-30 11:11:49 +03:00
|
|
|
machine.wait_for_open_port("15672")
|
2014-03-10 14:10:32 +04:00
|
|
|
'';
|
2014-04-14 16:02:44 +04:00
|
|
|
})
|