Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/mqtt/testcontainers/mqtt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ def start(self, configfile: Optional[str] = None) -> Self:
# default config file
configfile = Path(__file__).parent / MosquittoContainer.CONFIG_FILE
self.with_volume_mapping(configfile, "/mosquitto/config/mosquitto.conf")
# since version 2.1.1 - 2026-02-04, which fixed a PUID/PGID issue, the container needs to write to the data directory,
# so we need to map it to a volume
self.with_volume_mapping("mosquitto_data", "/data", mode="rw")

# if self.password:
# # TODO: add authentication
# pass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# see https://mosquitto.org/man/mosquitto-conf-5.html

protocol mqtt
user root
listener 1883
log_dest stdout
allow_anonymous true

Expand All @@ -14,7 +13,4 @@ log_timestamp_format %Y-%m-%d %H:%M:%S
persistence true
persistence_location /data/

listener 1883
protocol mqtt

sys_interval 1
2 changes: 1 addition & 1 deletion modules/mqtt/tests/test_mosquitto.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from testcontainers.mqtt import MosquittoContainer

VERSIONS = ["1.6.15", "2.0.18"]
VERSIONS = ["1.6.15", "2.0.18", "2.1.2"]


@pytest.mark.parametrize("version", VERSIONS)
Expand Down
Loading