Skip to content
Open
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
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 @@ -75,7 +90,7 @@ async Task<int> GetEventHubPartitionCountAsync()
EventHubConsumerClient.DefaultConsumerGroupName,
this.eventHubNamespace,
this.eventHubName,
new AzureCliCredential(),
this.credential,
consumerOptions);

string[] partitionIds = await consumer.GetPartitionIdsAsync();
Expand Down Expand Up @@ -240,7 +255,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
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
},
"Microsoft.Azure.Devices.Client": {
"type": "Direct",
"requested": "[1.43.0-edgeLts, 1.43.0-edgeLts]",
"resolved": "1.43.0-edgeLts",
"contentHash": "lmcZUT04unp09ZoY9RdXTHjjsZrKs1oFotyvOlZBpsYD06R0/CTpfjbuk54LOqkH0NDk2lErnPAH/+/FE04fMg==",
"requested": "[1.43.2-edgeLts, 1.43.2-edgeLts]",
"resolved": "1.43.2-edgeLts",
"contentHash": "Is/Fed8WHB6E97Hjk2bgKmxH3daVWpNrMX+lJ2ZNJlDlh3PWxgbd1QMETap0cp7ahpn13YXEzvsWmjuZ//XvrQ==",
"dependencies": {
"MQTTnet": "5.1.0.1559",
"Microsoft.Azure.Amqp": "2.6.9",
Expand Down
8 changes: 4 additions & 4 deletions test/Microsoft.Azure.Devices.Edge.Test/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@
},
"Microsoft.Azure.Devices.Client": {
"type": "Transitive",
"resolved": "1.43.0-edgeLts",
"contentHash": "lmcZUT04unp09ZoY9RdXTHjjsZrKs1oFotyvOlZBpsYD06R0/CTpfjbuk54LOqkH0NDk2lErnPAH/+/FE04fMg==",
"resolved": "1.43.2-edgeLts",
"contentHash": "Is/Fed8WHB6E97Hjk2bgKmxH3daVWpNrMX+lJ2ZNJlDlh3PWxgbd1QMETap0cp7ahpn13YXEzvsWmjuZ//XvrQ==",
"dependencies": {
"MQTTnet": "5.1.0.1559",
"Microsoft.Azure.Amqp": "2.6.9",
Expand Down Expand Up @@ -708,7 +708,7 @@
"microsoft.azure.devices.edge.moduleutil": {
"type": "Project",
"dependencies": {
"Microsoft.Azure.Devices.Client": "[1.43.0-edgeLts, 1.43.0-edgeLts]",
"Microsoft.Azure.Devices.Client": "[1.43.2-edgeLts, 1.43.2-edgeLts]",
"Microsoft.Azure.Devices.Edge.Util": "[1.0.0, )"
}
},
Expand All @@ -725,7 +725,7 @@
"Azure.Identity": "[1.17.1, )",
"Azure.Messaging.EventHubs": "[5.12.2, )",
"Microsoft.Azure.Devices": "[1.42.0-edgeLts, 1.42.0-edgeLts]",
"Microsoft.Azure.Devices.Client": "[1.43.0-edgeLts, 1.43.0-edgeLts]",
"Microsoft.Azure.Devices.Client": "[1.43.2-edgeLts, 1.43.2-edgeLts]",
"Microsoft.Azure.Devices.Edge.Util": "[1.0.0, )",
"Microsoft.Extensions.Configuration.Binder": "[10.0.0, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "[10.0.0, )",
Expand Down
6 changes: 3 additions & 3 deletions test/modules/ModuleLib/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net10.0": {
"Microsoft.Azure.Devices.Client": {
"type": "Direct",
"requested": "[1.43.0-edgeLts, 1.43.0-edgeLts]",
"resolved": "1.43.0-edgeLts",
"contentHash": "lmcZUT04unp09ZoY9RdXTHjjsZrKs1oFotyvOlZBpsYD06R0/CTpfjbuk54LOqkH0NDk2lErnPAH/+/FE04fMg==",
"requested": "[1.43.2-edgeLts, 1.43.2-edgeLts]",
"resolved": "1.43.2-edgeLts",
"contentHash": "Is/Fed8WHB6E97Hjk2bgKmxH3daVWpNrMX+lJ2ZNJlDlh3PWxgbd1QMETap0cp7ahpn13YXEzvsWmjuZ//XvrQ==",
"dependencies": {
"MQTTnet": "5.1.0.1559",
"Microsoft.Azure.Amqp": "2.6.9",
Expand Down