Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"Microsoft.Azure.Devices.Client": {
"type": "Direct",
"requested": "[1.42.3, )",
"resolved": "1.42.3",
"contentHash": "U0u26o1Bc/h+Qq3AHek82BfUabkPie3eWtCqHFxDT9y0TIm/ZkdX2nNRYqkdfjexQEewUJXetfDRXKxR9gXY4g==",
"dependencies": {
"Azure.Storage.Blobs": "12.19.1",
"DotNetty.Codecs.Mqtt": "0.7.6",
"DotNetty.Common": "0.7.6",
"DotNetty.Handlers": "0.7.6",
"Microsoft.Azure.Amqp": "2.5.12",
"Microsoft.Azure.Devices.Shared": "1.30.4",
"Microsoft.Win32.Registry": "4.5.0",
"Newtonsoft.Json": "13.0.3",
"System.Configuration.ConfigurationManager": "4.4.1"
}
},
"Microsoft.NET.Test.Sdk": {
"type": "Direct",
"requested": "[17.3.1, )",
Expand Down Expand Up @@ -261,21 +278,6 @@
"resolved": "2.6.9",
"contentHash": "5i9XzfqxK1H5IBl+OuOV1jwJdrOvi5RUwsZgVOryZm0GCzcM9NWPNRxzPAbsSeaR2T6+1gGvdT3vR+Vbha6KFQ=="
},
"Microsoft.Azure.Devices.Client": {
"type": "Transitive",
"resolved": "1.36.10",
"contentHash": "jzvpHqH/FgyAPvDgQVrpgFhqzbo9FA5k5nqfRRZ6ghTGUsEmtjUGCbzvq9m2tm970G8HBOv7vwqgC7X678JXiw==",
"dependencies": {
"Azure.Storage.Blobs": "12.19.1",
"DotNetty.Codecs.Mqtt": "0.7.6",
"DotNetty.Handlers": "0.7.6",
"Microsoft.Azure.Amqp": "2.5.12",
"Microsoft.Azure.Devices.Shared": "1.27.2",
"Microsoft.Win32.Registry": "4.5.0",
"Newtonsoft.Json": "12.0.3",
"System.Configuration.ConfigurationManager": "4.4.1"
}
},
"Microsoft.Azure.Devices.Shared": {
"type": "Transitive",
"resolved": "1.30.4",
Expand Down
23 changes: 19 additions & 4 deletions test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace Microsoft.Azure.Devices.Edge.Test.Common

public class IotHub
{
readonly AzureCliCredential credential;
readonly string eventHubName;
readonly string eventHubNamespace;
readonly Lazy<Task<int>> eventHubPartitionCount;
Expand All @@ -27,8 +28,22 @@ public class IotHub
readonly Lazy<ServiceClient> serviceClient;
static readonly TimeSpan eventHubRequestDuration = TimeSpan.FromSeconds(20);

static AzureCliCredential CreateAzureCliCredential()
{
if (OsPlatform.IsArm() && OsPlatform.Is32Bit())
{
return new AzureCliCredential(new AzureCliCredentialOptions
{
ProcessTimeout = TimeSpan.FromSeconds(60)
});
}

return new AzureCliCredential();
}

public IotHub(string iotHubHostname, string eventHubName, string eventHubNamespace, Option<Uri> proxyUri)
{
this.credential = IotHub.CreateAzureCliCredential();
this.eventHubName = eventHubName;
this.eventHubNamespace = eventHubNamespace;
this.iotHubHostname = iotHubHostname;
Expand All @@ -41,7 +56,7 @@ public IotHub(string iotHubHostname, string eventHubName, string eventHubNamespa
proxy.ForEach(p => settings.Proxy = p);
return RegistryManager.Create(
this.iotHubHostname,
new AzureCliCredential(),
this.credential,
settings);
});

Expand All @@ -52,7 +67,7 @@ public IotHub(string iotHubHostname, string eventHubName, string eventHubNamespa
proxy.ForEach(p => settings.HttpProxy = p);
return ServiceClient.Create(
this.iotHubHostname,
new AzureCliCredential(),
this.credential,
DeviceTransportType.Amqp_WebSocket_Only,
settings);
});
Expand All @@ -71,7 +86,7 @@ public IotHub(string iotHubHostname, string eventHubName, string eventHubNamespa
EventHubConsumerClient.DefaultConsumerGroupName,
this.eventHubNamespace,
this.eventHubName,
new AzureCliCredential(),
this.credential,
consumerOptions);

return consumer.GetPartitionIdsAsync()
Expand Down Expand Up @@ -228,7 +243,7 @@ public async Task ReceiveEventsAsync(
EventPosition.FromEnqueuedTime(seekTime),
this.eventHubNamespace,
this.eventHubName,
new AzureCliCredential());
this.credential);

var result = new TaskCompletionSource<bool>();
using (token.Register(() => result.TrySetCanceled()))
Expand Down
2 changes: 2 additions & 0 deletions test/Microsoft.Azure.Devices.Edge.Test.Common/OsPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class OsPlatform
{
public static readonly IOsPlatform Current = new Linux.OsPlatform();

public static bool Is32Bit() => RuntimeInformation.OSArchitecture == Architecture.X86 || RuntimeInformation.OSArchitecture == Architecture.Arm;

public static bool Is64Bit() => RuntimeInformation.OSArchitecture == Architecture.X64 || RuntimeInformation.OSArchitecture == Architecture.Arm64;

public static bool IsArm() => RuntimeInformation.OSArchitecture == Architecture.Arm || RuntimeInformation.OSArchitecture == Architecture.Arm64;
Expand Down