diff --git a/edge-agent/test/Microsoft.Azure.Devices.Edge.Agent.IoTHub.Test/packages.lock.json b/edge-agent/test/Microsoft.Azure.Devices.Edge.Agent.IoTHub.Test/packages.lock.json index 483a5ded1c6..d36a6392a03 100644 --- a/edge-agent/test/Microsoft.Azure.Devices.Edge.Agent.IoTHub.Test/packages.lock.json +++ b/edge-agent/test/Microsoft.Azure.Devices.Edge.Agent.IoTHub.Test/packages.lock.json @@ -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, )", @@ -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", diff --git a/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs b/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs index 2f811a4e95b..53076824dcf 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs @@ -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> eventHubPartitionCount; @@ -27,8 +28,22 @@ public class IotHub readonly Lazy 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 proxyUri) { + this.credential = IotHub.CreateAzureCliCredential(); this.eventHubName = eventHubName; this.eventHubNamespace = eventHubNamespace; this.iotHubHostname = iotHubHostname; @@ -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); }); @@ -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); }); @@ -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() @@ -228,7 +243,7 @@ public async Task ReceiveEventsAsync( EventPosition.FromEnqueuedTime(seekTime), this.eventHubNamespace, this.eventHubName, - new AzureCliCredential()); + this.credential); var result = new TaskCompletionSource(); using (token.Register(() => result.TrySetCanceled())) diff --git a/test/Microsoft.Azure.Devices.Edge.Test.Common/OsPlatform.cs b/test/Microsoft.Azure.Devices.Edge.Test.Common/OsPlatform.cs index 0346eb0f5f5..0b33debbdae 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/OsPlatform.cs +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/OsPlatform.cs @@ -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;