forked from Comcast/plax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnect-mqtt-anon.yaml
48 lines (48 loc) · 1.12 KB
/
connect-mqtt-anon.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
doc: |
Connect anonymously to a local MQTT broker and try to sub, pub, and
recv.
labels:
- mqtt
bindings:
'?!ENDPOINT': 'tcp://localhost:1883'
'?!CLIENT_ID': simpsons
spec:
phases:
phase1:
steps:
- pub:
doc: Ask Mother to make an MQTT client.
chan: mother
payload:
make:
name: mqtt
type: mqtt
config:
brokerurl: '?!ENDPOINT'
clientid: '?!CLIENT_ID'
- recv:
doc: Check that the MQTT client is ready.
chan: mother
pattern:
success: true
timeout: 1s
- goto: exercise
exercise:
doc: A quick sub, pub, and recv test.
steps:
- sub:
chan: mqtt
topic: orders
- pub:
chan: mqtt
topic: orders
payload:
need: tacos
n: 3
- recv:
chan: mqtt
topic: orders
pattern:
need: "tacos"
n: "?n"
guard: 'return bs["?n"] > 0'