Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
c-ryan-k committed Dec 12, 2024
1 parent c1f1167 commit 6c28001
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
25 changes: 11 additions & 14 deletions azext_iot/tests/iothub/core/test_iot_messaging_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
# --------------------------------------------------------------------------------------------

import os
from azure.cli.core.azclierror import AzureResponseError
from azext_iot.iothub.common import NON_DECODABLE_PAYLOAD
from azext_iot.tests.conftest import get_context_path
import pytest
import json
import time

from time import time
from uuid import uuid4
from azext_iot.iothub.common import NON_DECODABLE_PAYLOAD
from azext_iot.tests.conftest import get_context_path
from azext_iot.tests.helpers import CERT_ENDING, KEY_ENDING
from azext_iot.tests.iothub import IoTLiveScenarioTest, PREFIX_DEVICE
from azext_iot.common.utility import (
Expand Down Expand Up @@ -333,15 +332,12 @@ def test_uamqp_device_messaging(self):
# Implicit etag assertion
etag = result["etag"]

try:
self.cmd(
"iot device c2d-message complete -d {} --hub-name {} -g {} --etag {}".format(
device_ids[0], self.entity_name, self.entity_rg, etag
),
checks=self.is_empty(),
)
except AzureResponseError as e:
logger.warning("Error completing message: %s", e)
self.cmd(
"iot device c2d-message complete -d {} --hub-name {} -g {} --etag {}".format(
device_ids[0], self.entity_name, self.entity_rg, etag
),
checks=self.is_empty(),
)

# Error - Send C2D message with non existed file path
self.cmd(
Expand Down Expand Up @@ -776,8 +772,9 @@ def test_mqtt_device_simulation_x509(self):

# x509 CA device simulation and include model Id upon connection
model_id_simulate_x509ca = "dtmi:com:example:simulatex509ca;1"

# not sure why this needs a timer but it seems to help avoid unauthorized errors
import time; time.sleep(60)
time.sleep(60)
self.cmd(
"iot device simulate -d {} -n {} -g {} --da '{}' --mc 1 --mi 1 --cp {} --kp {} --pass {} --model-id '{}'".format(
device_ids[1], self.entity_name, self.entity_rg, simulate_msg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from time import sleep
from uuid import uuid4
from azext_iot.iothub.common import NON_DECODABLE_PAYLOAD
from azext_iot.tests.iothub import IoTLiveScenarioTest
from azext_iot.common.shared import AuthenticationTypeDataplane
from azext_iot.tests.iothub import DATAPLANE_AUTH_TYPES
Expand Down Expand Up @@ -61,7 +60,6 @@ def test_iothub_c2d_messages(self):
f"iot device c2d-message receive -d {device_ids[0]} --hub-name {self.entity_name} -g {self.entity_rg} --complete",
).get_output_in_json()

# TODO - @c-ryan-k - when using login auth type, the payload is not decoded correctly
assert c2d_receive_result["data"] == test_body

# Assert system properties
Expand Down

0 comments on commit 6c28001

Please sign in to comment.