def __init__(self, test_method):
        super(TestDPSEnrollments, self).__init__(test_method)
        self.cmd_shell = Setting()
        setattr(self.cmd_shell, "cli_ctx", self.cli_ctx)

        _ensure_dps_hub_link(self, dps, rg, hub)

        output_dir = os.getcwd()
        create_self_signed_certificate(cert_name, 200, output_dir, True)
        base_enrollment_props = {
            "count": None,
            "metadata": None,
            "version": None,
        }
        self.kwargs["generic_dict"] = {
            **base_enrollment_props,
            "key": "value",
        }
        self.kwargs["twin_array_dict"] = {
            **base_enrollment_props,
            "values": [{
                "key1": "value1"
            }, {
                "key2": "value2"
            }],
        }

        _cleanup_enrollments(self, dps, rg)
 def __init__(self, test_method):
     super(IoTDpsTest, self).__init__('test_dps_enrollment_tpm_lifecycle')
     output_dir = os.getcwd()
     create_self_signed_certificate(cert_name, 200, output_dir, True)
     self.kwargs['generic_dict'] = {
         'count': None,
         'key': 'value',
         'metadata': None,
         'version': None
     }
Exemple #3
0
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azext_iot.common.certops import create_self_signed_certificate
from azext_iot.common.shared import AuthenticationTypeDataplane

DATAPLANE_AUTH_TYPES = [
    AuthenticationTypeDataplane.key.value,
    AuthenticationTypeDataplane.login.value,
    "cstring",
]

PRIMARY_THUMBPRINT = create_self_signed_certificate(
    subject="aziotcli", valid_days=1, cert_output_dir=None)["thumbprint"]
SECONDARY_THUMBPRINT = create_self_signed_certificate(
    subject="aziotcli", valid_days=1, cert_output_dir=None)["thumbprint"]

DEVICE_TYPES = ["non-edge", "edge"]