Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #366 from ChIoT-Tech/AddDockerTests
Provide sample Docker setup for Mosquitto (simplify running tests)
- Loading branch information
Showing
5 changed files
with
84 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.6' | ||
services: | ||
mosquitto: | ||
container_name: mosquitto-test | ||
image: eclipse-mosquitto:latest | ||
ports: | ||
- target: 1883 | ||
published: 1883 | ||
protocol: tcp | ||
mode: host | ||
volumes: | ||
- type: bind | ||
source: ./mosquitto.conf | ||
target: /mosquitto/config/mosquitto.conf | ||
read_only: true | ||
volume: | ||
nocopy: true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
user mosquitto | ||
|
||
allow_anonymous true | ||
allow_duplicate_messages false | ||
connection_messages true | ||
log_dest stdout | ||
log_timestamp true | ||
log_type all | ||
persistence false | ||
|
||
port 1883 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@ECHO OFF | ||
REM Windows CMD file to run golang Paho tests with docker mosquitto instance | ||
cls | ||
docker-compose up -d | ||
REM Docker for windows does not support publishing to 127.0.0.1 so set the address for the tests to use. | ||
set TEST_FVT_ADDR=0.0.0.0 | ||
go test -v ../../ | ||
rem go test -race -v ../../ | ||
docker-compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters