-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
673 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
param | ||
( | ||
[Parameter()] | ||
# Base directory of all output (default to 'output') | ||
[System.String] | ||
$OutputDirectory = (property OutputDirectory (Join-Path $BuildRoot 'output')), | ||
|
||
[Parameter()] | ||
[System.Object[]] | ||
$PesterScript = (property PesterScript 'tests'), | ||
|
||
[Parameter()] | ||
[System.Object[]] | ||
$ReferencePesterScript = (property ReferencePesterScript 'ReferenceFiles'), | ||
|
||
[Parameter()] | ||
[string[]] | ||
$excludeTag = (property excludeTag @()), | ||
|
||
[Parameter()] | ||
[int] | ||
$CurrentJobNumber = (property CurrentJobNumber 1), | ||
|
||
[Parameter()] | ||
[int] | ||
$TotalJobCount = (property TotalJobCount 1), | ||
|
||
# Build Configuration object | ||
[Parameter()] | ||
[System.Collections.Hashtable] | ||
$BuildInfo = (property BuildInfo @{ }) | ||
) | ||
|
||
task TestReferenceRsop -if ((Get-FilteredConfigurationData -Datum $datum -Filter { $_.Name -like 'ReferenceConfiguration*' } -ErrorAction SilentlyContinue).AllNodes) { | ||
|
||
$PesterOutputFolder = Get-SamplerAbsolutePath -Path $PesterOutputFolder -RelativeTo $OutputDirectory | ||
"`tPester Output Folder = '$PesterOutputFolder" | ||
if (-not (Test-Path -Path $PesterOutputFolder)) | ||
{ | ||
Write-Build -Color 'Yellow' -Text "Creating folder $PesterOutputFolder" | ||
|
||
$null = New-Item -Path $PesterOutputFolder -ItemType 'Directory' -Force -ErrorAction 'Stop' | ||
} | ||
|
||
$ReferencePesterScript = $ReferencePesterScript.Foreach({ | ||
Get-SamplerAbsolutePath -Path $_ -RelativeTo $PesterScript[0] | ||
}) | ||
|
||
Write-Build Green "ReferenceRsop Data Pester Scripts = [$($ReferencePesterScript -join ';')]" | ||
|
||
if (-not (Test-Path -Path $ReferencePesterScript)) | ||
{ | ||
Write-Build Yellow "Path for tests '$ReferencePesterScript' does not exist" | ||
return | ||
} | ||
|
||
$testResultsPath = Get-SamplerAbsolutePath -Path ReferenceTestResults.xml -RelativeTo $PesterOutputFolder | ||
|
||
Write-Build DarkGray "TestResultsPath is: $testResultsPath" | ||
Write-Build DarkGray "BuildOutput is: $OutputDirectory" | ||
|
||
Import-Module -Name Pester | ||
$po = New-PesterConfiguration | ||
$po.Run.PassThru = $true | ||
$po.Run.Path = [string[]]$ReferencePesterScript | ||
$po.Output.Verbosity = 'Detailed' | ||
if ($excludeTag) | ||
{ | ||
$po.Filter.ExcludeTag = $excludeTag | ||
} | ||
$po.Filter.Tag = 'ReferenceFiles' | ||
$po.TestResult.Enabled = $true | ||
$po.TestResult.OutputFormat = 'NUnitXml' | ||
$po.TestResult.OutputPath = $testResultsPath | ||
$testResults = Invoke-Pester -Configuration $po | ||
|
||
assert ($testResults.FailedCount -eq 0 -and $testResults.FailedBlocksCount -eq 0 -and $testResults.FailedContainersCount -eq 0) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
NodeName: '[x={ $Node.Name }=]' | ||
Environment: '[x={ $File.Directory.BaseName } =]' | ||
Role: FileServer | ||
Description: '[x= "$($Node.Role) in $($Node.Environment)" =]' | ||
Location: Frankfurt | ||
Baseline: Server | ||
|
||
ComputerSettings: | ||
Name: '[x={ $Node.NodeName }=]' | ||
Description: '[x= "$($Node.Role) in $($Node.Environment)" =]' | ||
|
||
NetworkIpConfiguration: | ||
Interfaces: | ||
- InterfaceAlias: DscWorkshop 0 | ||
IpAddress: 127.0.0.1 | ||
Prefix: 24 | ||
Gateway: 127.0.0.1 | ||
DnsServer: | ||
- 192.168.111.10 | ||
DisableNetbios: true | ||
|
||
PSDscAllowPlainTextPassword: True | ||
PSDscAllowDomainUser: True | ||
|
||
LcmConfig: | ||
ConfigurationRepositoryWeb: | ||
Server: | ||
ConfigurationNames: '[x={ $Node.NodeName }=]' | ||
|
||
DscTagging: | ||
Layers: | ||
- '[x={ Get-DatumSourceFile -Path $File } =]' | ||
|
||
FilesAndFolders: | ||
Items: | ||
- DestinationPath: Z:\DoesNotWork | ||
Type: Directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
NodeName: '[x={ $Node.Name }=]' | ||
Environment: '[x={ $File.Directory.BaseName } =]' | ||
Role: FileServer | ||
Description: '[x= "$($Node.Role) in $($Node.Environment)" =]' | ||
Location: Frankfurt | ||
Baseline: Server | ||
|
||
ComputerSettings: | ||
Name: '[x={ $Node.NodeName }=]' | ||
Description: '[x= "$($Node.Role) in $($Node.Environment)" =]' | ||
|
||
NetworkIpConfiguration: | ||
Interfaces: | ||
- InterfaceAlias: DscWorkshop 0 | ||
IpAddress: 127.0.0.3 | ||
Prefix: 24 | ||
Gateway: 127.0.0.3 | ||
DnsServer: | ||
- 192.168.111.10 | ||
DisableNetbios: true | ||
|
||
PSDscAllowPlainTextPassword: True | ||
PSDscAllowDomainUser: True | ||
|
||
LcmConfig: | ||
ConfigurationRepositoryWeb: | ||
Server: | ||
ConfigurationNames: '[x={ $Node.NodeName }=]' | ||
|
||
DscTagging: | ||
Layers: | ||
- '[x={ Get-DatumSourceFile -Path $File } =]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
NodeName: '[x={ $Node.Name }=]' | ||
Environment: '[x={ $File.Directory.BaseName } =]' | ||
Role: WebServer | ||
Description: '[x= "$($Node.Role) in $($Node.Environment)" =]' | ||
Location: Singapore | ||
Baseline: Server | ||
|
||
ComputerSettings: | ||
Name: '[x={ $Node.NodeName }=]' | ||
Description: '[x= "$($Node.Role) in $($Node.Environment)" =]' | ||
|
||
NetworkIpConfiguration: | ||
Interfaces: | ||
- InterfaceAlias: DscWorkshop 0 | ||
IpAddress: 127.0.0.2 | ||
Prefix: 24 | ||
Gateway: 127.0.0.2 | ||
DnsServer: | ||
- 192.168.111.10 | ||
DisableNetbios: true | ||
|
||
PSDscAllowPlainTextPassword: True | ||
PSDscAllowDomainUser: True | ||
|
||
LcmConfig: | ||
ConfigurationRepositoryWeb: | ||
Server: | ||
ConfigurationNames: '[x={ $Node.NodeName }=]' | ||
|
||
DscTagging: | ||
Layers: | ||
- '[x={ Get-DatumSourceFile -Path $File } =]' |
142 changes: 142 additions & 0 deletions
142
source/TestRsopReferences/ReferenceConfigurationDev.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
WindowsFeatures: | ||
Names: | ||
- File-Services | ||
- -Telnet-Client | ||
Description: 'FileServer in ' | ||
DscDiagnostic: {} | ||
Name: ReferenceConfigurationDev | ||
DscLcmController: | ||
MonitorInterval: 00:15:00 | ||
SendDscTaggingData: true | ||
AutoCorrectInterval: 00:30:00 | ||
MaintenanceWindowMode: AutoCorrect | ||
RefreshIntervalOverride: false | ||
MaintenanceWindowOverride: false | ||
ControllerInterval: 00:05:00 | ||
RefreshInterval: 00:30:00 | ||
MaxLcmRuntime: 00:30:00 | ||
LogHistoryTimeSpan: 7.00:00:00 | ||
WriteTranscripts: true | ||
AutoCorrectIntervalOverride: false | ||
PSDscAllowPlainTextPassword: true | ||
PSDscAllowDomainUser: true | ||
ComputerSettings: | ||
Name: ReferenceConfigurationDev | ||
Description: 'FileServer in ' | ||
TimeZone: Greenwich Standard Time | ||
DomainName: contoso.com | ||
JoinOU: CN=Computers,dc=contoso,dc=com | ||
Credential: install@contoso:********* | ||
DscLcmMaintenanceWindows: | ||
MaintenanceWindows: | ||
Name: Always | ||
StartTime: 00:00:00 | ||
Timespan: 24:00:00 | ||
DependsOn: '[DscLcmController]DscLcmController' | ||
Configurations: | ||
- FilesAndFolders | ||
- RegistryValues | ||
- SecurityBase | ||
- WindowsFeatures | ||
- ComputerSettings | ||
- NetworkIpConfiguration | ||
- WindowsEventLogs | ||
- DscLcmController | ||
- DscLcmMaintenanceWindows | ||
- DscTagging | ||
- DscDiagnostic | ||
SecurityBase: | ||
DependsOn: '[WindowsFeatures]WindowsFeatures' | ||
Role: Baseline | ||
Baseline: Server | ||
NetworkIpConfiguration: | ||
Interfaces: | ||
DnsServer: 192.168.111.10 | ||
Gateway: 127.0.0.1 | ||
DisableNetbios: true | ||
Prefix: 24 | ||
InterfaceAlias: DscWorkshop 0 | ||
IpAddress: 127.0.0.1 | ||
DscTagging: | ||
Environment: Dev | ||
Version: 0.3.0 | ||
Layers: | ||
- AllNodes\Dev\ReferenceConfigurationDev | ||
- Environment\Dev | ||
- Locations\Frankfurt | ||
- Roles\FileServer | ||
- Baselines\Security | ||
- Baselines\Server | ||
- Baselines\DscLcm | ||
FilesAndFolders: | ||
Items: | ||
- DestinationPath: Z:\DoesNotWork | ||
Type: Directory | ||
- DestinationPath: C:\Test\Dev-Environment | ||
Type: Directory | ||
- DestinationPath: C:\Test\Frankfurt | ||
Type: Directory | ||
- DestinationPath: C:\Test | ||
Type: Directory | ||
- Contents: Some test data | ||
Type: File | ||
DependsOn: '[File]file_C__Test' | ||
DestinationPath: C:\Test\Test1File1.txt | ||
- Contents: Some test data | ||
Type: File | ||
DependsOn: '[File]file_C__Test' | ||
DestinationPath: C:\Test\Test1File2.txt | ||
- DestinationPath: C:\GpoBackup | ||
Type: Directory | ||
SourcePath: '\\DSCDC01\SYSVOL\contoso.com\Policies' | ||
NodeName: ReferenceConfigurationDev | ||
Environment: Dev | ||
Location: Frankfurt | ||
RegistryValues: | ||
DependsOn: '[FilesAndFolders]FilesAndFolders' | ||
Values: | ||
- ValueName: DBFlag | ||
ValueType: DWORD | ||
ValueData: 545325055 | ||
Ensure: Present | ||
Force: true | ||
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters | ||
- ValueName: NtpServer | ||
ValueType: String | ||
ValueData: pool.ntp.org,0x9 | ||
Ensure: Present | ||
Force: true | ||
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters | ||
LcmConfig: | ||
ConfigurationRepositoryWeb: | ||
Server: | ||
ConfigurationNames: ReferenceConfigurationDev | ||
RegistrationKey: ec717ee9-b343-49ee-98a2-26e53939eecf | ||
ServerURL: https://dscpull01.contoso.com:8080/PSDSCPullServer.svc | ||
ReportServerWeb: | ||
RegistrationKey: ec717ee9-b343-49ee-98a2-26e53939eecf | ||
ServerURL: https://dscpull01.contoso.com:8080/PSDSCPullServer.svc | ||
Settings: | ||
RefreshFrequencyMins: 30 | ||
AllowModuleOverwrite: true | ||
ActionAfterReboot: ContinueConfiguration | ||
RefreshMode: Pull | ||
RebootNodeIfNeeded: true | ||
ConfigurationMode: ApplyAndMonitor | ||
ConfigurationModeFrequencyMins: 30 | ||
Role: FileServer | ||
WindowsEventLogs: | ||
Logs: | ||
- LogMode: Circular | ||
IsEnabled: true | ||
LogName: System | ||
MaximumSizeInBytes: 20971520 | ||
- LogMode: Circular | ||
IsEnabled: true | ||
LogName: Application | ||
MaximumSizeInBytes: 20971520 | ||
- LogMode: Circular | ||
IsEnabled: true | ||
LogName: Security | ||
MaximumSizeInBytes: 134217728 | ||
DependsOn: '[ComputerSettings]ComputerSettings' |
Oops, something went wrong.