Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed product test certification service URL #514

Merged
merged 6 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azext_iot/product/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ class ValidationType(Enum):
certification = "Certification"


BASE_URL = "https://certify.azureiotsolutions.com"
BASE_URL = "https://api.certify.azure.com"
2 changes: 0 additions & 2 deletions azext_iot/tests/product/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
# --------------------------------------------------------------------------------------------

from azure.cli.testsdk import LiveScenarioTest
import pytest


@pytest.mark.skipif(True, reason="Skipping AICS tests due to environment inconsistencies")
class AICSLiveScenarioTest(LiveScenarioTest):
def __init__(self, test_scenario):
assert test_scenario
Expand Down
5 changes: 4 additions & 1 deletion azext_iot/tests/product/test_aics_e2e_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_e2e(self):

self.kwargs.update({"device_test_id": test["id"]})

sleep(1)
test = self.cmd(
"iot product test show -t {device_test_id} --base-url {BASE_URL}"
).get_output_in_json()
Expand All @@ -82,7 +83,9 @@ def test_e2e(self):
).get_output_in_json()[0]

assert json.dumps(test_task)
assert test_task.get("status") == DeviceTestTaskStatus.queued.value

# Ensure test task is queued (or started, depending on timing)
assert test_task.get("status") in [DeviceTestTaskStatus.queued.value, DeviceTestTaskStatus.started.value]
assert test_task.get("error") is None
assert test_task.get("type") == TaskType.GenerateTestCases.value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_list_edge(self):
expected = [
{
"badgeType": "IotEdgeCompatible",
"provisioningRequirement": {"provisioningTypes": ["ConnectionString"]},
"provisioningRequirement": {"provisioningTypes": ["ConnectionString", "TPM"]},
}
]
assert create_output == expected
Expand Down
11 changes: 10 additions & 1 deletion azext_iot/tests/product/test_device_test_tasks_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ def teardown(self):

def test_product_device_test_tasks(self):

# see if existing task is created
exists = self.cmd("iot product test task show --running -t {device_test_id} --base-url {BASE_URL}")
if(exists.output):
# delete it before attempting to create a new one
id = exists.get_output_in_json()[0]['id']
self.cmd("iot product test task delete -t {} --task-id {} --base-url {}"
.format(self.kwargs['device_test_id'], id, self.kwargs['BASE_URL']))
sleep(5)

# create task for GenerateTestCases
created = self.cmd(
"iot product test task create -t {device_test_id} --type {generate_task} --wait --base-url {BASE_URL}"
Expand Down Expand Up @@ -65,7 +74,7 @@ def test_product_device_test_tasks(self):
assert queue_task["type"] == TaskType.QueueTestRun.value
assert queue_task["status"] != DeviceTestTaskStatus.queued.value

if queue_task["status"] == DeviceTestTaskStatus.running:
if queue_task["status"] == DeviceTestTaskStatus.running.value:
# Cancel running test task
self.cmd(
"iot product test task delete -t {device_test_id} --task-id {queue_task_id} --base-url {BASE_URL}"
Expand Down