From 8fea010faae971e7702eb1e46bb106256c5981e3 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sat, 9 Sep 2017 18:27:48 +1200 Subject: [PATCH 1/8] Improved RunAllTests.ps1 --- .vscode/RunAllTests.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.vscode/RunAllTests.ps1 b/.vscode/RunAllTests.ps1 index 4fd2d14..e3c8ac2 100644 --- a/.vscode/RunAllTests.ps1 +++ b/.vscode/RunAllTests.ps1 @@ -1,10 +1,11 @@ [string] $repoRoot = Split-Path -Path (Split-Path -Path $Script:MyInvocation.MyCommand.Path) -if ( (-not (Test-Path -Path (Join-Path -Path $repoRoot -ChildPath 'DSCResource.Tests'))) -or ` - (-not (Test-Path -Path (Join-Path -Path $repoRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) +[string] $dscResourceTestsPath = Join-Path -Path $repoRoot -ChildPath 'Modules\iSCSIDsc\DSCResource.Tests' +if ((-not (Test-Path -Path $dscResourceTestsPath)) -or ` + (-not (Test-Path -Path (Join-Path -Path $dscResourceTestsPath -ChildPath 'TestHelper.psm1')))) { & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $repoRoot -ChildPath 'Modules\iSCSIDsc\DSCResource.Tests\')) } Import-Module (Join-Path -Path $repoRoot -ChildPath 'Tests\TestHarness.psm1' -Resolve) -$dscTestsPath = Join-Path -Path $repoRoot -ChildPath 'Modules\iSCSIDsc\DscResource.Tests\Meta.Tests.ps1' +[string] $dscTestsPath = Join-Path -Path $dscResourceTestsPath -ChildPath 'Meta.Tests.ps1' Invoke-TestHarness -DscTestsPath $dscTestsPath From 3b1a5e5cd5eb24e69f6bcf27c62cdbf1b9d5feb8 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Thu, 5 Apr 2018 20:41:49 +1200 Subject: [PATCH 2/8] Enabled PSSA rule violations to fail build --- .MetaTestOptIn.json | 6 +- CHANGELOG.md | 3 + .../DSR_iSCSIInitiator.Integration.Tests.ps1 | 48 ++-- ...SR_iSCSIServerTarget.Integration.Tests.ps1 | 14 +- ...DSR_iSCSIVirtualDisk.Integration.Tests.ps1 | 16 +- Tests/Unit/DSR_iSCSIInitiator.Tests.ps1 | 238 +++++++++--------- Tests/Unit/DSR_iSCSIServerTarget.Tests.ps1 | 70 +++--- Tests/Unit/DSR_iSCSIVirtualDisk.Tests.ps1 | 68 ++--- 8 files changed, 235 insertions(+), 228 deletions(-) diff --git a/.MetaTestOptIn.json b/.MetaTestOptIn.json index 20cf7f9..6f385f8 100644 --- a/.MetaTestOptIn.json +++ b/.MetaTestOptIn.json @@ -2,5 +2,9 @@ "Common Tests - Validate Markdown Files", "Common Tests - Validate Example Files", "Common Tests - Validate Module Files", - "Common Tests - Validate Script Files" + "Common Tests - Validate Script Files", + "Common Tests - Required Script Analyzer Rules", + "Common Tests - Flagged Script Analyzer Rules", + "Common Tests - New Error-Level Script Analyzer Rules", + "Common Tests - Custom Script Analyzer Rules" ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f0e505..760a94b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- Enabled PSSA rule violations to fail build - Fixes [Issue #27](https://github.com/PlagueHO/iSCSIDsc/issues/27). +- Updated tests to meet Pester v4 standard. + ## 1.5.0.0 - Converted resource module to be compliant with HQRM. diff --git a/Tests/Integration/DSR_iSCSIInitiator.Integration.Tests.ps1 b/Tests/Integration/DSR_iSCSIInitiator.Integration.Tests.ps1 index 2628a38..e9a1655 100644 --- a/Tests/Integration/DSR_iSCSIInitiator.Integration.Tests.ps1 +++ b/Tests/Integration/DSR_iSCSIInitiator.Integration.Tests.ps1 @@ -36,7 +36,7 @@ try Describe 'Environment' { Context 'Operating System' { It 'Should be a Server OS' { - $ProductType | Should Be 3 + $ProductType | Should -Be 3 } } } @@ -49,7 +49,7 @@ try Describe 'Environment' { Context 'Windows Features' { It 'Should have the iSCSI Target Feature Installed' { - $Installed | Should Be $true + $Installed | Should -Be $true } } } @@ -85,11 +85,11 @@ try { & "$($script:DSCResourceName)_Config" -OutputPath $TestDrive Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + } | Should -not -throw } It 'should be able to call Get-DscConfiguration without throwing' { - { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw + { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw } #endregion @@ -98,32 +98,32 @@ try $TargetPortalNew = Get-iSCSITargetPortal ` -TargetPortalAddress $TargetPortal.TargetPortalAddress ` -InitiatorPortalAddress $TargetPortal.InitiatorPortalAddress - $Initiator.TargetPortalAddress | Should Be $TargetPortalNew.TargetPortalAddress - $Initiator.TargetPortalPortNumber | Should Be $TargetPortalNew.TargetPortalPortNumber - $Initiator.InitiatorInstanceName | Should Be $TargetPortalNew.InitiatorInstanceName - $Initiator.InitiatorPortalAddress | Should Be $TargetPortalNew.InitiatorPortalAddress - $Initiator.IsDataDigest | Should Be $TargetPortalNew.IsDataDigest - $Initiator.IsHeaderDigest | Should Be $TargetPortalNew.IsHeaderDigest + $Initiator.TargetPortalAddress | Should -Be $TargetPortalNew.TargetPortalAddress + $Initiator.TargetPortalPortNumber | Should -Be $TargetPortalNew.TargetPortalPortNumber + $Initiator.InitiatorInstanceName | Should -Be $TargetPortalNew.InitiatorInstanceName + $Initiator.InitiatorPortalAddress | Should -Be $TargetPortalNew.InitiatorPortalAddress + $Initiator.IsDataDigest | Should -Be $TargetPortalNew.IsDataDigest + $Initiator.IsHeaderDigest | Should -Be $TargetPortalNew.IsHeaderDigest $TargetNew = Get-iSCSITarget ` -NodeAddress $Target.NodeAddress - $Initiator.IsConnected | Should Be $True - $Initiator.NodeAddress | Should Be $TargetNew.NodeAddress + $Initiator.IsConnected | Should -Be $True + $Initiator.NodeAddress | Should -Be $TargetNew.NodeAddress $SessionNew = Get-iSCSISession ` -IscsiTarget $TargetNew - $Initiator.TargetPortalAddress | Should Be $SessionNew.TargetAddress - $Initiator.InitiatorPortalAddress | Should Be $SessionNew.InitiatorAddress - $Initiator.TargetPortalPortNumber | Should Be $SessionNew.TargetPortNumber - $Initiator.ConnectionIdentifier | Should Be $SessionNew.ConnectionIdentifier + $Initiator.TargetPortalAddress | Should -Be $SessionNew.TargetAddress + $Initiator.InitiatorPortalAddress | Should -Be $SessionNew.InitiatorAddress + $Initiator.TargetPortalPortNumber | Should -Be $SessionNew.TargetPortNumber + $Initiator.ConnectionIdentifier | Should -Be $SessionNew.ConnectionIdentifier $ConnectionNew = Get-iSCSIConnection ` -NodeAddress $Target.NodeAddress - $Initiator.AuthenticationType | Should Be $ConnectionNew.AuthenticationType - $Initiator.InitiatorInstanceName | Should Be $ConnectionNew.InitiatorInstanceName - $Initiator.InitiatorPortalAddress | Should Be $ConnectionNew.InitiatorPortalAddress - $Initiator.IsConnected | Should Be $ConnectionNew.IsConnected - $Initiator.IsDataDigest | Should Be $ConnectionNew.IsDataDigest - $Initiator.IsDiscovered | Should Be $ConnectionNew.IsDiscovered - $Initiator.IsHeaderDigest | Should Be $ConnectionNew.IsHeaderDigest - $Initiator.IsPersistent | Should Be $ConnectionNew.IsPersistent + $Initiator.AuthenticationType | Should -Be $ConnectionNew.AuthenticationType + $Initiator.InitiatorInstanceName | Should -Be $ConnectionNew.InitiatorInstanceName + $Initiator.InitiatorPortalAddress | Should -Be $ConnectionNew.InitiatorPortalAddress + $Initiator.IsConnected | Should -Be $ConnectionNew.IsConnected + $Initiator.IsDataDigest | Should -Be $ConnectionNew.IsDataDigest + $Initiator.IsDiscovered | Should -Be $ConnectionNew.IsDiscovered + $Initiator.IsHeaderDigest | Should -Be $ConnectionNew.IsHeaderDigest + $Initiator.IsPersistent | Should -Be $ConnectionNew.IsPersistent $iSNSServerNew = Get-WmiObject -Class MSiSCSIInitiator_iSNSServerClass -Namespace root\wmi # The iSNS Server is not usually accessible so won't be able to be set # $Initiator.iSNSServer | Should Be $iSNSServerNew.iSNSServerAddress diff --git a/Tests/Integration/DSR_iSCSIServerTarget.Integration.Tests.ps1 b/Tests/Integration/DSR_iSCSIServerTarget.Integration.Tests.ps1 index 1e89e03..62fd5ae 100644 --- a/Tests/Integration/DSR_iSCSIServerTarget.Integration.Tests.ps1 +++ b/Tests/Integration/DSR_iSCSIServerTarget.Integration.Tests.ps1 @@ -27,7 +27,7 @@ try Describe 'Environment' { Context 'Operating System' { It 'Should be a Server OS' { - $ProductType | Should Be 3 + $ProductType | Should -Be 3 } } } @@ -40,7 +40,7 @@ try Describe 'Environment' { Context 'Windows Features' { It 'Should have the iSCSI Target Feature Installed' { - $Installed | Should Be $true + $Installed | Should -Be $true } } } @@ -65,20 +65,20 @@ try { & "$($script:DSCResourceName)_Config" -OutputPath $TestDrive Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + } | Should -not -throw } It 'should be able to call Get-DscConfiguration without throwing' { - { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw + { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw } #endregion It 'Should have set the resource and all the parameters should match' { # Get the Rule details $ServerTargetNew = Get-iSCSIServerTarget -TargetName $ServerTarget.TargetName - $ServerTargetNew.TargetName | Should Be $ServerTarget.TargetName - $ServerTargetNew.InitiatorIds | Should Be $ServerTarget.InitiatorIds - $ServerTargetNew.LunMappings.Path | Should Be $ServerTarget.Paths + $ServerTargetNew.TargetName | Should -Be $ServerTarget.TargetName + $ServerTargetNew.InitiatorIds | Should -Be $ServerTarget.InitiatorIds + $ServerTargetNew.LunMappings.Path | Should -Be $ServerTarget.Paths $iSNSServerNew = Get-WmiObject -Class WT_iSNSServer -Namespace root\wmi # The iSNS Server is not usually accessible so won't be able to be set # $iSNSServerNew.ServerName | Should Be $ServerTarget.iSNSServer diff --git a/Tests/Integration/DSR_iSCSIVirtualDisk.Integration.Tests.ps1 b/Tests/Integration/DSR_iSCSIVirtualDisk.Integration.Tests.ps1 index ddc032e..de10a1e 100644 --- a/Tests/Integration/DSR_iSCSIVirtualDisk.Integration.Tests.ps1 +++ b/Tests/Integration/DSR_iSCSIVirtualDisk.Integration.Tests.ps1 @@ -27,7 +27,7 @@ try Describe 'Environment' { Context 'Operating System' { It 'Should be a Server OS' { - $ProductType | Should Be 3 + $ProductType | Should -Be 3 } } } @@ -40,7 +40,7 @@ try Describe 'Environment' { Context 'Windows Features' { It 'Should have the iSCSI Target Feature Installed' { - $Installed | Should Be $true + $Installed | Should -Be $true } } } @@ -59,21 +59,21 @@ try { & "$($script:DSCResourceName)_Config" -OutputPath $TestDrive Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + } | Should -not -throw } It 'should be able to call Get-DscConfiguration without throwing' { - { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw + { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw } #endregion It 'Should have set the resource and all the parameters should match' { # Get the Rule details $virtualDiskNew = Get-iSCSIVirtualDisk -Path $VirtualDisk.Path - $VirtualDisk.Path | Should Be $virtualDiskNew.Path - $VirtualDisk.DiskType | Should Be $virtualDiskNew.DiskType - $VirtualDisk.Size | Should Be $virtualDiskNew.Size - $VirtualDisk.Description | Should Be $virtualDiskNew.Description + $VirtualDisk.Path | Should -Be $virtualDiskNew.Path + $VirtualDisk.DiskType | Should -Be $virtualDiskNew.DiskType + $VirtualDisk.Size | Should -Be $virtualDiskNew.Size + $VirtualDisk.Description | Should -Be $virtualDiskNew.Description } AfterAll { diff --git a/Tests/Unit/DSR_iSCSIInitiator.Tests.ps1 b/Tests/Unit/DSR_iSCSIInitiator.Tests.ps1 index ea0fceb..d29c242 100644 --- a/Tests/Unit/DSR_iSCSIInitiator.Tests.ps1 +++ b/Tests/Unit/DSR_iSCSIInitiator.Tests.ps1 @@ -194,7 +194,7 @@ try -NodeAddress $TestInitiator.NodeAddress ` -TargetPortalAddress $TestInitiator.TargetPortalAddress ` -InitiatorPortalAddress $TestInitiator.InitiatorPortalAddress - $Result.Ensure | Should Be 'Absent' + $Result.Ensure | Should -Be 'Absent' } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -216,13 +216,13 @@ try -NodeAddress $TestInitiator.NodeAddress ` -TargetPortalAddress $TestInitiator.TargetPortalAddress ` -InitiatorPortalAddress $TestInitiator.InitiatorPortalAddress - $Result.Ensure | Should Be 'Absent' - $Result.TargetPortalAddress | Should Be $TestInitiator.TargetPortalAddress - $Result.InitiatorPortalAddress | Should Be $TestInitiator.InitiatorPortalAddress - $Result.TargetPortalPortNumber | Should Be $TestInitiator.TargetPortalPortNumber - $Result.InitiatorInstanceName | Should Be $TestInitiator.InitiatorInstanceName - $Result.IsDataDigest | Should Be $TestInitiator.IsDataDigest - $Result.IsHeaderDigest | Should Be $TestInitiator.IsHeaderDigest + $Result.Ensure | Should -Be 'Absent' + $Result.TargetPortalAddress | Should -Be $TestInitiator.TargetPortalAddress + $Result.InitiatorPortalAddress | Should -Be $TestInitiator.InitiatorPortalAddress + $Result.TargetPortalPortNumber | Should -Be $TestInitiator.TargetPortalPortNumber + $Result.InitiatorInstanceName | Should -Be $TestInitiator.InitiatorInstanceName + $Result.IsDataDigest | Should -Be $TestInitiator.IsDataDigest + $Result.IsHeaderDigest | Should -Be $TestInitiator.IsHeaderDigest } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -244,13 +244,13 @@ try -NodeAddress $TestInitiator.NodeAddress ` -TargetPortalAddress $TestInitiator.TargetPortalAddress ` -InitiatorPortalAddress $TestInitiator.InitiatorPortalAddress - $Result.Ensure | Should Be 'Absent' - $Result.TargetPortalAddress | Should Be $TestInitiator.TargetPortalAddress - $Result.InitiatorPortalAddress | Should Be $TestInitiator.InitiatorPortalAddress - $Result.TargetPortalPortNumber | Should Be $TestInitiator.TargetPortalPortNumber - $Result.InitiatorInstanceName | Should Be $TestInitiator.InitiatorInstanceName - $Result.IsDataDigest | Should Be $TestInitiator.IsDataDigest - $Result.IsHeaderDigest | Should Be $TestInitiator.IsHeaderDigest + $Result.Ensure | Should -Be 'Absent' + $Result.TargetPortalAddress | Should -Be $TestInitiator.TargetPortalAddress + $Result.InitiatorPortalAddress | Should -Be $TestInitiator.InitiatorPortalAddress + $Result.TargetPortalPortNumber | Should -Be $TestInitiator.TargetPortalPortNumber + $Result.InitiatorInstanceName | Should -Be $TestInitiator.InitiatorInstanceName + $Result.IsDataDigest | Should -Be $TestInitiator.IsDataDigest + $Result.IsHeaderDigest | Should -Be $TestInitiator.IsHeaderDigest } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -271,13 +271,13 @@ try $Result = Get-TargetResource ` -NodeAddress $TestInitiatorWithoutInitiatorAddress.NodeAddress ` -TargetPortalAddress $TestInitiatorWithoutInitiatorAddress.TargetPortalAddress - $Result.Ensure | Should Be 'Absent' - $Result.TargetPortalAddress | Should Be $TestInitiatorWithoutInitiatorAddress.TargetPortalAddress - $Result.InitiatorPortalAddress | Should BeNullOrEmpty - $Result.TargetPortalPortNumber | Should Be $TestInitiatorWithoutInitiatorAddress.TargetPortalPortNumber - $Result.InitiatorInstanceName | Should Be $TestInitiatorWithoutInitiatorAddress.InitiatorInstanceName - $Result.IsDataDigest | Should Be $TestInitiatorWithoutInitiatorAddress.IsDataDigest - $Result.IsHeaderDigest | Should Be $TestInitiatorWithoutInitiatorAddress.IsHeaderDigest + $Result.Ensure | Should -Be 'Absent' + $Result.TargetPortalAddress | Should -Be $TestInitiatorWithoutInitiatorAddress.TargetPortalAddress + $Result.InitiatorPortalAddress | Should -BeNullOrEmpty + $Result.TargetPortalPortNumber | Should -Be $TestInitiatorWithoutInitiatorAddress.TargetPortalPortNumber + $Result.InitiatorInstanceName | Should -Be $TestInitiatorWithoutInitiatorAddress.InitiatorInstanceName + $Result.IsDataDigest | Should -Be $TestInitiatorWithoutInitiatorAddress.IsDataDigest + $Result.IsHeaderDigest | Should -Be $TestInitiatorWithoutInitiatorAddress.IsHeaderDigest } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -299,20 +299,20 @@ try -NodeAddress $TestInitiator.NodeAddress ` -TargetPortalAddress $TestInitiator.TargetPortalAddress ` -InitiatorPortalAddress $TestInitiator.InitiatorPortalAddress - $Result.Ensure | Should Be 'Present' - $Result.TargetPortalAddress | Should Be $TestInitiator.TargetPortalAddress - $Result.InitiatorPortalAddress | Should Be $TestInitiator.InitiatorPortalAddress - $Result.TargetPortalPortNumber | Should Be $TestInitiator.TargetPortalPortNumber - $Result.InitiatorInstanceName | Should Be $TestInitiator.InitiatorInstanceName - $Result.IsDataDigest | Should Be $TestInitiator.IsDataDigest - $Result.IsHeaderDigest | Should Be $TestInitiator.IsHeaderDigest - $Result.AuthenticationType | Should Be $TestInitiator.AuthenticationType - $Result.InitiatorInstanceName | Should Be $TestInitiator.InitiatorInstanceName - $Result.ConnectionIdentifier | Should Be $MockConnection.ConnectionIdentifier - $Result.SessionIdentifier | Should Be $MockSession.SessionIdentifier - $Result.IsConnected | Should Be $MockSession.IsConnected - $Result.IsDiscovered | Should Be $MockSession.IsDiscovered - $Result.IsPersistent | Should Be $MockSession.IsPersistent + $Result.Ensure | Should -Be 'Present' + $Result.TargetPortalAddress | Should -Be $TestInitiator.TargetPortalAddress + $Result.InitiatorPortalAddress | Should -Be $TestInitiator.InitiatorPortalAddress + $Result.TargetPortalPortNumber | Should -Be $TestInitiator.TargetPortalPortNumber + $Result.InitiatorInstanceName | Should -Be $TestInitiator.InitiatorInstanceName + $Result.IsDataDigest | Should -Be $TestInitiator.IsDataDigest + $Result.IsHeaderDigest | Should -Be $TestInitiator.IsHeaderDigest + $Result.AuthenticationType | Should -Be $TestInitiator.AuthenticationType + $Result.InitiatorInstanceName | Should -Be $TestInitiator.InitiatorInstanceName + $Result.ConnectionIdentifier | Should -Be $MockConnection.ConnectionIdentifier + $Result.SessionIdentifier | Should -Be $MockSession.SessionIdentifier + $Result.IsConnected | Should -Be $MockSession.IsConnected + $Result.IsDiscovered | Should -Be $MockSession.IsDiscovered + $Result.IsPersistent | Should -Be $MockSession.IsPersistent } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -333,20 +333,20 @@ try $Result = Get-TargetResource ` -NodeAddress $TestInitiatorWithoutInitiatorAddress.NodeAddress ` -TargetPortalAddress $TestInitiatorWithoutInitiatorAddress.TargetPortalAddress - $Result.Ensure | Should Be 'Present' - $Result.TargetPortalAddress | Should Be $TestInitiatorWithoutInitiatorAddress.TargetPortalAddress - $Result.InitiatorPortalAddress | Should Be $MockConnection.InitiatorAddress - $Result.TargetPortalPortNumber | Should Be $TestInitiatorWithoutInitiatorAddress.TargetPortalPortNumber - $Result.InitiatorInstanceName | Should Be $TestInitiatorWithoutInitiatorAddress.InitiatorInstanceName - $Result.IsDataDigest | Should Be $TestInitiatorWithoutInitiatorAddress.IsDataDigest - $Result.IsHeaderDigest | Should Be $TestInitiatorWithoutInitiatorAddress.IsHeaderDigest - $Result.AuthenticationType | Should Be $TestInitiatorWithoutInitiatorAddress.AuthenticationType - $Result.InitiatorInstanceName | Should Be $TestInitiatorWithoutInitiatorAddress.InitiatorInstanceName - $Result.ConnectionIdentifier | Should Be $MockConnection.ConnectionIdentifier - $Result.SessionIdentifier | Should Be $MockSession.SessionIdentifier - $Result.IsConnected | Should Be $MockSession.IsConnected - $Result.IsDiscovered | Should Be $MockSession.IsDiscovered - $Result.IsPersistent | Should Be $MockSession.IsPersistent + $Result.Ensure | Should -Be 'Present' + $Result.TargetPortalAddress | Should -Be $TestInitiatorWithoutInitiatorAddress.TargetPortalAddress + $Result.InitiatorPortalAddress | Should -Be $MockConnection.InitiatorAddress + $Result.TargetPortalPortNumber | Should -Be $TestInitiatorWithoutInitiatorAddress.TargetPortalPortNumber + $Result.InitiatorInstanceName | Should -Be $TestInitiatorWithoutInitiatorAddress.InitiatorInstanceName + $Result.IsDataDigest | Should -Be $TestInitiatorWithoutInitiatorAddress.IsDataDigest + $Result.IsHeaderDigest | Should -Be $TestInitiatorWithoutInitiatorAddress.IsHeaderDigest + $Result.AuthenticationType | Should -Be $TestInitiatorWithoutInitiatorAddress.AuthenticationType + $Result.InitiatorInstanceName | Should -Be $TestInitiatorWithoutInitiatorAddress.InitiatorInstanceName + $Result.ConnectionIdentifier | Should -Be $MockConnection.ConnectionIdentifier + $Result.SessionIdentifier | Should -Be $MockSession.SessionIdentifier + $Result.IsConnected | Should -Be $MockSession.IsConnected + $Result.IsDiscovered | Should -Be $MockSession.IsDiscovered + $Result.IsPersistent | Should -Be $MockSession.IsPersistent } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -368,21 +368,21 @@ try -NodeAddress $TestInitiator.NodeAddress ` -TargetPortalAddress $TestInitiator.TargetPortalAddress ` -InitiatorPortalAddress $TestInitiator.InitiatorPortalAddress - $Result.Ensure | Should Be 'Present' - $Result.TargetPortalAddress | Should Be $TestInitiator.TargetPortalAddress - $Result.InitiatorPortalAddress | Should Be $TestInitiator.InitiatorPortalAddress - $Result.TargetPortalPortNumber | Should Be $TestInitiator.TargetPortalPortNumber - $Result.InitiatorInstanceName | Should Be $TestInitiator.InitiatorInstanceName - $Result.IsDataDigest | Should Be $TestInitiator.IsDataDigest - $Result.IsHeaderDigest | Should Be $TestInitiator.IsHeaderDigest - $Result.AuthenticationType | Should Be $TestInitiator.AuthenticationType - $Result.InitiatorInstanceName | Should Be $TestInitiator.InitiatorInstanceName - $Result.ConnectionIdentifier | Should Be $MockConnection.ConnectionIdentifier - $Result.SessionIdentifier | Should Be $MockSession.SessionIdentifier - $Result.IsConnected | Should Be $MockSession.IsConnected - $Result.IsDiscovered | Should Be $MockSession.IsDiscovered - $Result.IsPersistent | Should Be $MockSession.IsPersistent - $Result.iSNSServer | Should Be $MockiSNSSrver.iSNSServerAddress + $Result.Ensure | Should -Be 'Present' + $Result.TargetPortalAddress | Should -Be $TestInitiator.TargetPortalAddress + $Result.InitiatorPortalAddress | Should -Be $TestInitiator.InitiatorPortalAddress + $Result.TargetPortalPortNumber | Should -Be $TestInitiator.TargetPortalPortNumber + $Result.InitiatorInstanceName | Should -Be $TestInitiator.InitiatorInstanceName + $Result.IsDataDigest | Should -Be $TestInitiator.IsDataDigest + $Result.IsHeaderDigest | Should -Be $TestInitiator.IsHeaderDigest + $Result.AuthenticationType | Should -Be $TestInitiator.AuthenticationType + $Result.InitiatorInstanceName | Should -Be $TestInitiator.InitiatorInstanceName + $Result.ConnectionIdentifier | Should -Be $MockConnection.ConnectionIdentifier + $Result.SessionIdentifier | Should -Be $MockSession.SessionIdentifier + $Result.IsConnected | Should -Be $MockSession.IsConnected + $Result.IsDiscovered | Should -Be $MockSession.IsDiscovered + $Result.IsPersistent | Should -Be $MockSession.IsPersistent + $Result.iSNSServer | Should -Be $MockiSNSSrver.iSNSServerAddress } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -413,7 +413,7 @@ try { $Splat = $TestInitiator.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -450,7 +450,7 @@ try { $Splat = $TestInitiatorWithoutInitiatorAddress.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -487,7 +487,7 @@ try { $Splat = $TestInitiator.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -524,7 +524,7 @@ try { $Splat = $TestInitiatorWithoutInitiatorAddress.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -563,7 +563,7 @@ try $Splat = $TestInitiator.Clone() $Splat.TargetPortalPortNumber = $Splat.TargetPortalPortNumber + 1 Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -588,7 +588,7 @@ try $Splat = $TestInitiator.Clone() $Splat.InitiatorInstanceName = "Different" Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -613,7 +613,7 @@ try $Splat = $TestInitiator.Clone() $Splat.IsDataDigest = ! $Splat.IsDataDigest Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -638,7 +638,7 @@ try $Splat = $TestInitiator.Clone() $Splat.IsHeaderDigest = ! $Splat.IsHeaderDigest Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -675,7 +675,7 @@ try { $Splat = $TestInitiator.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -715,7 +715,7 @@ try { $Splat = $TestInitiatorWithHostname.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -756,7 +756,7 @@ try { $Splat = $TestInitiatorWithHostname.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -795,7 +795,7 @@ try $Splat = $TestInitiator.Clone() $Splat.AuthenticationType = 'None' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -832,7 +832,7 @@ try { $Splat = $TestInitiator.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -870,7 +870,7 @@ try $Splat = $TestInitiator.Clone() $Splat.IsPersistent = $False Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -908,7 +908,7 @@ try $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -946,7 +946,7 @@ try $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -984,7 +984,7 @@ try $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1022,7 +1022,7 @@ try $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1060,7 +1060,7 @@ try $Splat = $TestInitiatorWithiSNS.Clone() $Splat.iSNSServer = 'different.contoso.com' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1097,7 +1097,7 @@ try { $Splat = $TestInitiatorWithiSNS.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1135,7 +1135,7 @@ try $Splat = $TestInitiatorWithiSNS.Clone() $Splat.iSNSServer = '' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1173,7 +1173,7 @@ try $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1202,7 +1202,7 @@ try Mock Get-WMIObject It 'should return false' { $Splat = $TestInitiator.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1221,7 +1221,7 @@ try Mock Get-WMIObject It 'should return false' { $Splat = $TestInitiatorWithoutInitiatorAddress.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1240,7 +1240,7 @@ try Mock Get-WMIObject It 'should return false' { $Splat = $TestInitiator.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1259,7 +1259,7 @@ try Mock Get-WMIObject It 'should return false' { $Splat = $TestInitiator.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1278,7 +1278,7 @@ try Mock Get-WMIObject It 'should return false' { $Splat = $TestInitiatorWithoutInitiatorAddress.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1299,7 +1299,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.TargetPortalPortNumber = $Splat.TargetPortalPortNumber + 1 - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1314,7 +1314,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.InitiatorInstanceName = "Different" - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1329,7 +1329,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.IsDataDigest = ! $Splat.IsDataDigest - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1344,7 +1344,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.IsHeaderDigest = ! $Splat.IsHeaderDigest - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1366,7 +1366,7 @@ try } It 'should return true' { $Splat = $TestInitiatorWithHostname.Clone() - Test-TargetResource @Splat | Should Be $True + Test-TargetResource @Splat | Should -Be $True } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1389,7 +1389,7 @@ try } It 'should return false' { $Splat = $TestInitiatorWithHostname.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1410,7 +1410,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.AuthenticationType = 'None' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1429,7 +1429,7 @@ try Mock Get-WMIObject It 'should return true' { $Splat = $TestInitiator.Clone() - Test-TargetResource @Splat | Should Be $True + Test-TargetResource @Splat | Should -Be $True } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1449,7 +1449,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.IsPersistent = $False - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1469,7 +1469,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1489,7 +1489,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1509,7 +1509,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1529,7 +1529,7 @@ try It 'should return true' { $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $True + Test-TargetResource @Splat | Should -Be $True } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1548,7 +1548,7 @@ try Mock Get-WMIObject It 'should return false' { $Splat = $TestInitiatorWithiSNS.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1568,7 +1568,7 @@ try It 'should return false' { $Splat = $TestInitiatorWithiSNS.Clone() $Splat.iSNSServer = 'different.contoso.com' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1588,7 +1588,7 @@ try It 'should return false' { $Splat = $TestInitiatorWithiSNS.Clone() $Splat.iSNSServer = '' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1608,7 +1608,7 @@ try It 'should return false' { $Splat = $TestInitiator.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-TargetPortal -Exactly 1 @@ -1628,7 +1628,7 @@ try $Result = Get-TargetPortal ` -TargetPortalAddress $Splat.TargetPortalAddress ` -InitiatorPortalAddress $Splat.InitiatorPortalAddress - $Result | Should Be $null + $Result | Should -Be $null } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSITargetPortal -Exactly 1 @@ -1642,12 +1642,12 @@ try $Result = Get-TargetPortal ` -TargetPortalAddress $Splat.TargetPortalAddress ` -InitiatorPortalAddress $Splat.InitiatorPortalAddress - $Result.TargetPortalAddress | Should Be $MockTargetPortal.TargetPortalAddress - $Result.TargetPortalPortNumber | Should Be $MockTargetPortal.TargetPortalPortNumber - $Result.InitiatorInstanceName | Should Be $MockTargetPortal.InitiatorInstanceName - $Result.InitiatorPortalAddress | Should Be $MockTargetPortal.InitiatorPortalAddress - $Result.IsDataDigest | Should Be $MockTargetPortal.IsDataDigest - $Result.IsHeaderDigest | Should Be $MockTargetPortal.IsHeaderDigest + $Result.TargetPortalAddress | Should -Be $MockTargetPortal.TargetPortalAddress + $Result.TargetPortalPortNumber | Should -Be $MockTargetPortal.TargetPortalPortNumber + $Result.InitiatorInstanceName | Should -Be $MockTargetPortal.InitiatorInstanceName + $Result.InitiatorPortalAddress | Should -Be $MockTargetPortal.InitiatorPortalAddress + $Result.IsDataDigest | Should -Be $MockTargetPortal.IsDataDigest + $Result.IsHeaderDigest | Should -Be $MockTargetPortal.IsHeaderDigest } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSITargetPortal -Exactly 1 @@ -1662,7 +1662,7 @@ try $Splat = $TestInitiator.Clone() $Result = Get-Target ` -NodeAddress $Splat.NodeAddress - $Result | Should Be $null + $Result | Should -Be $null } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSITarget -Exactly 1 @@ -1675,8 +1675,8 @@ try $Splat = $TestInitiator.Clone() $Result = Get-Target ` -NodeAddress $Splat.NodeAddress - $Result.NodeAddress | Should Be $MockTarget.NodeAddress - $Result.IsConnected | Should Be $MockTarget.IsConnected + $Result.NodeAddress | Should -Be $MockTarget.NodeAddress + $Result.IsConnected | Should -Be $MockTarget.IsConnected } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSITarget -Exactly 1 diff --git a/Tests/Unit/DSR_iSCSIServerTarget.Tests.ps1 b/Tests/Unit/DSR_iSCSIServerTarget.Tests.ps1 index a361c34..434e779 100644 --- a/Tests/Unit/DSR_iSCSIServerTarget.Tests.ps1 +++ b/Tests/Unit/DSR_iSCSIServerTarget.Tests.ps1 @@ -70,7 +70,7 @@ try Describe 'Environment' { Context 'Operating System' { It 'Should be a Server OS' { - $ProductType | Should Be 3 + $ProductType | Should -Be 3 } } } @@ -83,7 +83,7 @@ try Describe 'Environment' { Context 'Windows Features' { It 'Should have the iSCSI Target Feature Installed' { - $Installed | Should Be $true + $Installed | Should -Be $true } } } @@ -104,8 +104,8 @@ try -TargetName $TestServerTarget.TargetName ` -InitiatorIds $TestServerTarget.InitiatorIds ` -Paths $TestServerTarget.Paths - $Result.Ensure | Should Be 'Absent' - $Result.iSNSServer | Should BeNullOrEmpty + $Result.Ensure | Should -Be 'Absent' + $Result.iSNSServer | Should -BeNullOrEmpty } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -123,10 +123,10 @@ try -TargetName $TestServerTarget.TargetName ` -InitiatorIds $TestServerTarget.InitiatorIds ` -Paths $TestServerTarget.Paths - $Result.Ensure | Should Be 'Present' - $Result.InitiatorIds | Should Be $TestServerTarget.InitiatorIds - $Result.Paths | Should Be $TestServerTarget.Paths - $Result.iSNSServer | Should BeNullOrEmpty + $Result.Ensure | Should -Be 'Present' + $Result.InitiatorIds | Should -Be $TestServerTarget.InitiatorIds + $Result.Paths | Should -Be $TestServerTarget.Paths + $Result.iSNSServer | Should -BeNullOrEmpty } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -144,10 +144,10 @@ try -TargetName $TestServerTargetWithiSNS.TargetName ` -InitiatorIds $TestServerTargetWithiSNS.InitiatorIds ` -Paths $TestServerTargetWithiSNS.Paths - $Result.Ensure | Should Be 'Present' - $Result.InitiatorIds | Should Be $TestServerTargetWithiSNS.InitiatorIds - $Result.Paths | Should Be $TestServerTargetWithiSNS.Paths - $Result.iSNSServer | Should Be $TestServerTargetWithiSNS.iSNSServer + $Result.Ensure | Should -Be 'Present' + $Result.InitiatorIds | Should -Be $TestServerTargetWithiSNS.InitiatorIds + $Result.Paths | Should -Be $TestServerTargetWithiSNS.Paths + $Result.iSNSServer | Should -Be $TestServerTargetWithiSNS.iSNSServer } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -174,7 +174,7 @@ try { $Splat = $TestServerTarget.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -206,7 +206,7 @@ try $Splat = $TestServerTarget.Clone() $Splat.Paths += @( 'd:\NewVHD.vhdx' ) Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -238,7 +238,7 @@ try $Splat = $TestServerTarget.Clone() $Splat.Paths = @( 'd:\NewVHD.vhdx' ) Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -270,7 +270,7 @@ try $Splat = $TestServerTarget.Clone() $Splat.InitiatorIds += @( 'Iqn:iqn.1991-05.com.microsoft:fs3.contoso.com' ) Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -302,7 +302,7 @@ try $Splat = $TestServerTarget.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -334,7 +334,7 @@ try $Splat = $TestServerTarget.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -366,7 +366,7 @@ try $Splat = $TestServerTargetWithiSNS.Clone() $Splat.iSNSServer = 'different.contoso.com' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -397,7 +397,7 @@ try { $Splat = $TestServerTargetWithiSNS.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -429,7 +429,7 @@ try $Splat = $TestServerTargetWithiSNS.Clone() $Splat.iSNSServer = '' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -461,7 +461,7 @@ try $Splat = $TestServerTarget.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -486,7 +486,7 @@ try It 'should return false' { $Splat = $TestServerTarget.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -502,7 +502,7 @@ try It 'should return false' { $Splat = $TestServerTarget.Clone() $Splat.Paths = @( 'd:\NewVHD.vhdx' ) - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -518,7 +518,7 @@ try It 'should return false' { $Splat = $TestServerTarget.Clone() $Splat.InitiatorIds += @( 'Iqn:iqn.1991-05.com.microsoft:fs3.contoso.com' ) - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -533,7 +533,7 @@ try It 'should return true' { $Splat = $TestServerTarget.Clone() - Test-TargetResource @Splat | Should Be $True + Test-TargetResource @Splat | Should -Be $True } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -549,7 +549,7 @@ try It 'should return false' { $Splat = $TestServerTarget.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -565,7 +565,7 @@ try It 'should return true' { $Splat = $TestServerTarget.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $True + Test-TargetResource @Splat | Should -Be $True } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -580,7 +580,7 @@ try It 'should return false' { $Splat = $TestServerTargetWithiSNS.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -596,7 +596,7 @@ try It 'should return false' { $Splat = $TestServerTargetWithiSNS.Clone() $Splat.iSNSServer = 'different.contoso.com' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -612,7 +612,7 @@ try It 'should return false' { $Splat = $TestServerTargetWithiSNS.Clone() $Splat.iSNSServer = '' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -628,7 +628,7 @@ try It 'should return false' { $Splat = $TestServerTarget.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -646,7 +646,7 @@ try It 'should return null' { $Splat = $TestServerTarget.Clone() $Result = Get-ServerTarget -TargetName $Splat.TargetName - $Result | Should Be $null + $Result | Should -Be $null } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 @@ -660,8 +660,8 @@ try It 'should return expected parameters' { $Splat = $TestServerTarget.Clone() $Result = Get-ServerTarget -TargetName $Splat.TargetName - $Result.InitiatorIds | Should Be $MockServerTarget.InitiatorIds - $Result.Paths | Should Be $MockServerTarget.Paths + $Result.InitiatorIds | Should -Be $MockServerTarget.InitiatorIds + $Result.Paths | Should -Be $MockServerTarget.Paths } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIServerTarget -Exactly 1 diff --git a/Tests/Unit/DSR_iSCSIVirtualDisk.Tests.ps1 b/Tests/Unit/DSR_iSCSIVirtualDisk.Tests.ps1 index 838a9b7..3cf6002 100644 --- a/Tests/Unit/DSR_iSCSIVirtualDisk.Tests.ps1 +++ b/Tests/Unit/DSR_iSCSIVirtualDisk.Tests.ps1 @@ -51,7 +51,7 @@ try Describe 'Environment' { Context 'Operating System' { It 'Should be a Server OS' { - $ProductType | Should Be 3 + $ProductType | Should -Be 3 } } } @@ -64,7 +64,7 @@ try Describe 'Environment' { Context 'Windows Features' { It 'Should have the iSCSI Target Feature Installed' { - $Installed | Should Be $true + $Installed | Should -Be $true } } } @@ -82,7 +82,7 @@ try It 'should return absent Virtual Disk' { $Result = Get-TargetResource ` -Path $TestVirtualDisk.Path - $Result.Ensure | Should Be 'Absent' + $Result.Ensure | Should -Be 'Absent' } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -96,12 +96,12 @@ try It 'should return correct Virtual Disk' { $Result = Get-TargetResource ` -Path $TestVirtualDisk.Path - $Result.Ensure | Should Be 'Present' - $Result.Path | Should Be $TestVirtualDisk.Path - $Result.DiskType | Should Be $TestVirtualDisk.DiskType - $Result.SizeBytes | Should Be $TestVirtualDisk.SizeBytes - $Result.Description | Should Be $TestVirtualDisk.Description - $Result.ParentPath | Should Be $TestVirtualDisk.ParentPath + $Result.Ensure | Should -Be 'Present' + $Result.Path | Should -Be $TestVirtualDisk.Path + $Result.DiskType | Should -Be $TestVirtualDisk.DiskType + $Result.SizeBytes | Should -Be $TestVirtualDisk.SizeBytes + $Result.Description | Should -Be $TestVirtualDisk.Description + $Result.ParentPath | Should -Be $TestVirtualDisk.ParentPath } It 'should call the expected mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -122,7 +122,7 @@ try { $Splat = $TestVirtualDisk.Clone() Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -144,7 +144,7 @@ try $Splat = $TestVirtualDisk.Clone() $Splat.Description = 'Different' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -174,7 +174,7 @@ try $errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord ` -ArgumentList $exception, $errorId, $errorCategory, $null - { Set-TargetResource @Splat } | Should Throw $errorRecord + { Set-TargetResource @Splat } | Should -Throw $errorRecord } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -203,7 +203,7 @@ try $errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord ` -ArgumentList $exception, $errorId, $errorCategory, $null - { Set-TargetResource @Splat } | Should Throw $errorRecord + { Set-TargetResource @Splat } | Should -Throw $errorRecord } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -232,7 +232,7 @@ try $errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord ` -ArgumentList $exception, $errorId, $errorCategory, $null - { Set-TargetResource @Splat } | Should Throw $errorRecord + { Set-TargetResource @Splat } | Should -Throw $errorRecord } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -254,7 +254,7 @@ try $Splat = $TestVirtualDisk.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -276,7 +276,7 @@ try $Splat = $TestVirtualDisk.Clone() $Splat.Ensure = 'Absent' Set-TargetResource @Splat - } | Should Not Throw + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -295,7 +295,7 @@ try It 'should return false' { $Splat = $TestVirtualDisk.Clone() - Test-TargetResource @Splat | Should Be $False + Test-TargetResource @Splat | Should -Be $False } It 'should call expected Mocks' { @@ -311,8 +311,8 @@ try { $Splat = $TestVirtualDisk.Clone() $Splat.Description = 'Different' - Test-TargetResource @Splat | Should Be $False - } | Should Not Throw + Test-TargetResource @Splat | Should -Be $False + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -336,7 +336,7 @@ try $errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord ` -ArgumentList $exception, $errorId, $errorCategory, $null - { Test-TargetResource @Splat } | Should Throw $errorRecord + { Test-TargetResource @Splat } | Should -Throw $errorRecord } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -359,7 +359,7 @@ try $errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord ` -ArgumentList $exception, $errorId, $errorCategory, $null - { Test-TargetResource @Splat } | Should Throw $errorRecord + { Test-TargetResource @Splat } | Should -Throw $errorRecord } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -382,7 +382,7 @@ try $errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord ` -ArgumentList $exception, $errorId, $errorCategory, $null - { Test-TargetResource @Splat } | Should Throw $errorRecord + { Test-TargetResource @Splat } | Should -Throw $errorRecord } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -396,8 +396,8 @@ try It 'should return true' { { $Splat = $TestVirtualDisk.Clone() - Test-TargetResource @Splat | Should Be $True - } | Should Not Throw + Test-TargetResource @Splat | Should -Be $True + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -412,8 +412,8 @@ try { $Splat = $TestVirtualDisk.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $False - } | Should Not Throw + Test-TargetResource @Splat | Should -Be $False + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -428,8 +428,8 @@ try { $Splat = $TestVirtualDisk.Clone() $Splat.Ensure = 'Absent' - Test-TargetResource @Splat | Should Be $True - } | Should Not Throw + Test-TargetResource @Splat | Should -Be $True + } | Should -Not -Throw } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -446,7 +446,7 @@ try It 'should return null' { $Splat = $TestVirtualDisk.Clone() $Result = Get-VirtualDisk -Path $Splat.Path - $Result | Should Be $null + $Result | Should -Be $null } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 @@ -460,11 +460,11 @@ try It 'should return expected parameters' { $Splat = $TestVirtualDisk.Clone() $Result = Get-VirtualDisk -Path $Splat.Path - $Result.Path | Should Be $MockVirtualDisk.Path - $Result.DiskType | Should Be $MockVirtualDisk.DiskType - $Result.Size | Should Be $MockVirtualDisk.Size - $Result.Description | Should Be $MockVirtualDisk.Description - $Result.ParentPath | Should Be $MockVirtualDisk.ParentPath + $Result.Path | Should -Be $MockVirtualDisk.Path + $Result.DiskType | Should -Be $MockVirtualDisk.DiskType + $Result.Size | Should -Be $MockVirtualDisk.Size + $Result.Description | Should -Be $MockVirtualDisk.Description + $Result.ParentPath | Should -Be $MockVirtualDisk.ParentPath } It 'should call expected Mocks' { Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 From 40dfe15b20ba0bea7cb17ae1e39b81e7052d2b0a Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Thu, 5 Apr 2018 20:45:24 +1200 Subject: [PATCH 3/8] Clean up tests --- Tests/Integration/DSR_iSCSIInitiator.Integration.Tests.ps1 | 2 +- Tests/Integration/DSR_iSCSIServerTarget.Integration.Tests.ps1 | 2 +- Tests/Integration/DSR_iSCSIVirtualDisk.Integration.Tests.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Integration/DSR_iSCSIInitiator.Integration.Tests.ps1 b/Tests/Integration/DSR_iSCSIInitiator.Integration.Tests.ps1 index e9a1655..eb00ae1 100644 --- a/Tests/Integration/DSR_iSCSIInitiator.Integration.Tests.ps1 +++ b/Tests/Integration/DSR_iSCSIInitiator.Integration.Tests.ps1 @@ -85,7 +85,7 @@ try { & "$($script:DSCResourceName)_Config" -OutputPath $TestDrive Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should -not -throw + } | Should -Not -Throw } It 'should be able to call Get-DscConfiguration without throwing' { diff --git a/Tests/Integration/DSR_iSCSIServerTarget.Integration.Tests.ps1 b/Tests/Integration/DSR_iSCSIServerTarget.Integration.Tests.ps1 index 62fd5ae..77e8a59 100644 --- a/Tests/Integration/DSR_iSCSIServerTarget.Integration.Tests.ps1 +++ b/Tests/Integration/DSR_iSCSIServerTarget.Integration.Tests.ps1 @@ -65,7 +65,7 @@ try { & "$($script:DSCResourceName)_Config" -OutputPath $TestDrive Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should -not -throw + } | Should -Not -Throw } It 'should be able to call Get-DscConfiguration without throwing' { diff --git a/Tests/Integration/DSR_iSCSIVirtualDisk.Integration.Tests.ps1 b/Tests/Integration/DSR_iSCSIVirtualDisk.Integration.Tests.ps1 index de10a1e..8077772 100644 --- a/Tests/Integration/DSR_iSCSIVirtualDisk.Integration.Tests.ps1 +++ b/Tests/Integration/DSR_iSCSIVirtualDisk.Integration.Tests.ps1 @@ -59,7 +59,7 @@ try { & "$($script:DSCResourceName)_Config" -OutputPath $TestDrive Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should -not -throw + } | Should -Not -Throw } It 'should be able to call Get-DscConfiguration without throwing' { From 62ea4c4a2c9baab6a905f6ce6b914840478c2547 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Thu, 5 Apr 2018 20:53:32 +1200 Subject: [PATCH 4/8] Revert optin --- .MetaTestOptIn.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.MetaTestOptIn.json b/.MetaTestOptIn.json index 6f385f8..6698072 100644 --- a/.MetaTestOptIn.json +++ b/.MetaTestOptIn.json @@ -3,7 +3,6 @@ "Common Tests - Validate Example Files", "Common Tests - Validate Module Files", "Common Tests - Validate Script Files", - "Common Tests - Required Script Analyzer Rules", "Common Tests - Flagged Script Analyzer Rules", "Common Tests - New Error-Level Script Analyzer Rules", "Common Tests - Custom Script Analyzer Rules" From 541855bcb750eb53b42093861b92d1035574ca00 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Thu, 26 Apr 2018 21:07:20 +1200 Subject: [PATCH 5/8] Update Code of Conduct --- CODEOFCONDUCT.md | 133 +++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 +- 2 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 CODEOFCONDUCT.md diff --git a/CODEOFCONDUCT.md b/CODEOFCONDUCT.md new file mode 100644 index 0000000..2b2b442 --- /dev/null +++ b/CODEOFCONDUCT.md @@ -0,0 +1,133 @@ +# Open Source Code of Conduct + +This code of conduct outlines our expectations for participants within this +DSC Resource Module community, as well as steps to reporting unacceptable behavior. +We are committed to providing a welcoming and inspiring community for all and expect +our code of conduct to be honored. Anyone who violates this code of conduct may be +banned from the community. + +Our open source communities strive to: + +- **Be friendly and patient.** +- **Be welcoming:** We strive to be a community that welcomes and supports people + of all backgrounds and identities. This includes, but is not limited to members + of any race, ethnicity, culture, national origin, colour, immigration status, + social and economic class, educational level, sex, sexual orientation, gender + identity and expression, age, size, family status, political belief, religion, + and mental and physical ability. +- **Be considerate:** Your work will be used by other people, and you in turn + will depend on the work of others. Any decision you take will affect users and + colleagues, and you should take those consequences into account when making + decisions. Remember that we're a world-wide community, so you might not be + communicating in someone else's primary language. +- **Be respectful:** Not all of us will agree all the time, but disagreement is + no excuse for poor behavior and poor manners. We might all experience some + frustration now and then, but we cannot allow that frustration to turn into a + personal attack. It's important to remember that a community where people feel + uncomfortable or threatened is not a productive one. +- **Be careful in the words that we choose:** we are a community of professionals, + and we conduct ourselves professionally. Be kind to others. Do not insult or + put down other participants. Harassment and other exclusionary behavior aren't + acceptable. +- **Try to understand why we disagree:** Disagreements, both social and technical, + happen all the time. It is important that we resolve disagreements and differing + views constructively. Remember that we're different. The strength of our community + comes from its diversity, people from a wide range of backgrounds. Different people + have different perspectives on issues. Being unable to understand why someone holds + a viewpoint doesn't mean that they're wrong. Don't forget that it is human to err + and blaming each other doesn't get us anywhere. Instead, focus on helping to resolve + issues and learning from mistakes. + +## Definitions + +Harassment includes, but is not limited to: + +- Offensive comments related to gender, gender identity and expression, sexual + orientation, disability, mental illness, neuro(a)typicality, physical appearance, + body size, race, age, regional discrimination, political or religious affiliation +- Unwelcome comments regarding a person's lifestyle choices and practices, + including those related to food, health, parenting, drugs, and employment +- Deliberate misgendering. This includes deadnaming or persistently using a + pronoun that does not correctly reflect a person's gender identity. You must + address people by the name they give you when not addressing them by their username + or handle +- Physical contact and simulated physical contact (eg, textual descriptions like + "hug" or "backrub") without consent or after a request to stop +- Threats of violence, both physical and psychological +- Incitement of violence towards any individual, including encouraging a person + to commit suicide or to engage in self-harm +- Deliberate intimidation +- Stalking or following +- Harassing photography or recording, including logging online activity for + harassment purposes +- Sustained disruption of discussion +- Unwelcome sexual attention, including gratuitous or off-topic sexual images or + behaviour +- Pattern of inappropriate social contact, such as requesting/assuming inappropriate + levels of intimacy with others +- Continued one-on-one communication after requests to cease +- Deliberate "outing" of any aspect of a person's identity without their consent + except as necessary to protect others from intentional abuse +- Publication of non-harassing private communication + +Our open source community prioritizes marginalized people's safety over privileged +people's comfort. We will not act on complaints regarding: + +- 'Reverse' -isms, including 'reverse racism,' 'reverse sexism,' and 'cisphobia' +- Reasonable communication of boundaries, such as "leave me alone," "go away," or + "I'm not discussing this with you" +- Refusal to explain or debate social justice concepts +- Communicating in a 'tone' you don't find congenial +- Criticizing racist, sexist, cissexist, or otherwise oppressive behavior or assumptions + +## Diversity Statement + +We encourage everyone to participate and are committed to building a community +for all. Although we will fail at times, we seek to treat everyone both as fairly +and equally as possible. Whenever a participant has made a mistake, we expect them +to take responsibility for it. If someone has been harmed or offended, it is our +responsibility to listen carefully and respectfully, and do our best to right the +wrong. + +Although this list cannot be exhaustive, we explicitly honor diversity in age, +gender, gender identity or expression, culture, ethnicity, language, national +origin, political beliefs, profession, race, religion, sexual orientation, socioeconomic +status, and technical ability. We will not tolerate discrimination based on any +of the protected characteristics above, including participants with disabilities. + +## Reporting Code of Conduct Issues + +If you experience or witness unacceptable behavior—or have any other concerns, +please report it by contacting us via [dscottraynsford@outlook.com](mailto:dscottraynsford@outlook.com). +All reports will be handled with discretion. + +In your report please include: + +- Your contact information. +- Names (real, usernames or pseudonyms) of any individuals involved. If there + are additional witnesses, please include them as well. +- Your account of what occurred, and if you believe the incident is ongoing. +- If there is a publicly available record (e.g. a mailing list archive or a + public chat log), please include a link or attachment. +- Any additional information that may be helpful. + +After filing a report, a representative will contact you personally, review the +incident, follow up with any additional questions, and make a decision as to how +to respond. If the person who is harassing you is part of the response team, they +will recuse themselves from handling your incident. If the complaint originates +from a member of the response team, it will be handled by a different member of +the response team. We will respect confidentiality requests for the purpose of +protecting victims of abuse. + +## Attribution & Acknowledgements + +We all stand on the shoulders of giants across many open source communities. +We’d like to thank the communities and projects that established code of conducts +and diversity statements as our inspiration: + +- [Django](https://www.djangoproject.com/conduct/reporting/) +- [Python](https://www.python.org/community/diversity/) +- [Ubuntu](http://www.ubuntu.com/about/about-ubuntu/conduct) +- [Contributor Covenant](http://contributor-covenant.org/) +- [Geek Feminism](http://geekfeminism.org/about/code-of-conduct/) +- [Citizen Code of Conduct](http://citizencodeofconduct.org/) diff --git a/README.md b/README.md index 99c2a55..e635295 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,7 @@ Targets and Initiators. **This project is not maintained or supported by Microsoft.** -It has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/). +This project has adopted this [Open Source Code of Conduct](CODEOFCONDUCT.md). This module should meet the [PowerShell DSC Resource Kit High Quality Resource Module Guidelines](https://github.com/PowerShell/DscResources/blob/master/HighQualityModuleGuidelines.md). From d8068426a6c3fde7bc7af7a5e8ebbaf28610b3b8 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Fri, 27 Apr 2018 18:29:10 +1200 Subject: [PATCH 6/8] Renamed Code of Conduct --- CODEOFCONDUCT.md => CODE_OF_CONDUCT.md | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename CODEOFCONDUCT.md => CODE_OF_CONDUCT.md (100%) diff --git a/CODEOFCONDUCT.md b/CODE_OF_CONDUCT.md similarity index 100% rename from CODEOFCONDUCT.md rename to CODE_OF_CONDUCT.md diff --git a/README.md b/README.md index e635295..66b80f2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Targets and Initiators. **This project is not maintained or supported by Microsoft.** -This project has adopted this [Open Source Code of Conduct](CODEOFCONDUCT.md). +This project has adopted this [Open Source Code of Conduct](CODE_OF_CONDUCT.md). This module should meet the [PowerShell DSC Resource Kit High Quality Resource Module Guidelines](https://github.com/PowerShell/DscResources/blob/master/HighQualityModuleGuidelines.md). From ec863d2a873a79cd499042dcccb9fe709f52af69 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Fri, 27 Apr 2018 18:36:55 +1200 Subject: [PATCH 7/8] Added Open Code of Conduct --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 760a94b..0b914e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Enabled PSSA rule violations to fail build - Fixes [Issue #27](https://github.com/PlagueHO/iSCSIDsc/issues/27). - Updated tests to meet Pester v4 standard. +- Added Open Code of Conduct. ## 1.5.0.0 From 6ec4a0150d8f2aae66204b718bba9cb91f701f2b Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Fri, 27 Apr 2018 19:09:46 +1200 Subject: [PATCH 8/8] Fix code coverage --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 2659fbe..f5ce9b7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,6 +28,7 @@ test_script: Invoke-AppveyorTestScriptTask ` -Type 'Harness' ` -MainModulePath $mainModuleFolder ` + -CodeCoverage ` -CodeCovIo #---------------------------------#