git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/tests/home-assistant: fix mosquitto configuration

Things broke after mosquitto was upgraded in f07c81b.

commit75047877e34a94a51755a9639ac92de31d0ce39a authorMartin Weinelt <hexa@darmstadt.ccc.de> dateFri 9 Apr 2021, 13:51 (6 years ago) parent9af991a
1 file changed+4−6
nixos/tests/home-assistant.nix+4−6
nixos/tests/home-assistant.nix+4−6
@@ -14,9 +14,10 @@ in {
1414 environment.systemPackages = with pkgs; [ mosquitto ];
1515 services.mosquitto = {
1616 enable = true;
17+ checkPasswords = true;
1718 users = {
1819 "${mqttUsername}" = {
19− acl = [ "pattern readwrite #" ];
20+ acl = [ "topic readwrite #" ];
2021 password = mqttPassword;
2122 };
2223 };
@@ -77,12 +78,9 @@ in {
7778 hass.wait_for_open_port(8123)
7879 hass.succeed("curl --fail http://localhost:8123/lovelace")
7980 with subtest("Toggle a binary sensor using MQTT"):
80− # wait for broker to become available
81− hass.wait_until_succeeds(
82− "mosquitto_sub -V mqttv311 -t home-assistant/test -u ${mqttUsername} -P '${mqttPassword}' -W 1 -t '*'"
83− )
81+ hass.wait_for_open_port(1883)
8482 hass.succeed(
85− "mosquitto_pub -V mqttv311 -t home-assistant/test -u ${mqttUsername} -P '${mqttPassword}' -m let_there_be_light"
83+ "mosquitto_pub -V mqttv5 -t home-assistant/test -u ${mqttUsername} -P '${mqttPassword}' -m let_there_be_light"
8684 )
8785 with subtest("Print log to ease debugging"):
8886 output_log = hass.succeed("cat ${configDir}/home-assistant.log")