Skip to content

Commit 4510b50

Browse files
committed
Update with VMware and requirements section
1 parent 7fdc094 commit 4510b50

File tree

4 files changed

+100
-42
lines changed

4 files changed

+100
-42
lines changed

Tests/README.md

+70-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,64 @@
1-
# Running tests
1+
# Running Integration Tests
22

3-
## Run integration tests in Hyper-V (PowerShell Direct)
3+
## VMware ESXi
4+
5+
_To be enhanced. Might be able to use [Invoke-VMScript](https://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/Invoke-VMScript.html)_
6+
_to more resemble the Hyper-V steps._
7+
8+
### Requirements
9+
10+
- This requires a ESXi install on a physical server.
11+
12+
- The virtual machine should have at least 2GB of memory and 25GB of disk.
13+
14+
- The host should also have a disk with enough free
15+
space for a virtual machine plus snapshots (~30GB should
16+
suffice).
17+
18+
- The virtual machine need to have internet connectivity.
19+
20+
### Deploy VMware ESXi virtual machine
21+
22+
1. Downloaded the appropriate installation media, for example from
23+
[Windows Server Evaluations](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019).
24+
1. Configure VM on a VMware ESXi host.
25+
1. Install the server operating system using the downloaded media.
26+
1. Make sure to install the necessary tools to be able to clone and build
27+
the repository. See the article [Getting Started as a Contributor](https://dsccommunity.org/guidelines/getting-started/)
28+
for the necessary tools.
29+
1. Clone the repository to the domain controller using `git`.
30+
1. Snapshot the virtual machine so it possible to revert to this state.
31+
32+
### Running the integration tests
33+
34+
1. Change location to the local repository folder.
35+
1. Build the module using `.\build.ps1 -ResolveDependency -Tasks build`.
36+
1. Build the first domain controller by running the integration test
37+
`Invoke-Pester .\tests\Integration\MSFT_ADDomain.Root.Integration.Tests.ps1`.
38+
The integration test will require a reboot.
39+
1. Run the any additional integration tests by changing the path to the
40+
integration test in the previous test.
41+
42+
## Microsoft Hyper-V (PowerShell Direct)
43+
44+
### Requirements
45+
46+
- This requires a host that can run Hyper-V. For example Windows 10
47+
or Windows Server 2019 on either physical hardware with virtualization
48+
enabled (BIOS setting) or in a VM that supports nested virtualization.
49+
50+
> In Azure (for example) the VM size `Standard E8-4s_v3` supports nested
51+
> virtualization and have 4 vCPUs and 64 GiB memory.
52+
53+
- The host should have enough memory to be able to run at least 4 VMs with
54+
2GB each simultaneous.
55+
- The host should also have a disk with enough free
56+
space to hold the template and 4 VM's plus checkpoints (~150GB should
57+
suffice).
58+
59+
- Internet connectivity is required to create the base VM template (if updates
60+
should be installed), but the lab that runs the integration tests does _not_
61+
need Internet connectivity.
462

563
### Create Hyper-V base image template
664

@@ -18,13 +76,13 @@ The below steps will help to create a base image template that will be
1876
used to create the one or more servers to run tests on.
1977

2078
>**Note:** All these steps are expected to be run in the same elevated
21-
>PowerShell prompt. It also expect that you have downloaded the appropriate
79+
>PowerShell prompt. It also expects that you have downloaded the appropriate
2280
>installation media, for example from [Windows Server Evaluations](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019)
2381
>or the [direct link to the ISO](https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso).
2482
2583
<!-- markdownlint-disable MD031 - Fenced code blocks should be surrounded by blank lines -->
2684
1. Create a Hyper-VM (Generation 2). In an elevated PowerShell prompt run
27-
this.
85+
this:
2886
```powershell
2987
$windowsServerIsoPath = 'C:\_images\17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso'
3088
if (-not (Test-Path -Path $windowsServerIsoPath))
@@ -65,7 +123,7 @@ used to create the one or more servers to run tests on.
65123
```powershell
66124
C:\Windows\System32\SysPrep\sysprep.exe /quiet /generalize /oobe /shutdown
67125
```
68-
1. Create the folder where we store the exported image. _This folder can_
126+
1. Create the folder where we will store the exported image. _This folder can_
69127
_be located anywhere._
70128
```powershell
71129
$templatesPath = 'C:\Hyper-V\Templates'
@@ -132,7 +190,7 @@ memory (~32GB) and disk (~60GB) on the PC that will host the virtual machines.
132190
133191
Get-VM -Name $vmNames | Start-VM -Verbose
134192
```
135-
1. On each started VM finish the installation by configure the following
193+
1. On each started VM finish the installation by configuring the following
136194
in the Hyper-V Virtual Machine Connection.
137195
- Localization
138196
- (Optional) Product key
@@ -143,15 +201,15 @@ memory (~32GB) and disk (~60GB) on the PC that will host the virtual machines.
143201

144202
### Test prerequisites
145203

146-
The host for the virtual machines must have access to Internet. The
204+
The host for the virtual machines must have access the Internet. The
147205
below steps assumes the virtual machines that should run the integration
148-
test are only connect to a private virtual switch and does not have access
206+
test are only connected to a private virtual switch and do not have access
149207
to the Internet.
150208

151-
The blow steps *must* be run in a elevated PowerShell console.
209+
The below steps *must* be run in a elevated PowerShell console.
152210

153211
<!-- markdownlint-disable MD031 - Fenced code blocks should be surrounded by blank lines -->
154-
1. Change to folder to root of your local working repository
212+
1. Change directory to the root of your local working repository
155213
folder, e.g. cd 'c:\source\ActiveDirectoryDsc'.
156214
```powershell
157215
cd c:\source\ActiveDirectoryDsc
@@ -294,10 +352,10 @@ The blow steps *must* be run in a elevated PowerShell console.
294352
By reverting to the checkpoint created before, these tests can be run
295353
several times. The integration tests that depend on an already existing
296354
domain can be run several times without reverting to the checkpoint. The
297-
resources that need a clean environment are the resources that configures
355+
resources that need a clean environment are the resources that configure
298356
the domain, e.g. `ADDomain` and `ADDomainController`.
299357

300-
1. Change to folder to root of your local working repository
358+
1. Change directory to the root of your local working repository
301359
folder, e.g. cd 'c:\source\ActiveDirectoryDsc'.
302360
```powershell
303361
cd 'c:\source\ActiveDirectoryDsc'

Tests/TestHelpers/Prepare-DscLab-dc01.ps1

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
$ConfigurationData = @{
1313
AllNodes = @(
1414
@{
15-
NodeName= '*'
16-
PSDscAllowDomainUser = $true
15+
NodeName = '*'
16+
PSDscAllowDomainUser = $true
1717
PsDscAllowPlainTextPassword = $true
1818
},
1919
@{
@@ -29,12 +29,12 @@ configuration LCMConfig
2929
{
3030
Settings
3131
{
32-
RefreshMode = 'Push'
33-
RebootNodeIfNeeded = $false
34-
ConfigurationMode = 'ApplyOnly'
35-
CertificateId = $node.Thumbprint
32+
RefreshMode = 'Push'
33+
RebootNodeIfNeeded = $false
34+
ConfigurationMode = 'ApplyOnly'
35+
CertificateId = $node.Thumbprint
3636
AllowModuleOverwrite = $true
37-
DebugMode = 'ForceModuleImport'
37+
DebugMode = 'ForceModuleImport'
3838
}
3939
}
4040
}
@@ -53,7 +53,7 @@ Configuration DomainController
5353
{
5454
Computer NewName
5555
{
56-
Name = 'dc01'
56+
Name = 'dc01'
5757
Description = 'First domain controller'
5858
}
5959

@@ -75,7 +75,7 @@ Configuration DomainController
7575
AddressFamily = 'IPv4'
7676
Dhcp = 'Disabled'
7777

78-
DependsOn = '[NetAdapterName]RenameNetAdapter'
78+
DependsOn = '[NetAdapterName]RenameNetAdapter'
7979
}
8080

8181
IPAddress NewIPv4Address
@@ -84,7 +84,7 @@ Configuration DomainController
8484
InterfaceAlias = 'dscadlab.com'
8585
AddressFamily = 'IPV4'
8686

87-
DependsOn = '[NetAdapterName]RenameNetAdapter'
87+
DependsOn = '[NetAdapterName]RenameNetAdapter'
8888
}
8989

9090
DNSServerAddress 'SetFirstDomainControllerDNSIPAddresses'

Tests/TestHelpers/Prepare-DscLab-dc02.ps1

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
$ConfigurationData = @{
1313
AllNodes = @(
1414
@{
15-
NodeName= '*'
16-
PSDscAllowDomainUser = $true
15+
NodeName = '*'
16+
PSDscAllowDomainUser = $true
1717
PsDscAllowPlainTextPassword = $true
1818
},
1919
@{
@@ -29,12 +29,12 @@ configuration LCMConfig
2929
{
3030
Settings
3131
{
32-
RefreshMode = 'Push'
33-
RebootNodeIfNeeded = $false
34-
ConfigurationMode = 'ApplyOnly'
35-
CertificateId = $node.Thumbprint
32+
RefreshMode = 'Push'
33+
RebootNodeIfNeeded = $false
34+
ConfigurationMode = 'ApplyOnly'
35+
CertificateId = $node.Thumbprint
3636
AllowModuleOverwrite = $true
37-
DebugMode = 'ForceModuleImport'
37+
DebugMode = 'ForceModuleImport'
3838
}
3939
}
4040
}
@@ -53,7 +53,7 @@ Configuration DomainController
5353
{
5454
Computer NewName
5555
{
56-
Name = 'dc02'
56+
Name = 'dc02'
5757
Description = 'Second domain controller'
5858
}
5959

@@ -75,7 +75,7 @@ Configuration DomainController
7575
AddressFamily = 'IPv4'
7676
Dhcp = 'Disabled'
7777

78-
DependsOn = '[NetAdapterName]RenameNetAdapter'
78+
DependsOn = '[NetAdapterName]RenameNetAdapter'
7979
}
8080

8181
IPAddress NewIPv4Address
@@ -84,7 +84,7 @@ Configuration DomainController
8484
InterfaceAlias = 'dscadlab.com'
8585
AddressFamily = 'IPV4'
8686

87-
DependsOn = '[NetAdapterName]RenameNetAdapter'
87+
DependsOn = '[NetAdapterName]RenameNetAdapter'
8888
}
8989

9090
DNSServerAddress 'SetFirstDomainControllerDNSIPAddresses'

Tests/TestHelpers/Prepare-DscLab-dc03.ps1

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
$ConfigurationData = @{
1313
AllNodes = @(
1414
@{
15-
NodeName= '*'
16-
PSDscAllowDomainUser = $true
15+
NodeName = '*'
16+
PSDscAllowDomainUser = $true
1717
PsDscAllowPlainTextPassword = $true
1818
},
1919
@{
@@ -29,12 +29,12 @@ configuration LCMConfig
2929
{
3030
Settings
3131
{
32-
RefreshMode = 'Push'
33-
RebootNodeIfNeeded = $false
34-
ConfigurationMode = 'ApplyOnly'
35-
CertificateId = $node.Thumbprint
32+
RefreshMode = 'Push'
33+
RebootNodeIfNeeded = $false
34+
ConfigurationMode = 'ApplyOnly'
35+
CertificateId = $node.Thumbprint
3636
AllowModuleOverwrite = $true
37-
DebugMode = 'ForceModuleImport'
37+
DebugMode = 'ForceModuleImport'
3838
}
3939
}
4040
}
@@ -53,7 +53,7 @@ Configuration DomainController
5353
{
5454
Computer NewName
5555
{
56-
Name = 'dc03'
56+
Name = 'dc03'
5757
Description = 'Third domain controller'
5858
}
5959

@@ -75,7 +75,7 @@ Configuration DomainController
7575
AddressFamily = 'IPv4'
7676
Dhcp = 'Disabled'
7777

78-
DependsOn = '[NetAdapterName]RenameNetAdapter'
78+
DependsOn = '[NetAdapterName]RenameNetAdapter'
7979
}
8080

8181
IPAddress NewIPv4Address
@@ -84,7 +84,7 @@ Configuration DomainController
8484
InterfaceAlias = 'dscadlab.com'
8585
AddressFamily = 'IPV4'
8686

87-
DependsOn = '[NetAdapterName]RenameNetAdapter'
87+
DependsOn = '[NetAdapterName]RenameNetAdapter'
8888
}
8989

9090
DNSServerAddress 'SetFirstDomainControllerDNSIPAddresses'

0 commit comments

Comments
 (0)