Fix mof file (#1457)

This commit is contained in:
Justin Kotalik 2018-10-01 08:00:44 -07:00 committed by GitHub
parent 2fea246b71
commit 3ddc86a428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 4 deletions

View File

@ -5,7 +5,7 @@
/*
* AspNetCore module trace events layout
* Uncomment the following class to run mof2trace to generate header file
* comment it back before checking it in */
* comment it back before checking it in
[Dynamic,
Description("IIS: WWW Server"),
Guid("{3a2a4e84-4c21-4981-ae10-3fda0d9b0f83}"),

View File

@ -14,6 +14,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
PoolEnvironmentVariables = 4,
ShutdownToken = 8,
DynamicCompression = 16,
ApplicationInitialization = 32
ApplicationInitialization = 32,
TracingModule = 64
}
}

View File

@ -0,0 +1,26 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics;
using System.IO;
using Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;
namespace IIS.FunctionalTests
{
public class MofFileTests
{
[ConditionalFact]
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
[RequiresIIS(IISCapability.TracingModule)]
public void CheckMofFile()
{
var path = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "src", "aspnetcoremodulev2", "aspnetcore", "ancm.mof");
var process = Process.Start("mofcomp.exe", path);
process.WaitForExit();
Assert.Equal(0, process.ExitCode);
}
}
}

View File

@ -23,6 +23,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
private static readonly bool _poolEnvironmentVariablesAvailable;
private static readonly bool _dynamicCompressionAvailable;
private static readonly bool _applicationInitializationModule;
private static readonly bool _tracingModuleAvailable;
static RequiresIISAttribute()
{
@ -87,6 +88,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
_applicationInitializationModule = File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "warmup.dll"));
_tracingModuleAvailable = File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "iisetw.dll"));
var iisRegistryKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\InetStp", writable: false);
if (iisRegistryKey == null)
{
@ -157,6 +160,15 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
SkipReason += "The machine does not have IIS ApplicationInitialization installed.";
}
}
if (capabilities.HasFlag(IISCapability.TracingModule))
{
IsMet &= _tracingModuleAvailable;
if (!_tracingModuleAvailable)
{
SkipReason += "The machine does not have IIS TracingModule installed.";
}
}
}
public bool IsMet { get; }

View File

@ -1,14 +1,12 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities;
using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.AspNetCore.Server.IntegrationTesting.IIS;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;
using Xunit.Abstractions;
namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
{