зеркало из https://github.com/Azure/iotedge.git
Update Code Style (#1629)
* Enable SA1210 - using directives within a C# code file are sorted alphabetically by namespace * Enable SA1008 - An opening parenthesis within a C# statement is not spaced correctly. * Enable SA1129 - DoNotUseDefaultValueTypeConstructor. * Enable SA1131 - A comparison was made between a variable and a literal or constant value, and the variable appeared on the right-hand side of the expression. * Enable SA1308 - A field name in C# is prefixed with m_ or s_. * Enable AS1309 - A field name in C# begins with an underscore. * Fix SA1210 due to case sensitive issue
This commit is contained in:
Родитель
89f5ca5ca6
Коммит
36af98b646
|
@ -100,7 +100,7 @@
|
|||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestUseVarKeywordEvident/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMember_002ELocal/@EntryIndexedValue">SUGGESTION</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedParameter_002ELocal/@EntryIndexedValue">HINT</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Azure_002EIoT_002EEdge/@EntryIndexedValue"><?xml version="1.0" encoding="utf-16"?><Profile name="Azure.IoT.Edge"><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><HtmlReformatCode>True</HtmlReformatCode><CSArrangeThisQualifier>True</CSArrangeThisQualifier><CSRemoveCodeRedundancies>True</CSRemoveCodeRedundancies><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSUpdateFileHeader>True</CSUpdateFileHeader><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><VBOptimizeImports>True</VBOptimizeImports><VBShortenReferences>True</VBShortenReferences><VBReformatCode>True</VBReformatCode><JsInsertSemicolon>True</JsInsertSemicolon><JsReformatCode>True</JsReformatCode><CssAlphabetizeProperties>True</CssAlphabetizeProperties><CssReformatCode>True</CssReformatCode><CSUseVar><BehavourStyle>CAN_CHANGE_TO_EXPLICIT</BehavourStyle><LocalVariableStyle>IMPLICIT_EXCEPT_SIMPLE_TYPES</LocalVariableStyle><ForeachVariableStyle>IMPLICIT_EXCEPT_SIMPLE_TYPES</ForeachVariableStyle></CSUseVar><XMLReformatCode>True</XMLReformatCode><StyleCop.Documentation><SA1600ElementsMustBeDocumented>False</SA1600ElementsMustBeDocumented><SA1604ElementDocumentationMustHaveSummary>False</SA1604ElementDocumentationMustHaveSummary><SA1609PropertyDocumentationMustHaveValueDocumented>False</SA1609PropertyDocumentationMustHaveValueDocumented><SA1611ElementParametersMustBeDocumented>False</SA1611ElementParametersMustBeDocumented><SA1615ElementReturnValueMustBeDocumented>True</SA1615ElementReturnValueMustBeDocumented><SA1617VoidReturnValueMustNotBeDocumented>True</SA1617VoidReturnValueMustNotBeDocumented><SA1618GenericTypeParametersMustBeDocumented>False</SA1618GenericTypeParametersMustBeDocumented><SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes>True</SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes><SA1628DocumentationTextMustBeginWithACapitalLetter>True</SA1628DocumentationTextMustBeginWithACapitalLetter><SA1629DocumentationTextMustEndWithAPeriod>True</SA1629DocumentationTextMustEndWithAPeriod><SA1633SA1641UpdateFileHeader>Ignore</SA1633SA1641UpdateFileHeader><SA1639FileHeaderMustHaveSummary>False</SA1639FileHeaderMustHaveSummary><SA1642ConstructorSummaryDocumentationMustBeginWithStandardText>True</SA1642ConstructorSummaryDocumentationMustBeginWithStandardText><SA1643DestructorSummaryDocumentationMustBeginWithStandardText>True</SA1643DestructorSummaryDocumentationMustBeginWithStandardText><SA1644DocumentationHeadersMustNotContainBlankLines>True</SA1644DocumentationHeadersMustNotContainBlankLines></StyleCop.Documentation><CSReorderTypeMembers>True</CSReorderTypeMembers><CSArrangeQualifiers>True</CSArrangeQualifiers><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><PublicModifierStyleTs>True</PublicModifierStyleTs><ExplicitAnyTs>True</ExplicitAnyTs><TypeAnnotationStyleTs>True</TypeAnnotationStyleTs><RelativePathStyleTs>True</RelativePathStyleTs><OptimizeReferenceCommentsTs>True</OptimizeReferenceCommentsTs><OptimizeImportsTs>True</OptimizeImportsTs><RemoveRedundantQualifiersTs>True</RemoveRedundantQualifiersTs><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="False" AddMissingParentheses="True" ArrangeAttributes="True" /></Profile></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Azure_002EIoT_002EEdge/@EntryIndexedValue"><?xml version="1.0" encoding="utf-16"?><Profile name="Azure.IoT.Edge"><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><HtmlReformatCode>True</HtmlReformatCode><CSArrangeThisQualifier>True</CSArrangeThisQualifier><CSRemoveCodeRedundancies>True</CSRemoveCodeRedundancies><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSUpdateFileHeader>True</CSUpdateFileHeader><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSReformatCode>True</CSReformatCode><VBOptimizeImports>True</VBOptimizeImports><VBShortenReferences>True</VBShortenReferences><VBReformatCode>True</VBReformatCode><JsInsertSemicolon>True</JsInsertSemicolon><JsReformatCode>True</JsReformatCode><CssAlphabetizeProperties>True</CssAlphabetizeProperties><CssReformatCode>True</CssReformatCode><CSUseVar><BehavourStyle>CAN_CHANGE_TO_EXPLICIT</BehavourStyle><LocalVariableStyle>IMPLICIT_EXCEPT_SIMPLE_TYPES</LocalVariableStyle><ForeachVariableStyle>IMPLICIT_EXCEPT_SIMPLE_TYPES</ForeachVariableStyle></CSUseVar><XMLReformatCode>True</XMLReformatCode><StyleCop.Documentation><SA1600ElementsMustBeDocumented>False</SA1600ElementsMustBeDocumented><SA1604ElementDocumentationMustHaveSummary>False</SA1604ElementDocumentationMustHaveSummary><SA1609PropertyDocumentationMustHaveValueDocumented>False</SA1609PropertyDocumentationMustHaveValueDocumented><SA1611ElementParametersMustBeDocumented>False</SA1611ElementParametersMustBeDocumented><SA1615ElementReturnValueMustBeDocumented>True</SA1615ElementReturnValueMustBeDocumented><SA1617VoidReturnValueMustNotBeDocumented>True</SA1617VoidReturnValueMustNotBeDocumented><SA1618GenericTypeParametersMustBeDocumented>False</SA1618GenericTypeParametersMustBeDocumented><SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes>True</SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes><SA1628DocumentationTextMustBeginWithACapitalLetter>True</SA1628DocumentationTextMustBeginWithACapitalLetter><SA1629DocumentationTextMustEndWithAPeriod>True</SA1629DocumentationTextMustEndWithAPeriod><SA1633SA1641UpdateFileHeader>Ignore</SA1633SA1641UpdateFileHeader><SA1639FileHeaderMustHaveSummary>False</SA1639FileHeaderMustHaveSummary><SA1642ConstructorSummaryDocumentationMustBeginWithStandardText>True</SA1642ConstructorSummaryDocumentationMustBeginWithStandardText><SA1643DestructorSummaryDocumentationMustBeginWithStandardText>True</SA1643DestructorSummaryDocumentationMustBeginWithStandardText><SA1644DocumentationHeadersMustNotContainBlankLines>True</SA1644DocumentationHeadersMustNotContainBlankLines></StyleCop.Documentation><CSReorderTypeMembers>True</CSReorderTypeMembers><CSArrangeQualifiers>True</CSArrangeQualifiers><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><PublicModifierStyleTs>True</PublicModifierStyleTs><ExplicitAnyTs>True</ExplicitAnyTs><TypeAnnotationStyleTs>True</TypeAnnotationStyleTs><RelativePathStyleTs>True</RelativePathStyleTs><OptimizeReferenceCommentsTs>True</OptimizeReferenceCommentsTs><OptimizeImportsTs>True</OptimizeImportsTs><RemoveRedundantQualifiersTs>True</RemoveRedundantQualifiersTs><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="False" AddMissingParentheses="True" ArrangeAttributes="True" /></Profile></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Default/@EntryIndexedValue"></s:String>
|
||||
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Default/@EntryIndexRemoved">True</s:Boolean>
|
||||
|
@ -121,6 +121,7 @@
|
|||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_LINQ_QUERY/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_ARGUMENT/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_ARRAY_AND_OBJECT_INITIALIZER/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">NEXT_LINE</s:String>
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AFTER_START_COMMENT/@EntryValue">0</s:Int64>
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AROUND_NAMESPACE/@EntryValue">1</s:Int64>
|
||||
|
|
|
@ -9,13 +9,13 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Logs
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using akka::Akka;
|
||||
using akka::Akka.Actor;
|
||||
using akka::Akka.IO;
|
||||
using Akka.Streams;
|
||||
using Akka.Streams.Dsl;
|
||||
using Microsoft.Azure.Devices.Edge.Storage;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using AkkaActor = akka::Akka.Actor;
|
||||
using AkkaIO = akka::Akka.IO;
|
||||
using AkkaNet = akka::Akka;
|
||||
|
||||
// Processes incoming logs stream and converts to the required format
|
||||
//
|
||||
|
@ -29,20 +29,20 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Logs
|
|||
// unused
|
||||
public class LogsProcessor : ILogsProcessor, IDisposable
|
||||
{
|
||||
static readonly Flow<ByteString, ByteString, NotUsed> FramingFlow
|
||||
= Framing.LengthField(4, int.MaxValue, 4, ByteOrder.BigEndian);
|
||||
static readonly Flow<AkkaIO.ByteString, AkkaIO.ByteString, AkkaNet.NotUsed> FramingFlow
|
||||
= Framing.LengthField(4, int.MaxValue, 4, AkkaIO.ByteOrder.BigEndian);
|
||||
|
||||
static readonly Flow<ByteString, ByteString, NotUsed> SimpleLengthFraming
|
||||
static readonly Flow<AkkaIO.ByteString, AkkaIO.ByteString, AkkaNet.NotUsed> SimpleLengthFraming
|
||||
= Framing.SimpleFramingProtocolEncoder(int.MaxValue);
|
||||
|
||||
readonly ActorSystem system;
|
||||
readonly AkkaActor.ActorSystem system;
|
||||
readonly ActorMaterializer materializer;
|
||||
readonly ILogMessageParser logMessageParser;
|
||||
|
||||
public LogsProcessor(ILogMessageParser logMessageParser)
|
||||
{
|
||||
this.logMessageParser = Preconditions.CheckNotNull(logMessageParser, nameof(logMessageParser));
|
||||
this.system = ActorSystem.Create("LogsProcessor");
|
||||
this.system = AkkaActor.ActorSystem.Create("LogsProcessor");
|
||||
this.materializer = this.system.Materializer();
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Logs
|
|||
? new ArraySegment<byte>(l.FullText.ToBytes())
|
||||
: new ArraySegment<byte>(l.ToBytes());
|
||||
|
||||
var sourceMappers = new List<Func<Source<ArraySegment<byte>, NotUsed>, Source<ArraySegment<byte>, NotUsed>>>();
|
||||
var sourceMappers = new List<Func<Source<ArraySegment<byte>, AkkaNet.NotUsed>, Source<ArraySegment<byte>, AkkaNet.NotUsed>>>();
|
||||
|
||||
if (logOptions.ContentEncoding == LogsContentEncoding.Gzip)
|
||||
{
|
||||
|
@ -134,15 +134,15 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Logs
|
|||
this.materializer?.Dispose();
|
||||
}
|
||||
|
||||
static Source<ArraySegment<byte>, NotUsed> SimpleLengthFramingMapper(Source<ArraySegment<byte>, NotUsed> s) =>
|
||||
s.Select(ByteString.FromBytes)
|
||||
static Source<ArraySegment<byte>, AkkaNet.NotUsed> SimpleLengthFramingMapper(Source<ArraySegment<byte>, AkkaNet.NotUsed> s) =>
|
||||
s.Select(AkkaIO.ByteString.FromBytes)
|
||||
.Via(SimpleLengthFraming)
|
||||
.Select(b => new ArraySegment<byte>(b.ToArray()));
|
||||
|
||||
static Source<ArraySegment<byte>, NotUsed> NonGroupingGzipMapper(Source<ArraySegment<byte>, NotUsed> s) =>
|
||||
static Source<ArraySegment<byte>, AkkaNet.NotUsed> NonGroupingGzipMapper(Source<ArraySegment<byte>, AkkaNet.NotUsed> s) =>
|
||||
s.Select(m => new ArraySegment<byte>(Compression.CompressToGzip(m.Array)));
|
||||
|
||||
static Source<ArraySegment<byte>, NotUsed> GroupingGzipMapper(Source<ArraySegment<byte>, NotUsed> s, LogsOutputGroupingConfig outputGroupingConfig) =>
|
||||
static Source<ArraySegment<byte>, AkkaNet.NotUsed> GroupingGzipMapper(Source<ArraySegment<byte>, AkkaNet.NotUsed> s, LogsOutputGroupingConfig outputGroupingConfig) =>
|
||||
s.GroupedWithin(outputGroupingConfig.MaxFrames, outputGroupingConfig.MaxDuration)
|
||||
.Select(
|
||||
b =>
|
||||
|
@ -154,20 +154,20 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Logs
|
|||
|
||||
class GraphBuilder
|
||||
{
|
||||
Source<ModuleLogMessageData, NotUsed> parsingGraphSource;
|
||||
Source<ModuleLogMessageData, AkkaNet.NotUsed> parsingGraphSource;
|
||||
|
||||
GraphBuilder(Source<ModuleLogMessageData, NotUsed> parsingGraphSource)
|
||||
GraphBuilder(Source<ModuleLogMessageData, AkkaNet.NotUsed> parsingGraphSource)
|
||||
{
|
||||
this.parsingGraphSource = parsingGraphSource;
|
||||
}
|
||||
|
||||
public static GraphBuilder CreateParsingGraphBuilder(Stream stream, Func<ByteString, ModuleLogMessageData> parserFunc)
|
||||
public static GraphBuilder CreateParsingGraphBuilder(Stream stream, Func<AkkaIO.ByteString, ModuleLogMessageData> parserFunc)
|
||||
{
|
||||
var source = StreamConverters.FromInputStream(() => stream);
|
||||
var graph = source
|
||||
.Via(FramingFlow)
|
||||
.Select(parserFunc)
|
||||
.MapMaterializedValue(_ => NotUsed.Instance);
|
||||
.MapMaterializedValue(_ => AkkaNet.NotUsed.Instance);
|
||||
return new GraphBuilder(graph);
|
||||
}
|
||||
|
||||
|
@ -199,14 +199,14 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Logs
|
|||
public IRunnableGraph<Task> GetStreamingGraph<TU, TV>(
|
||||
Func<TV, Task<TU>> callback,
|
||||
Func<ModuleLogMessageData, TV> basicMapper,
|
||||
List<Func<Source<TV, NotUsed>, Source<TV, NotUsed>>> mappers)
|
||||
List<Func<Source<TV, AkkaNet.NotUsed>, Source<TV, AkkaNet.NotUsed>>> mappers)
|
||||
{
|
||||
Source<TV, NotUsed> streamingGraphSource = this.parsingGraphSource
|
||||
Source<TV, AkkaNet.NotUsed> streamingGraphSource = this.parsingGraphSource
|
||||
.Select(basicMapper);
|
||||
|
||||
if (mappers?.Count > 0)
|
||||
{
|
||||
foreach (Func<Source<TV, NotUsed>, Source<TV, NotUsed>> mapper in mappers)
|
||||
foreach (Func<Source<TV, AkkaNet.NotUsed>, Source<TV, AkkaNet.NotUsed>> mapper in mappers)
|
||||
{
|
||||
streamingGraphSource = mapper(streamingGraphSource);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
namespace Microsoft.Azure.Devices.Edge.Agent.Core.Requests
|
||||
{
|
||||
extern alias akka;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Microsoft.Azure.Devices.Edge.Agent.Docker.Test")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.Azure.Devices.Edge.Agent.Docker.Test")]
|
||||
|
|
|
@ -75,13 +75,13 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Docker
|
|||
}
|
||||
|
||||
return string.Equals(this.Name, other.Name) &&
|
||||
string.Equals(this.Version, other.Version) &&
|
||||
string.Equals(this.Type, other.Type) &&
|
||||
this.DesiredStatus == other.DesiredStatus &&
|
||||
this.Config.Equals(other.Config) &&
|
||||
this.RestartPolicy == other.RestartPolicy &&
|
||||
this.ImagePullPolicy == other.ImagePullPolicy &&
|
||||
EnvDictionaryComparer.Equals(this.Env, other.Env);
|
||||
string.Equals(this.Version, other.Version) &&
|
||||
string.Equals(this.Type, other.Type) &&
|
||||
this.DesiredStatus == other.DesiredStatus &&
|
||||
this.Config.Equals(other.Config) &&
|
||||
this.RestartPolicy == other.RestartPolicy &&
|
||||
this.ImagePullPolicy == other.ImagePullPolicy &&
|
||||
EnvDictionaryComparer.Equals(this.Env, other.Env);
|
||||
}
|
||||
|
||||
public virtual bool IsOnlyModuleStatusChanged(IModule other)
|
||||
|
|
|
@ -4,7 +4,6 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Docker
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Core;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class EdgeAgentDockerRuntimeModule : DockerRuntimeModule, IEdgeAgentModule
|
||||
|
|
|
@ -15,15 +15,15 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Docker.Commands
|
|||
|
||||
public class CreateCommand : ICommand
|
||||
{
|
||||
readonly CreateContainerParameters createContainerParameters;
|
||||
readonly IDockerClient client;
|
||||
|
||||
static readonly Dictionary<string, PortBinding> EdgeHubPortBinding = new Dictionary<string, PortBinding>
|
||||
{
|
||||
{ "8883/tcp", new PortBinding { HostPort = "8883" } },
|
||||
{ "443/tcp", new PortBinding { HostPort = "443" } }
|
||||
};
|
||||
|
||||
readonly CreateContainerParameters createContainerParameters;
|
||||
readonly IDockerClient client;
|
||||
|
||||
readonly Lazy<string> id;
|
||||
|
||||
public CreateCommand(IDockerClient client, CreateContainerParameters createContainerParameters)
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Docker.Commands
|
|||
static readonly ILogger Logger = Util.Logger.Factory.CreateLogger<RemoveCommand>();
|
||||
readonly IDockerClient client;
|
||||
readonly DockerModule module;
|
||||
|
||||
public RemoveCommand(IDockerClient client, DockerModule module)
|
||||
{
|
||||
this.client = Preconditions.CheckNotNull(client, nameof(client));
|
||||
|
|
|
@ -10,8 +10,8 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Edgelet.Version_2018_06_28
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Core;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Edgelet.Versioning;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Edgelet.Version_2018_06_28.GeneratedCode;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Edgelet.Versioning;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Azure.Devices.Edge.Util.Edged;
|
||||
using Microsoft.Azure.Devices.Edge.Util.TransientFaultHandling;
|
||||
|
|
|
@ -10,8 +10,8 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Edgelet.Version_2019_01_30
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Core;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Edgelet.Versioning;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Edgelet.Version_2019_01_30.GeneratedCode;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Edgelet.Versioning;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Azure.Devices.Edge.Util.Edged;
|
||||
using Microsoft.Azure.Devices.Edge.Util.TransientFaultHandling;
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
[Unit]
|
||||
public async void ReconcileAsyncOnEmptyPlan()
|
||||
{
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var serde = Mock.Of<ISerde<DeploymentConfigInfo>>();
|
||||
var mockConfigSource = new Mock<IConfigSource>();
|
||||
var mockEnvironment = new Mock<IEnvironment>();
|
||||
|
@ -146,7 +146,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
var mockPlanner = new Mock<IPlanner>();
|
||||
var mockPlanRunner = new Mock<IPlanRunner>();
|
||||
var mockReporter = new Mock<IReporter>();
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var currentSet = ModuleSet.Empty;
|
||||
var mockModuleIdentityLifecycleManager = new Mock<IModuleIdentityLifecycleManager>();
|
||||
var configStore = Mock.Of<IEntityStore<string, string>>();
|
||||
|
@ -182,7 +182,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
var mockPlanner = new Mock<IPlanner>();
|
||||
var mockPlanRunner = new Mock<IPlanRunner>();
|
||||
var mockReporter = new Mock<IReporter>();
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var currentSet = ModuleSet.Empty;
|
||||
var mockModuleIdentityLifecycleManager = new Mock<IModuleIdentityLifecycleManager>();
|
||||
var configStore = Mock.Of<IEntityStore<string, string>>();
|
||||
|
@ -217,7 +217,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
var mockPlanner = new Mock<IPlanner>();
|
||||
var mockPlanRunner = new Mock<IPlanRunner>();
|
||||
var mockReporter = new Mock<IReporter>();
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var mockModuleIdentityLifecycleManager = new Mock<IModuleIdentityLifecycleManager>();
|
||||
var configStore = Mock.Of<IEntityStore<string, string>>();
|
||||
var mockEnvironmentProvider = Mock.Of<IEnvironmentProvider>(m => m.Create(It.IsAny<DeploymentConfig>()) == mockEnvironment.Object);
|
||||
|
@ -251,7 +251,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
var mockPlanner = new Mock<IPlanner>();
|
||||
var mockPlanRunner = new Mock<IPlanRunner>();
|
||||
var mockReporter = new Mock<IReporter>();
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var mockModuleIdentityLifecycleManager = new Mock<IModuleIdentityLifecycleManager>();
|
||||
var configStore = Mock.Of<IEntityStore<string, string>>();
|
||||
var mockEnvironmentProvider = Mock.Of<IEnvironmentProvider>(m => m.Create(It.IsAny<DeploymentConfig>()) == mockEnvironment.Object);
|
||||
|
@ -290,7 +290,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
[Unit]
|
||||
public async void ReconcileAsyncReportsFailedWhenEncryptProviderThrows()
|
||||
{
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var serde = Mock.Of<ISerde<DeploymentConfigInfo>>();
|
||||
var mockConfigSource = new Mock<IConfigSource>();
|
||||
var mockEnvironment = new Mock<IEnvironment>();
|
||||
|
@ -364,9 +364,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
new TestCommand(TestCommandType.TestRemove, currentModule, recordKeeper)
|
||||
};
|
||||
var testPlan = new Plan(commandList);
|
||||
|
||||
var token = new CancellationToken();
|
||||
|
||||
var token = default(CancellationToken);
|
||||
var runtimeInfo = Mock.Of<IRuntimeInfo>();
|
||||
var deploymentConfig = new DeploymentConfig("1.0", runtimeInfo, new SystemModules(null, null), new Dictionary<string, IModule> { ["desired"] = desiredModule });
|
||||
var deploymentConfigInfo = new DeploymentConfigInfo(0, deploymentConfig);
|
||||
|
@ -418,7 +416,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
var mockReporter = new Mock<IReporter>();
|
||||
var runtimeInfo = new Mock<IRuntimeInfo>();
|
||||
var mockModuleIdentityLifecycleManager = new Mock<IModuleIdentityLifecycleManager>();
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var configStore = Mock.Of<IEntityStore<string, string>>();
|
||||
var mockEnvironmentProvider = Mock.Of<IEnvironmentProvider>(m => m.Create(It.IsAny<DeploymentConfig>()) == mockEnvironment.Object);
|
||||
var serde = Mock.Of<ISerde<DeploymentConfigInfo>>();
|
||||
|
@ -449,7 +447,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
var mockPlanRunner = new Mock<IPlanRunner>();
|
||||
var mockReporter = new Mock<IReporter>();
|
||||
var mockModuleIdentityLifecycleManager = new Mock<IModuleIdentityLifecycleManager>();
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var configStore = Mock.Of<IEntityStore<string, string>>();
|
||||
var mockEnvironmentProvider = Mock.Of<IEnvironmentProvider>(m => m.Create(It.IsAny<DeploymentConfig>()) == mockEnvironment.Object);
|
||||
var serde = Mock.Of<ISerde<DeploymentConfigInfo>>();
|
||||
|
@ -492,7 +490,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
{ "mod1", new TestModule("mod1", "1.0", "docker", ModuleStatus.Running, new TestConfig("boo"), RestartPolicy.OnUnhealthy, ImagePullPolicy.OnCreate, new ConfigurationInfo("1"), null) }
|
||||
});
|
||||
var deploymentConfigInfo = new DeploymentConfigInfo(0, deploymentConfig);
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
mockConfigSource.Setup(cs => cs.GetDeploymentConfigInfoAsync())
|
||||
.ReturnsAsync(deploymentConfigInfo);
|
||||
|
@ -555,7 +553,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
var encryptionDecryptionProvider = Mock.Of<IEncryptionProvider>();
|
||||
var deploymentConfig = new DeploymentConfig("1.0", Mock.Of<IRuntimeInfo>(), new SystemModules(null, null), modules);
|
||||
var deploymentConfigInfo = new DeploymentConfigInfo(0, deploymentConfig);
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
mockConfigSource.Setup(cs => cs.GetDeploymentConfigInfoAsync())
|
||||
.ReturnsAsync(deploymentConfigInfo);
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
NullEnvironment testNullEnvironment = NullEnvironment.Instance;
|
||||
Assert.NotNull(testNullEnvironment);
|
||||
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
ModuleSet testModuleSet = await testNullEnvironment.GetModulesAsync(token);
|
||||
|
||||
Assert.NotNull(testModuleSet);
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
Assert.True(Plan.Empty.IsEmpty);
|
||||
Assert.True(plan2.IsEmpty);
|
||||
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
var planRunner = new OrderedPlanRunner();
|
||||
await planRunner.ExecuteAsync(1, plan1, token);
|
||||
|
@ -85,7 +85,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
await factory.StopAsync(moduleExecutionList[4].Module),
|
||||
};
|
||||
var plan1 = new Plan(commandList);
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var planRunner = new OrderedPlanRunner();
|
||||
await planRunner.ExecuteAsync(1, plan1, token);
|
||||
Assert.All(
|
||||
|
@ -129,7 +129,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test
|
|||
await factory.StopAsync(moduleExecutionList[4].Module),
|
||||
};
|
||||
var plan1 = new Plan(commandList);
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var planRunner = new OrderedPlanRunner();
|
||||
AggregateException ex = await Assert.ThrowsAsync<AggregateException>(async () => await planRunner.ExecuteAsync(1, plan1, token));
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
|
|||
{
|
||||
var g = new GroupCommand(commandList.ToArray());
|
||||
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
await g.ExecuteAsync(token);
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
|
|||
{
|
||||
ICommand g = new GroupCommand(commandList.ToArray());
|
||||
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
await g.UndoAsync(token);
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
|
|||
Task<ICommand> commandBeingDecorated,
|
||||
TestExecutionExpr testExpr)
|
||||
{
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
var logFactoryMock = new Mock<ILoggerFactory>();
|
||||
var logMock = new Mock<ILogger<LoggingCommandFactory>>();
|
||||
|
@ -114,7 +114,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
|
|||
Task<ICommand> commandBeingDecorated,
|
||||
TestExecutionExpr testExpr)
|
||||
{
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
var logFactoryMock = new Mock<ILoggerFactory>();
|
||||
var logMock = new Mock<ILogger<LoggingCommandFactory>>();
|
||||
|
@ -144,7 +144,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
|
|||
Task<ICommand> commandBeingDecorated,
|
||||
TestExecutionExpr testExpr)
|
||||
{
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
var logFactoryMock = new Mock<ILoggerFactory>();
|
||||
var logMock = new Mock<ILogger<LoggingCommandFactory>>();
|
||||
|
@ -174,7 +174,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
|
|||
Task<ICommand> commandBeingDecorated,
|
||||
TestExecutionExpr testExpr)
|
||||
{
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var logFactoryMock = new Mock<ILoggerFactory>();
|
||||
var logMock = new Mock<ILogger<LoggingCommandFactory>>();
|
||||
var factoryMock = new Mock<ICommandFactory>();
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
|
|||
public async void NullCommandTestAll()
|
||||
{
|
||||
NullCommand n = NullCommand.Instance;
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
await n.ExecuteAsync(token);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
|
|||
{
|
||||
var g = new ParallelGroupCommand(commandList.ToArray());
|
||||
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
await g.ExecuteAsync(token);
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
|
|||
{
|
||||
ICommand g = new ParallelGroupCommand(commandList.ToArray());
|
||||
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
await g.UndoAsync(token);
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Planners
|
|||
{
|
||||
// Arrange
|
||||
(TestCommandFactory factory, _, _, HealthRestartPlanner planner) = CreatePlanner();
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var expectedExecutionList = new List<TestRecordType>();
|
||||
|
||||
// Act
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Planners
|
|||
{
|
||||
var factory = new TestCommandFactory();
|
||||
var planner = new RestartPlanner(factory);
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
var addExecutionList = new List<TestRecordType>();
|
||||
Plan addPlan = await planner.PlanAsync(ModuleSet.Empty, ModuleSet.Empty, RuntimeInfo, ImmutableDictionary<string, IModuleIdentity>.Empty);
|
||||
|
@ -47,7 +47,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Planners
|
|||
IImmutableDictionary<string, IModuleIdentity> moduleIdentities = GetModuleIdentities(new List<IModule>() { addModule });
|
||||
|
||||
var planner = new RestartPlanner(factory);
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
ModuleSet addRunning = ModuleSet.Create(addModule);
|
||||
var addExecutionList = new List<TestRecordType>
|
||||
|
@ -73,7 +73,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Planners
|
|||
|
||||
IImmutableDictionary<string, IModuleIdentity> moduleIdentities = GetModuleIdentities(new List<IModule>() { stoppedModule });
|
||||
var planner = new RestartPlanner(factory);
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
var addStoppedExecutionList = new List<TestRecordType>
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Planners
|
|||
|
||||
IImmutableDictionary<string, IModuleIdentity> moduleIdentities = GetModuleIdentities(new List<IModule>() { desiredModule });
|
||||
var planner = new RestartPlanner(factory);
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
ModuleSet currentSet = ModuleSet.Create(currentModule);
|
||||
ModuleSet desiredSet = ModuleSet.Create(desiredModule);
|
||||
|
@ -120,7 +120,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Planners
|
|||
{
|
||||
var factory = new TestCommandFactory();
|
||||
var planner = new RestartPlanner(factory);
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
|
||||
IModule removeModule = new TestModule("mod1", "version1", "test", ModuleStatus.Running, Config1, RestartPolicy.OnUnhealthy, ImagePullPolicy.OnCreate, DefaultConfigurationInfo, EnvVars);
|
||||
ModuleSet removeRunning = ModuleSet.Create(removeModule);
|
||||
|
@ -141,7 +141,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Planners
|
|||
public async void RestartPlannerAddRemoveUpdate()
|
||||
{
|
||||
var factory = new TestCommandFactory();
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
DateTime lastStartTime = DateTime.Parse("2017-08-04T17:52:13.0419502Z", null, DateTimeStyles.RoundtripKind);
|
||||
DateTime lastExitTime = lastStartTime.AddDays(1);
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Test
|
|||
{
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices.Edge.Util.Test.Common;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Core;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Core.Commands;
|
||||
using Microsoft.Azure.Devices.Edge.Util.Test.Common;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Test
|
|||
Assert.Equal(NullCommand.Instance, await kcf.RestartAsync(mockModule));
|
||||
var newCommand = await kcf.WrapAsync(mockCommand);
|
||||
await newCommand.ExecuteAsync(ct);
|
||||
Mock.Get(mockCommand).Verify( c => c.ExecuteAsync(ct), Times.Once);
|
||||
Mock.Get(mockCommand).Verify(c => c.ExecuteAsync(ct), Times.Once);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Test.Commands
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using global::Docker.DotNet.Models;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Core;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Docker;
|
||||
using Microsoft.Azure.Devices.Edge.Util.Test.Common;
|
||||
using Moq;
|
||||
using k8s;
|
||||
using k8s.Models;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Core;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Docker;
|
||||
using Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Commands;
|
||||
using Xunit;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Azure.Devices.Edge.Util.Test.Common;
|
||||
using Moq;
|
||||
using Newtonsoft.Json;
|
||||
using Xunit;
|
||||
using Constants = Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Constants;
|
||||
|
||||
public class KubernetesCrdCommandTest
|
||||
|
@ -62,7 +62,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Test.Commands
|
|||
var configProvider = new Mock<ICombinedConfigProvider<CombinedDockerConfig>>();
|
||||
configProvider.Setup(cp => cp.GetCombinedConfig(km1, Runtime)).Returns(() => null);
|
||||
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
var cmd = new KubernetesCrdCommand<CombinedDockerConfig>(Ns, Hostname, DeviceId, DefaultClient, modules, runtimeOption, DefaultConfigProvider);
|
||||
await Assert.ThrowsAsync<InvalidModuleException>(() => cmd.ExecuteAsync(token));
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Test.Commands
|
|||
IModule m1 = new DockerModule("module1", "v1", ModuleStatus.Running, Core.RestartPolicy.Always, Config1, ImagePullPolicy.OnCreate, DefaultConfigurationInfo, EnvVars);
|
||||
var km1 = new KubernetesModule<DockerConfig>((IModule<DockerConfig>)m1);
|
||||
KubernetesModule<DockerConfig>[] modules = { km1 };
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
Option<IRuntimeInfo> runtimeOption = Option.Maybe(Runtime);
|
||||
var auth = new AuthConfig() { Username = "username", Password = "password", ServerAddress = "docker.io" };
|
||||
var configProvider = new Mock<ICombinedConfigProvider<CombinedDockerConfig>>();
|
||||
|
@ -145,7 +145,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Test.Commands
|
|||
IModule m1 = new DockerModule("module1", "v1", ModuleStatus.Running, Core.RestartPolicy.Always, Config1, ImagePullPolicy.OnCreate, DefaultConfigurationInfo, EnvVars);
|
||||
var km1 = new KubernetesModule<DockerConfig>((IModule<DockerConfig>)m1);
|
||||
KubernetesModule<DockerConfig>[] modules = { km1 };
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
Option<IRuntimeInfo> runtimeOption = Option.Maybe(Runtime);
|
||||
var auth = new AuthConfig() { Username = "username", Password = "password", ServerAddress = "docker.io" };
|
||||
var configProvider = new Mock<ICombinedConfigProvider<CombinedDockerConfig>>();
|
||||
|
@ -217,7 +217,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Test.Commands
|
|||
IModule m2 = new DockerModule("module2", "v1", ModuleStatus.Running, Core.RestartPolicy.Always, Config2, ImagePullPolicy.OnCreate, DefaultConfigurationInfo, EnvVars);
|
||||
var km2 = new KubernetesModule<DockerConfig>((IModule<DockerConfig>)m2);
|
||||
KubernetesModule<DockerConfig>[] modules = { km1, km2 };
|
||||
var token = new CancellationToken();
|
||||
var token = default(CancellationToken);
|
||||
Option<IRuntimeInfo> runtimeOption = Option.Maybe(Runtime);
|
||||
var auth = new AuthConfig() { Username = "username", Password = "password", ServerAddress = "docker.io" };
|
||||
var configProvider = new Mock<ICombinedConfigProvider<CombinedDockerConfig>>();
|
||||
|
|
|
@ -64,7 +64,8 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Kubernetes.Test.Planners
|
|||
|
||||
var planner = new KubernetesPlanner<CombinedDockerConfig>(Ns, Hostname, DeviceId, DefaultClient, DefaultCommandFactory, DefaultConfigProvider);
|
||||
|
||||
await Assert.ThrowsAsync<InvalidIdentityException>( () => planner.PlanAsync(addRunning, ModuleSet.Empty, RuntimeInfo, ImmutableDictionary<string, IModuleIdentity>.Empty));
|
||||
await Assert.ThrowsAsync<InvalidIdentityException>(
|
||||
() => planner.PlanAsync(addRunning, ModuleSet.Empty, RuntimeInfo, ImmutableDictionary<string, IModuleIdentity>.Empty));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Microsoft.Azure.Devices.Edge.Hub.CloudProxy
|
|||
using static System.FormattableString;
|
||||
|
||||
/// <summary>
|
||||
/// This class creates and manages cloud connections (CloudProxy instances)
|
||||
/// This class creates and manages cloud connections (CloudProxy instances).
|
||||
/// </summary>
|
||||
class ClientTokenCloudConnection : CloudConnection, IClientTokenCloudConnection
|
||||
{
|
||||
|
@ -298,29 +298,19 @@ namespace Microsoft.Azure.Devices.Edge.Hub.CloudProxy
|
|||
Log.LogDebug((int)EventIds.ObtainedNewToken, Invariant($"Token received for client {identity.Id} expires in {timeRemaining}, and so is not usable. Getting a fresh token..."));
|
||||
}
|
||||
|
||||
internal static void GetNewToken(string id)
|
||||
{
|
||||
Log.LogDebug((int)EventIds.CreateNewToken, Invariant($"Getting new token for {id}."));
|
||||
}
|
||||
|
||||
internal static void UsingExistingToken(string id)
|
||||
{
|
||||
Log.LogInformation((int)EventIds.CreateNewToken, Invariant($"New token requested by client {id}, but using existing token as it is usable."));
|
||||
}
|
||||
|
||||
internal static void SafeCreateNewToken(string id)
|
||||
{
|
||||
Log.LogInformation((int)EventIds.CreateNewToken, Invariant($"Existing token not found for {id}. Getting new token from the client..."));
|
||||
}
|
||||
|
||||
internal static void CreateException(Exception ex, IIdentity identity)
|
||||
{
|
||||
Log.LogError((int)EventIds.CloudConnectError, ex, Invariant($"Error creating or updating the cloud proxy for client {identity.Id}"));
|
||||
}
|
||||
|
||||
internal static void UpdatedCloudConnection(IIdentity identity)
|
||||
internal static void ErrorRenewingToken(Exception ex)
|
||||
{
|
||||
Log.LogDebug((int)EventIds.UpdatedCloudConnection, Invariant($"Updated cloud connection for client {identity.Id}"));
|
||||
Log.LogDebug((int)EventIds.ErrorRenewingToken, ex, "Critical Error trying to renew Token.");
|
||||
}
|
||||
|
||||
internal static void GetNewToken(string id)
|
||||
{
|
||||
Log.LogDebug((int)EventIds.CreateNewToken, Invariant($"Getting new token for {id}."));
|
||||
}
|
||||
|
||||
internal static void NewTokenObtained(IIdentity identity, string newToken)
|
||||
|
@ -329,9 +319,19 @@ namespace Microsoft.Azure.Devices.Edge.Hub.CloudProxy
|
|||
Log.LogInformation((int)EventIds.ObtainedNewToken, Invariant($"Obtained new token for client {identity.Id} that expires in {timeRemaining}"));
|
||||
}
|
||||
|
||||
internal static void ErrorRenewingToken(Exception ex)
|
||||
internal static void SafeCreateNewToken(string id)
|
||||
{
|
||||
Log.LogDebug((int)EventIds.ErrorRenewingToken, ex, "Critical Error trying to renew Token.");
|
||||
Log.LogInformation((int)EventIds.CreateNewToken, Invariant($"Existing token not found for {id}. Getting new token from the client..."));
|
||||
}
|
||||
|
||||
internal static void UpdatedCloudConnection(IIdentity identity)
|
||||
{
|
||||
Log.LogDebug((int)EventIds.UpdatedCloudConnection, Invariant($"Updated cloud connection for client {identity.Id}"));
|
||||
}
|
||||
|
||||
internal static void UsingExistingToken(string id)
|
||||
{
|
||||
Log.LogInformation((int)EventIds.CreateNewToken, Invariant($"New token requested by client {id}, but using existing token as it is usable."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
namespace Microsoft.Azure.Devices.Routing.Core.Endpoints
|
||||
{
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices.Routing.Core.Checkpointers;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Azure.Devices.Routing.Core.Checkpointers;
|
||||
|
||||
public class StoringAsyncEndpointExecutorFactory : IEndpointExecutorFactory
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Microsoft.Azure.Devices.Routing.Core.Query
|
|||
{
|
||||
public struct Null
|
||||
{
|
||||
public static Null Instance { get; } = new Null();
|
||||
public static Null Instance { get; } = default(Null);
|
||||
|
||||
// Equal
|
||||
public static Bool operator ==(Null x, Null y) => Bool.True;
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Microsoft.Azure.Devices.Routing.Core.Query
|
|||
static readonly Bool UndefinedBool = Bool.Undefined;
|
||||
static readonly double UndefinedDouble = double.NaN;
|
||||
|
||||
public static Undefined Instance { get; } = new Undefined();
|
||||
public static Undefined Instance { get; } = default(Undefined);
|
||||
|
||||
// Equal
|
||||
public static Bool operator ==(Undefined x, Undefined y) => Bool.Undefined;
|
||||
|
|
|
@ -24,13 +24,11 @@ namespace Microsoft.Azure.Devices.Routing.Core.Test.Query
|
|||
[Unit]
|
||||
public void TestEquals()
|
||||
{
|
||||
var d1 = new Null();
|
||||
var d2 = new Null();
|
||||
var d1 = default(Null);
|
||||
var d2 = default(Null);
|
||||
Assert.True(d1 == d2);
|
||||
Assert.False(d1 != d2);
|
||||
|
||||
Assert.Equal(Bool.Undefined, Bool.True == d1);
|
||||
Assert.Equal(Bool.Undefined, Bool.False == d1);
|
||||
Assert.Equal(Bool.Undefined, d1 == Bool.True);
|
||||
Assert.Equal(Bool.Undefined, d1 == Bool.False);
|
||||
}
|
||||
|
@ -39,8 +37,8 @@ namespace Microsoft.Azure.Devices.Routing.Core.Test.Query
|
|||
[Unit]
|
||||
public void TestArthimetic()
|
||||
{
|
||||
var d1 = new Null();
|
||||
var d2 = new Null();
|
||||
var d1 = default(Null);
|
||||
var d2 = default(Null);
|
||||
|
||||
Assert.Equal(12.34, d1 + 12.34);
|
||||
Assert.Equal(12.34, 12.34 + d1);
|
||||
|
@ -64,39 +62,39 @@ namespace Microsoft.Azure.Devices.Routing.Core.Test.Query
|
|||
[Unit]
|
||||
public void TestComparison()
|
||||
{
|
||||
var d1 = new Null();
|
||||
var d2 = new Null();
|
||||
var d1 = default(Null);
|
||||
var d2 = default(Null);
|
||||
|
||||
Assert.Equal(Bool.Undefined, d1 < 12.34);
|
||||
Assert.Equal(Bool.Undefined, 12.34 < d1);
|
||||
Assert.Equal(Bool.Undefined, d1 > 12.34);
|
||||
Assert.Equal(Bool.Undefined, d1 < "string");
|
||||
Assert.Equal(Bool.Undefined, "string" < d1);
|
||||
Assert.Equal(Bool.Undefined, d1 > "string");
|
||||
Assert.Equal(Bool.Undefined, d1 < Bool.True);
|
||||
Assert.Equal(Bool.Undefined, Bool.True < d1);
|
||||
Assert.Equal(Bool.Undefined, d1 > Bool.True);
|
||||
Assert.Equal(Bool.False, d1 < d2);
|
||||
|
||||
Assert.Equal(Bool.Undefined, d1 > 12.34);
|
||||
Assert.Equal(Bool.Undefined, 12.34 > d1);
|
||||
Assert.Equal(Bool.Undefined, d1 < 12.34);
|
||||
Assert.Equal(Bool.Undefined, d1 > "string");
|
||||
Assert.Equal(Bool.Undefined, "string" > d1);
|
||||
Assert.Equal(Bool.Undefined, d1 < "string");
|
||||
Assert.Equal(Bool.Undefined, d1 > Bool.True);
|
||||
Assert.Equal(Bool.Undefined, Bool.True > d1);
|
||||
Assert.Equal(Bool.Undefined, d1 < Bool.True);
|
||||
Assert.Equal(Bool.False, d1 > d2);
|
||||
|
||||
Assert.Equal(Bool.Undefined, d1 <= 12.34);
|
||||
Assert.Equal(Bool.Undefined, 12.34 <= d1);
|
||||
Assert.Equal(Bool.Undefined, d1 >= 12.34);
|
||||
Assert.Equal(Bool.Undefined, d1 <= "string");
|
||||
Assert.Equal(Bool.Undefined, "string" <= d1);
|
||||
Assert.Equal(Bool.Undefined, d1 >= "string");
|
||||
Assert.Equal(Bool.Undefined, d1 <= Bool.True);
|
||||
Assert.Equal(Bool.Undefined, Bool.True <= d1);
|
||||
Assert.Equal(Bool.Undefined, d1 >= Bool.True);
|
||||
Assert.Equal(Bool.True, d1 <= d2);
|
||||
|
||||
Assert.Equal(Bool.Undefined, d1 >= 12.34);
|
||||
Assert.Equal(Bool.Undefined, 12.34 >= d1);
|
||||
Assert.Equal(Bool.Undefined, d1 <= 12.34);
|
||||
Assert.Equal(Bool.Undefined, d1 >= "string");
|
||||
Assert.Equal(Bool.Undefined, "string" >= d1);
|
||||
Assert.Equal(Bool.Undefined, d1 <= "string");
|
||||
Assert.Equal(Bool.Undefined, d1 >= Bool.True);
|
||||
Assert.Equal(Bool.Undefined, Bool.True >= d1);
|
||||
Assert.Equal(Bool.Undefined, d1 <= Bool.True);
|
||||
Assert.Equal(Bool.True, d1 >= d2);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,13 +24,11 @@ namespace Microsoft.Azure.Devices.Routing.Core.Test.Query
|
|||
[Unit]
|
||||
public void TestEquals()
|
||||
{
|
||||
var d1 = new Undefined();
|
||||
var d2 = new Undefined();
|
||||
var d1 = default(Undefined);
|
||||
var d2 = default(Undefined);
|
||||
Assert.Equal(Bool.Undefined, d1 == d2);
|
||||
Assert.Equal(Bool.Undefined, d1 != d2);
|
||||
|
||||
Assert.Equal(Bool.Undefined, Bool.True == d1);
|
||||
Assert.Equal(Bool.Undefined, Bool.False == d1);
|
||||
Assert.Equal(Bool.Undefined, d1 == Bool.True);
|
||||
Assert.Equal(Bool.Undefined, d1 == Bool.False);
|
||||
}
|
||||
|
@ -47,8 +45,8 @@ namespace Microsoft.Azure.Devices.Routing.Core.Test.Query
|
|||
[Unit]
|
||||
public void TestArthimetic()
|
||||
{
|
||||
var d1 = new Undefined();
|
||||
var d2 = new Undefined();
|
||||
var d1 = default(Undefined);
|
||||
var d2 = default(Undefined);
|
||||
|
||||
Assert.Equal(double.NaN, d1 + 12.34);
|
||||
Assert.Equal(double.NaN, 12.34 + d1);
|
||||
|
@ -71,23 +69,23 @@ namespace Microsoft.Azure.Devices.Routing.Core.Test.Query
|
|||
[Unit]
|
||||
public void TestComparison()
|
||||
{
|
||||
var d1 = new Undefined();
|
||||
var d2 = new Undefined();
|
||||
var d1 = default(Undefined);
|
||||
var d2 = default(Undefined);
|
||||
|
||||
Assert.Equal(Bool.Undefined, d1 < 12.34);
|
||||
Assert.Equal(Bool.Undefined, 12.34 < d1);
|
||||
Assert.Equal(Bool.Undefined, d1 > 12.34);
|
||||
Assert.Equal(Bool.Undefined, d1 < d2);
|
||||
|
||||
Assert.Equal(Bool.Undefined, d1 > 12.34);
|
||||
Assert.Equal(Bool.Undefined, 12.34 > d1);
|
||||
Assert.Equal(Bool.Undefined, d1 < 12.34);
|
||||
Assert.Equal(Bool.Undefined, d1 > d2);
|
||||
|
||||
Assert.Equal(Bool.Undefined, d1 <= 12.34);
|
||||
Assert.Equal(Bool.Undefined, 12.34 <= d1);
|
||||
Assert.Equal(Bool.Undefined, d1 >= 12.34);
|
||||
Assert.Equal(Bool.Undefined, d1 <= d2);
|
||||
|
||||
Assert.Equal(Bool.Undefined, d1 >= 12.34);
|
||||
Assert.Equal(Bool.Undefined, 12.34 >= d1);
|
||||
Assert.Equal(Bool.Undefined, d1 <= 12.34);
|
||||
Assert.Equal(Bool.Undefined, d1 >= d2);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ namespace DirectMethodCloudSender
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices;
|
||||
using Microsoft.Azure.Devices.Client;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using IotHubConnectionStringBuilder = Microsoft.Azure.Devices.IotHubConnectionStringBuilder;
|
||||
using Message = Microsoft.Azure.Devices.Client.Message;
|
||||
using TransportType = Microsoft.Azure.Devices.Client.TransportType;
|
||||
|
|
|
@ -7,10 +7,10 @@ namespace DirectMethodReceiver
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices.Client;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
|
||||
class Program
|
||||
{
|
||||
|
|
|
@ -8,10 +8,10 @@ namespace DirectMethodSender
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices.Client;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
|
||||
class Program
|
||||
{
|
||||
|
|
|
@ -8,12 +8,11 @@ namespace SimulatedTemperatureSensor
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices.Client;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Azure.Devices.Edge.Util.Concurrency;
|
||||
using Microsoft.Azure.Devices.Shared;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
class Program
|
||||
|
|
|
@ -8,11 +8,11 @@ namespace TemperatureFilter
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices.Client;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Azure.Devices.Shared;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
class Program
|
||||
|
|
|
@ -6,12 +6,11 @@ namespace LoadGen
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Devices.Client;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using Microsoft.Azure.Devices.Edge.Util;
|
||||
using Microsoft.Azure.Devices.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Azure.Devices.Edge.ModuleUtil;
|
||||
using Newtonsoft.Json;
|
||||
using ILogger = Microsoft.Extensions.Logging.ILogger;
|
||||
|
||||
class Program
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Microsoft.Azure.Devices.Edge.Util.Concurrency
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
if (0 == Interlocked.Exchange(ref this.disposed, 1))
|
||||
if (Interlocked.Exchange(ref this.disposed, 1) == 0)
|
||||
{
|
||||
this.toRelease.semaphore.Release();
|
||||
}
|
||||
|
|
|
@ -11,17 +11,17 @@ namespace Microsoft.Azure.Devices.Edge.Util.Uds
|
|||
{
|
||||
const AddressFamily EndPointAddressFamily = AddressFamily.Unix;
|
||||
|
||||
static readonly Encoding s_pathEncoding = Encoding.UTF8;
|
||||
static readonly Encoding PathEncoding = Encoding.UTF8;
|
||||
|
||||
static readonly int s_nativePathOffset = 2; // = offsetof(struct sockaddr_un, sun_path). It's the same on Linux and OSX
|
||||
static readonly int NativePathOffset = 2; // = offsetof(struct sockaddr_un, sun_path). It's the same on Linux and OSX
|
||||
|
||||
static readonly int s_nativePathLength = 91; // sockaddr_un.sun_path at http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html, -1 for terminator
|
||||
static readonly int NativePathLength = 91; // sockaddr_un.sun_path at http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html, -1 for terminator
|
||||
|
||||
static readonly int s_nativeAddressSize = s_nativePathOffset + s_nativePathLength;
|
||||
static readonly int NativeAddressSize = NativePathOffset + NativePathLength;
|
||||
|
||||
readonly string _path;
|
||||
readonly string path;
|
||||
|
||||
readonly byte[] _encodedPath;
|
||||
readonly byte[] encodedPath;
|
||||
|
||||
public UnixDomainSocketEndPoint(string path)
|
||||
{
|
||||
|
@ -30,10 +30,10 @@ namespace Microsoft.Azure.Devices.Edge.Util.Uds
|
|||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
this._path = path;
|
||||
this._encodedPath = s_pathEncoding.GetBytes(this._path);
|
||||
this.path = path;
|
||||
this.encodedPath = PathEncoding.GetBytes(this.path);
|
||||
|
||||
if (path.Length == 0 || this._encodedPath.Length > s_nativePathLength)
|
||||
if (path.Length == 0 || this.encodedPath.Length > NativePathLength)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(path), path);
|
||||
}
|
||||
|
@ -47,25 +47,25 @@ namespace Microsoft.Azure.Devices.Edge.Util.Uds
|
|||
}
|
||||
|
||||
if (socketAddress.Family != EndPointAddressFamily ||
|
||||
socketAddress.Size > s_nativeAddressSize)
|
||||
socketAddress.Size > NativeAddressSize)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(socketAddress));
|
||||
}
|
||||
|
||||
if (socketAddress.Size > s_nativePathOffset)
|
||||
if (socketAddress.Size > NativePathOffset)
|
||||
{
|
||||
this._encodedPath = new byte[socketAddress.Size - s_nativePathOffset];
|
||||
for (int i = 0; i < this._encodedPath.Length; i++)
|
||||
this.encodedPath = new byte[socketAddress.Size - NativePathOffset];
|
||||
for (int i = 0; i < this.encodedPath.Length; i++)
|
||||
{
|
||||
this._encodedPath[i] = socketAddress[s_nativePathOffset + i];
|
||||
this.encodedPath[i] = socketAddress[NativePathOffset + i];
|
||||
}
|
||||
|
||||
this._path = s_pathEncoding.GetString(this._encodedPath, 0, this._encodedPath.Length);
|
||||
this.path = PathEncoding.GetString(this.encodedPath, 0, this.encodedPath.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._encodedPath = Array.Empty<byte>();
|
||||
this._path = string.Empty;
|
||||
this.encodedPath = Array.Empty<byte>();
|
||||
this.path = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,21 +73,21 @@ namespace Microsoft.Azure.Devices.Edge.Util.Uds
|
|||
|
||||
public override SocketAddress Serialize()
|
||||
{
|
||||
var result = new SocketAddress(AddressFamily.Unix, s_nativeAddressSize);
|
||||
Debug.Assert(this._encodedPath.Length + s_nativePathOffset <= result.Size, "Expected path to fit in address");
|
||||
var result = new SocketAddress(AddressFamily.Unix, NativeAddressSize);
|
||||
Debug.Assert(this.encodedPath.Length + NativePathOffset <= result.Size, "Expected path to fit in address");
|
||||
|
||||
for (int index = 0; index < this._encodedPath.Length; index++)
|
||||
for (int index = 0; index < this.encodedPath.Length; index++)
|
||||
{
|
||||
result[s_nativePathOffset + index] = this._encodedPath[index];
|
||||
result[NativePathOffset + index] = this.encodedPath[index];
|
||||
}
|
||||
|
||||
result[s_nativePathOffset + this._encodedPath.Length] = 0; // path must be null-terminated
|
||||
result[NativePathOffset + this.encodedPath.Length] = 0; // path must be null-terminated
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public override EndPoint Create(SocketAddress socketAddress) => new UnixDomainSocketEndPoint(socketAddress);
|
||||
|
||||
public override string ToString() => this._path;
|
||||
public override string ToString() => this.path;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="Azure IoT Edge StyleCop Ruleset" Description="These StyleCop rules are customized for Azure IoT Edge projects." ToolsVersion="15.0">
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
|
||||
<Rule Id="SA0001" Action="None" />
|
||||
<Rule Id="SA1008" Action="None" />
|
||||
<Rule Id="SA1009" Action="None" />
|
||||
<Rule Id="SA1009" Action="None" />
|
||||
<Rule Id="SA1108" Action="None" />
|
||||
<Rule Id="SA1118" Action="None" />
|
||||
<Rule Id="SA1124" Action="None" />
|
||||
<Rule Id="SA1129" Action="None" />
|
||||
<Rule Id="SA1131" Action="None" />
|
||||
<Rule Id="SA1201" Action="None" />
|
||||
<Rule Id="SA1202" Action="None" />
|
||||
<Rule Id="SA1204" Action="None" />
|
||||
<Rule Id="SA1210" Action="None" />
|
||||
<Rule Id="SA1308" Action="None" />
|
||||
<Rule Id="SA1309" Action="None" />
|
||||
<Rule Id="SA1310" Action="None" />
|
||||
<Rule Id="SA1311" Action="None" />
|
||||
<Rule Id="SA1313" Action="None" />
|
||||
<Rule Id="SA1313" Action="None" />
|
||||
<Rule Id="SA1118" Action="None" />
|
||||
<Rule Id="SA1124" Action="None" />
|
||||
<Rule Id="SA1201" Action="None" />
|
||||
<Rule Id="SA1202" Action="None" />
|
||||
<Rule Id="SA1204" Action="None" />
|
||||
<Rule Id="SA1310" Action="None" />
|
||||
<Rule Id="SA1311" Action="None" />
|
||||
<Rule Id="SA1313" Action="None" />
|
||||
<Rule Id="SA1400" Action="None" />
|
||||
<Rule Id="SA1401" Action="None" />
|
||||
<Rule Id="SA1401" Action="None" />
|
||||
<Rule Id="SA1402" Action="None" />
|
||||
<Rule Id="SA1405" Action="None" />
|
||||
<Rule Id="SA1405" Action="None" />
|
||||
<Rule Id="SA1407" Action="None" />
|
||||
<Rule Id="SA1413" Action="None" />
|
||||
<Rule Id="SA1503" Action="None" />
|
||||
<Rule Id="SA1515" Action="None" />
|
||||
<Rule Id="SA1516" Action="None" />
|
||||
<Rule Id="SA1516" Action="None" />
|
||||
<Rule Id="SA1600" Action="None" />
|
||||
<Rule Id="SA1602" Action="None" />
|
||||
<Rule Id="SA1649" Action="None" />
|
||||
<Rule Id="SA1649" Action="None" />
|
||||
<Rule Id="SA1652" Action="None" />
|
||||
</Rules>
|
||||
</RuleSet>
|
|
@ -2,9 +2,9 @@
|
|||
namespace Microsoft.Azure.Devices.Edge.Test.Common
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче