Skip to content

Commit ab91d51

Browse files
committed
Add some Test Cases for IIS IntegrationTests.
Just checks that they don't throw errors, no actual verification yet. Signed-off-by: Bevan Weiss <[email protected]>
1 parent dd587d5 commit ab91d51

File tree

8 files changed

+259
-3
lines changed

8 files changed

+259
-3
lines changed

src/internal/SetBuildNumber/Directory.Packages.props.pp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,21 @@
4040

4141
<PackageVersion Include="WixToolset.Heat" Version="{packageversion}" />
4242

43-
<PackageVersion Include="WixToolset.Bal.wixext" Version="{packageversion}" />
4443
<PackageVersion Include="WixToolset.BootstrapperApplications.wixext" Version="{packageversion}" />
44+
<PackageVersion Include="WixToolset.Bal.wixext" Version="{packageversion}" />
4545
<PackageVersion Include="WixToolset.ComPlus.wixext" Version="{packageversion}" />
4646
<PackageVersion Include="WixToolset.Dependency.wixext" Version="{packageversion}" />
47+
<PackageVersion Include="WixToolset.DirectX.wixext" Version="{packageversion}" />
48+
<PackageVersion Include="WixToolset.Firewall.wixext" Version="{packageversion}" />
49+
<PackageVersion Include="WixToolset.Http.wixext" Version="{packageversion}" />
50+
<PackageVersion Include="WixToolset.Iis.wixext" Version="{packageversion}" />
51+
<PackageVersion Include="WixToolset.Msmq.wixext" Version="{packageversion}" />
4752
<PackageVersion Include="WixToolset.NetFx.wixext" Version="{packageversion}" />
53+
<PackageVersion Include="WixToolset.PowerShell.wixext" Version="{packageversion}" />
54+
<PackageVersion Include="WixToolset.Sql.wixext" Version="{packageversion}" />
4855
<PackageVersion Include="WixToolset.UI.wixext" Version="{packageversion}" />
4956
<PackageVersion Include="WixToolset.Util.wixext" Version="{packageversion}" />
50-
<PackageVersion Include="WixToolset.Firewall.wixext" Version="{packageversion}" />
51-
<PackageVersion Include="WixToolset.Msmq.wixext" Version="{packageversion}" />
57+
<PackageVersion Include="WixToolset.VisualStudio.wixext" Version="{packageversion}" />
5258
</ItemGroup>
5359

5460
<ItemGroup>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2+
<Project Sdk="WixToolset.Sdk">
3+
<PropertyGroup>
4+
<UpgradeCode>{A75B81F4-3335-4B4D-B766-303E136ED374}</UpgradeCode>
5+
<ProductComponentsRef>true</ProductComponentsRef>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" />
9+
</ItemGroup>
10+
<ItemGroup>
11+
<PackageReference Include="WixToolset.Iis.wixext" />
12+
</ItemGroup>
13+
</Project>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3+
xmlns:iis="http://wixtoolset.org/schemas/v4/wxs/iis">
4+
<Fragment>
5+
<Property Id="PORT" Value="3062" />
6+
7+
<Binary Id="MyCertBits" SourceFile="example.txt" />
8+
9+
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
10+
<Component Id="MyCert" Guid="">
11+
<iis:Certificate
12+
Id="Certificate.MyCert"
13+
Name="MyCert certificate"
14+
Request="no"
15+
StoreLocation="localMachine"
16+
StoreName="trustedPublisher"
17+
Overwrite="yes"
18+
BinaryRef="MyCertBits" />
19+
</Component>
20+
21+
<Component>
22+
<File Source="example.txt" />
23+
24+
<iis:WebSite Id="Test" Description="Test web server" Directory="INSTALLFOLDER" AutoStart="yes" DirProperties="ReadAndExecute" ConfigureIfExists="no" >
25+
<iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" />
26+
</iis:WebSite>
27+
</Component>
28+
</ComponentGroup>
29+
30+
<iis:WebDirProperties Id="ReadAndExecute" />
31+
</Fragment>
32+
</Wix>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is example.txt.
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3+
xmlns:iis="http://wixtoolset.org/schemas/v4/wxs/iis">
4+
<Fragment>
5+
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6+
<Component>
7+
<File Source="example.txt" />
8+
9+
<iis:WebSite Id="Test" Description="Test web server" Directory="INSTALLFOLDER" AutoStart="yes" ConfigureIfExists="no" >
10+
<!--<iis:WebDirProperties Id="Test"
11+
AccessSSL="yes"
12+
AccessSSL128="yes"
13+
AccessSSLMapCert="yes"
14+
AccessSSLNegotiateCert="yes"
15+
AccessSSLRequireCert="yes"
16+
17+
AnonymousAccess="yes"
18+
WindowsAuthentication="yes"
19+
AuthenticationProviders="NTLM"
20+
PassportAuthentication="yes"
21+
BasicAuthentication="yes"
22+
DigestAuthentication="yes"
23+
IIsControlledPassword="yes"
24+
25+
ClearCustomError="yes"
26+
AspDetailedError="yes"
27+
LogVisits="yes"
28+
Index="yes"
29+
30+
Execute="yes"
31+
Read="yes"
32+
Script="yes"
33+
Write="yes"
34+
35+
DirBrowseShowDate="no"
36+
DirBrowseShowExtension="no"
37+
DirBrowseShowLongDate="yes"
38+
DirBrowseShowSize="no"
39+
DirBrowseShowTime="no"
40+
EnableDefaultDoc="no"
41+
EnableDirBrowsing="yes"
42+
/> -->
43+
<iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" />
44+
45+
<!-- Test case for AnonymousUser -->
46+
<!-- todo... requires Wix4User, don't want to do today
47+
<iis:WebDir Path="TestAnonymousUser">
48+
<iis:WebDirProperties AnonymousUser="no" />
49+
</iis:WebDir>
50+
-->
51+
<iis:WebDir Id="TestDirAspDetailedError" Path="TestAspDetailedError">
52+
<iis:WebDirProperties Id="TestAspDetailedError" AspDetailedError="yes" />
53+
</iis:WebDir>
54+
<iis:WebDir Id="TestDirAuthenticationProviders" Path="TestAuthenticationProviders">
55+
<iis:WebDirProperties Id="TestAuthenticationProviders" AuthenticationProviders="NTLM" />
56+
</iis:WebDir>
57+
<iis:WebDir Id="TestDirCacheControlCustom" Path="TestCacheControlCustom">
58+
<iis:WebDirProperties Id="TestCacheControlCustom" CacheControlCustom="CacheControl" />
59+
</iis:WebDir>
60+
<iis:WebDir Id="TestDirCacheControlMaxAge" Path="TestCacheControlMaxAge">
61+
<iis:WebDirProperties Id="TestCacheControlMaxAge" CacheControlMaxAge="4294967295" />
62+
</iis:WebDir>
63+
<!-- This will crash out validation of DB (since this value is = MSI_NULL_INTEGER)
64+
<iis:WebDir Id="TestDirCacheControlMaxAgeNull" Path="TestCacheControlMaxAgeNull">
65+
<iis:WebDirProperties Id="TestCacheControlMaxAgeNull" CacheControlMaxAge="2147483648" />
66+
</iis:WebDir>-->
67+
<iis:WebDir Id="TestDirClearCustomError" Path="TestClearCustomError">
68+
<iis:WebDirProperties Id="TestClearCustomError" ClearCustomError="yes" />
69+
</iis:WebDir>
70+
<iis:WebDir Id="TestDirDefaultDocuments" Path="TestDefaultDocuments">
71+
<iis:WebDirProperties Id="TestDefaultDocuments" DefaultDocuments="DefaultDocument.html,index.html,index.htm" />
72+
</iis:WebDir>
73+
<iis:WebDir Id="TestDirHttpExpires" Path="TestHttpExpires">
74+
<iis:WebDirProperties Id="TestHttpExpires" HttpExpires="yes" />
75+
</iis:WebDir>
76+
<iis:WebDir Id="TestDirIIsControlledPassword" Path="TestIIsControlledPassword">
77+
<iis:WebDirProperties Id="TestIIsControlledPassword" IIsControlledPassword="yes" />
78+
</iis:WebDir>
79+
<iis:WebDir Id="TestDirIndex" Path="TestIndex">
80+
<iis:WebDirProperties Id="TestIndex" Index="yes" />
81+
</iis:WebDir>
82+
<iis:WebDir Id="TestDirLogVisits" Path="TestLogVisits">
83+
<iis:WebDirProperties Id="TestLogVisits" LogVisits="yes" />
84+
</iis:WebDir>
85+
86+
<!-- Test cases for Access attributes -->
87+
<iis:WebDir Id="TestDirExecute" Path="TestExecute">
88+
<iis:WebDirProperties Id="TestExecute" Execute="yes" />
89+
</iis:WebDir>
90+
<iis:WebDir Id="TestDirRead" Path="TestRead">
91+
<iis:WebDirProperties Id="TestRead" Read="yes" />
92+
</iis:WebDir>
93+
<iis:WebDir Id="TestDirScript" Path="TestScript">
94+
<iis:WebDirProperties Id="TestScript" Script="yes" />
95+
</iis:WebDir>
96+
<iis:WebDir Id="TestDirWrite" Path="TestWrite">
97+
<iis:WebDirProperties Id="TestWrite" Write="yes" />
98+
</iis:WebDir>
99+
100+
<!-- Test cases for AccessSSL attributes -->
101+
<iis:WebDir Id="TestDirAccessSSL" Path="TestAccessSSL">
102+
<iis:WebDirProperties Id="TestAccessSSL" AccessSSL="yes" />
103+
</iis:WebDir>
104+
<iis:WebDir Id="TestDirAccessSSL128" Path="TestAccessSSL128">
105+
<iis:WebDirProperties Id="TestAccessSSL128" AccessSSL128="yes" />
106+
</iis:WebDir>
107+
<iis:WebDir Id="TestDirAccessSSLMapCert" Path="TestAccessSSLMapCert">
108+
<iis:WebDirProperties Id="TestAccessSSLMapCert" AccessSSLMapCert="yes" />
109+
</iis:WebDir>
110+
<iis:WebDir Id="TestDirAccessSSLNegotiateCert" Path="TestAccessSSLNegotiateCert">
111+
<iis:WebDirProperties Id="TestAccessSSLNegotiateCert" AccessSSLNegotiateCert="yes" />
112+
</iis:WebDir>
113+
<iis:WebDir Id="TestDirAccessSSLRequireCert" Path="TestAccessSSLRequireCert">
114+
<iis:WebDirProperties Id="TestAccessSSLRequireCert" AccessSSLRequireCert="yes" />
115+
</iis:WebDir>
116+
117+
<!-- Test cases for DirBrowseFlags -->
118+
<iis:WebDir Id="TestDirDirBrowseShowDate" Path="TestDirBrowseShowDate">
119+
<iis:WebDirProperties Id="TestDirBrowseShowDate" DirBrowseShowDate="no" />
120+
</iis:WebDir>
121+
<iis:WebDir Id="TestDirDirBrowseShowExtension" Path="TestDirBrowseShowExtension">
122+
<iis:WebDirProperties Id="TestDirBrowseShowExtension" DirBrowseShowExtension="no" />
123+
</iis:WebDir>
124+
<iis:WebDir Id="TestDirDirBrowseShowLongDate" Path="TestDirBrowseShowLongDate">
125+
<iis:WebDirProperties Id="TestDirBrowseShowLongDate" DirBrowseShowLongDate="yes" />
126+
</iis:WebDir>
127+
<iis:WebDir Id="TestDirDirBrowseShowSize" Path="TestDirBrowseShowSize">
128+
<iis:WebDirProperties Id="TestDirBrowseShowSize" DirBrowseShowSize="no" />
129+
</iis:WebDir>
130+
<iis:WebDir Id="TestDirDirBrowseShowTime" Path="TestDirBrowseShowTime">
131+
<iis:WebDirProperties Id="TestDirBrowseShowTime" DirBrowseShowTime="no" />
132+
</iis:WebDir>
133+
<iis:WebDir Id="TestDirEnableDefaultDoc" Path="TestEnableDefaultDoc">
134+
<iis:WebDirProperties Id="TestEnableDefaultDoc" EnableDefaultDoc="no" />
135+
</iis:WebDir>
136+
<iis:WebDir Id="TestDirEnableDirBrowsing" Path="TestEnableDirBrowsing">
137+
<iis:WebDirProperties Id="TestEnableDirBrowsing" EnableDirBrowsing="yes" />
138+
</iis:WebDir>
139+
140+
<!-- Test cases for Authorization attributes -->
141+
<iis:WebDir Id="TestDirAnonymousAccess" Path="TestAnonymousAccess">
142+
<iis:WebDirProperties Id="TestAnonymousAccess" AnonymousAccess="yes" />
143+
</iis:WebDir>
144+
<iis:WebDir Id="TestDirBasicAuthentication" Path="TestBasicAuthentication">
145+
<iis:WebDirProperties Id="TestBasicAuthentication" BasicAuthentication="yes" />
146+
</iis:WebDir>
147+
<iis:WebDir Id="TestDirDigestAuthentication" Path="TestDigestAuthentication">
148+
<iis:WebDirProperties Id="TestDigestAuthentication" DigestAuthentication="yes" />
149+
</iis:WebDir>
150+
<iis:WebDir Id="TestDirPassportAuthentication" Path="TestPassportAuthentication">
151+
<iis:WebDirProperties Id="TestPassportAuthentication" PassportAuthentication="yes" />
152+
</iis:WebDir>
153+
<iis:WebDir Id="TestDirWindowsAuthentication" Path="TestWindowsAuthentication">
154+
<iis:WebDirProperties Id="TestWindowsAuthentication" WindowsAuthentication="yes" />
155+
</iis:WebDir>
156+
</iis:WebSite>
157+
</Component>
158+
</ComponentGroup>
159+
</Fragment>
160+
</Wix>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2+
<Project Sdk="WixToolset.Sdk">
3+
<PropertyGroup>
4+
<UpgradeCode>{A75B81F4-3335-4B4D-B766-303E136ED374}</UpgradeCode>
5+
<ProductComponentsRef>true</ProductComponentsRef>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" />
9+
</ItemGroup>
10+
<ItemGroup>
11+
<PackageReference Include="WixToolset.Iis.wixext" />
12+
</ItemGroup>
13+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is example.txt.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2+
3+
namespace WixToolsetTest.MsiE2E
4+
{
5+
using System;
6+
using WixTestTools;
7+
using Xunit;
8+
using Xunit.Abstractions;
9+
10+
public class IisExtensionTests : MsiE2ETests
11+
{
12+
public IisExtensionTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
13+
14+
[RuntimePrereqFeatureFact("IIS-WebServerRole", "IIS-WebServer")]
15+
public void CanInstallAndUninstallIis()
16+
{
17+
var product = this.CreatePackageInstaller("InstallIis");
18+
product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
19+
product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
20+
}
21+
22+
[RuntimePrereqFeatureFact("IIS-WebServerRole", "IIS-WebServer")]
23+
public void CanInstallAndUninstallWebDirProperties()
24+
{
25+
var product = this.CreatePackageInstaller("WebDirProperties");
26+
product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
27+
product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)