# tests-node0_sfrc.tavern.yaml
---

test_name: Test mqtt message - embed sensor frc

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: sensor frc all
    max_retries: 1
    mqtt_publish:
      topic: Iqrf/DpaRequest
      json: !include messages/node0/iqrfSensor_Frc1-request-1-0-0.yaml

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

  - name: sensor frc indexes
    max_retries: 1
    mqtt_publish:
      topic: Iqrf/DpaRequest
      json: !include messages/node0/iqrfSensor_Frc2-request-1-0-0.yaml

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

  - name: sensor frc ext format
    max_retries: 1
    mqtt_publish:
      topic: Iqrf/DpaRequest
      json: !include messages/node0/iqrfSensor_Frc3-request-1-0-0.yaml

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

  - name: sensor frc ext format selected
    max_retries: 1
    mqtt_publish:
      topic: Iqrf/DpaRequest
      json: !include messages/node0/iqrfSensor_Frc4-request-1-0-0.yaml

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