# tests-node0_coordinator.tavern.yaml
---

test_name: Test mqtt message - embed coordinator bonded devices

includes:
  - !include common.yaml

paho-mqtt: &mqtt_spec
  client:
    transport: tcp
    client_id: tavern-tester
  connect:
    host: "{mqtt_host:s}"
    port: !int "{mqtt_port:d}"
    timeout: 5

#node0 - dpa coordinator
stages:
  - name: bonded devices
    max_retries: 1
    mqtt_publish:
      topic: Iqrf/DpaRequest
      json: !include messages/node0/iqrfEmbedCoordinator_BondedDevices-request-1-0-0.yaml

    mqtt_response:
      topic: Iqrf/DpaResponse
      json: !include messages/node0/iqrfEmbedCoordinator_BondedDevices-response-1-0-0.yaml
      timeout: 1

---

test_name: Test mqtt message - embed coordinator discovered devices
paho-mqtt: *mqtt_spec

#node0 - dpa coordinator
stages:

  - name: discovered devices
    max_retries: 1
    mqtt_publish:
      topic: Iqrf/DpaRequest
      json: !include messages/node0/iqrfEmbedCoordinator_DiscoveredDevices-request-1-0-0.yaml

    mqtt_response:
      topic: Iqrf/DpaResponse
      json: !include messages/node0/iqrfEmbedCoordinator_DiscoveredDevices-response-1-0-0.yaml
      timeout: 1

---

test_name: Test mqtt message - embed coordinator discovery
paho-mqtt: *mqtt_spec

#node0 - dpa coordinator
stages:

  - name: discovered devices
    max_retries: 1
    mqtt_publish:
      topic: Iqrf/DpaRequest
      json: !include messages/node0/iqrfEmbedCoordinator_Discovery-request-1-0-0.yaml

    mqtt_response:
      topic: Iqrf/DpaResponse
      json: !include messages/node0/iqrfEmbedCoordinator_Discovery-response-1-0-0.yaml
      timeout: 30
