Add mqtt username and password to tests

This commit is contained in:
fvanroie 2021-02-27 13:51:49 +01:00
parent 80052140f3
commit 51c97f16d9
6 changed files with 51 additions and 15 deletions

View File

@ -1,10 +1,11 @@
# config.yaml
---
name: Common test information
description: Connection information for MQTT Client
variables:
host: 10.4.0.5
host: homeassistant.local
username: hasp
password: hasp
port: 1883
plate: plate35
plate: plate35

View File

@ -13,6 +13,9 @@ paho-mqtt:
host: "{host}"
port: !int "{port:d}"
timeout: 3
auth:
username: "{username}"
password: "{password}"
marks:
- parametrize:

View File

@ -13,6 +13,9 @@ paho-mqtt: &mqtt_spec
host: "{host}"
port: !int "{port:d}"
timeout: 1
auth:
username: "{username}"
password: "{password}"
stages:
- name: Page 1

View File

@ -1,6 +1,5 @@
# test_page.tavern.yaml
---
test_name: Page command
includes:
@ -14,6 +13,9 @@ paho-mqtt:
host: "{host}"
port: !int "{port:d}"
timeout: 3
auth:
username: "{username}"
password: "{password}"
stages:
- name: step 1 - Page test
@ -46,7 +48,7 @@ stages:
- name: step 4 - Page test
mqtt_publish:
topic: hasp/{plate}/command/json
payload: "[\"page=1\"]"
payload: '["page=1"]'
mqtt_response:
topic: hasp/{plate}/state/page
payload: "1"
@ -55,7 +57,7 @@ stages:
- name: step 5 - Page test
mqtt_publish:
topic: hasp/{plate}/command/json
payload: "[\"page 300\"]"
payload: '["page 300"]'
mqtt_response:
topic: hasp/{plate}/state/page
payload: "1"

View File

@ -13,6 +13,9 @@ paho-mqtt:
host: "{host}"
port: !int "{port:d}"
timeout: 3
auth:
username: "{username}"
password: "{password}"
marks:
- parametrize:
@ -52,8 +55,30 @@ marks:
vals:
- [1, 0, 120, 121, 122, 123, 0, 255, "I'm sorry.", "louie"]
- [1, 0, -10, -10, 256, 257, 1, 64, "louie", " The cat stretched."]
- [0, 1, 1024, 1025, 1026, 1027, 5, 0, "The pipe began to rust while new.", ""]
- [0, 1, 80, 81, 82, 83, 32535, 192, "" ," Oak is strong and also gives shade."]
- [
0,
1,
1024,
1025,
1026,
1027,
5,
0,
"The pipe began to rust while new.",
"",
]
- [
0,
1,
80,
81,
82,
83,
32535,
192,
"",
" Oak is strong and also gives shade.",
]
stages:
- name: Page 1
@ -202,7 +227,7 @@ stages:
json:
radius: !int "{radius:d}"
timeout: 1
- name: Set value_str
mqtt_publish:
topic: "hasp/{plate}/command/p1b1.value_str"

View File

@ -1,6 +1,5 @@
# test_value_str.tavern.yaml
---
test_name: Obj Standard Properties
includes:
@ -14,6 +13,9 @@ paho-mqtt:
host: "{host}"
port: !int "{port:d}"
timeout: 3
auth:
username: "{username}"
password: "{password}"
marks:
- parametrize:
@ -26,14 +28,14 @@ marks:
- 30
- 31
- 32
# - 33
# - 40
# - 33
# - 40
- 41
- 50
- 51
- 91
# - 90
# - 1
# - 90
# - 1
- 2
- 71
- 80
@ -93,7 +95,7 @@ stages:
x: 128
y: 128
delay_after: 0
- name: Set value_str
mqtt_publish:
topic: "hasp/{plate}/command/p[1].b[1].value_str"