From 78b5fa2bfcf78e63207038a0e1fe91cf41621cfe Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 9 May 2020 12:48:00 +0200 Subject: [PATCH] Fix failing tests --- .../DSC_SqlServerEndpoint/DSC_SqlServerEndpoint.psm1 | 2 +- source/Examples/Resources/SqlAG/1-CreateAvailabilityGroup.ps1 | 1 + .../Resources/SqlAG/3-CreateAvailabilityGroupDetailed.ps1 | 1 + .../Resources/SqlAGReplica/1-CreateAvailabilityGroupReplica.ps1 | 1 + .../SqlServerEndpoint/1-CreateEndpointWithDefaultValues.ps1 | 2 ++ .../Examples/Resources/SqlServerEndpoint/3-RemoveEndpoint.ps1 | 2 ++ tests/Integration/DSC_SqlServerEndpoint.Integration.Tests.ps1 | 2 ++ tests/Integration/DSC_SqlServerEndpoint.config.ps1 | 2 ++ 8 files changed, 12 insertions(+), 1 deletion(-) diff --git a/source/DSCResources/DSC_SqlServerEndpoint/DSC_SqlServerEndpoint.psm1 b/source/DSCResources/DSC_SqlServerEndpoint/DSC_SqlServerEndpoint.psm1 index 3660dd7f38..d6967240c3 100644 --- a/source/DSCResources/DSC_SqlServerEndpoint/DSC_SqlServerEndpoint.psm1 +++ b/source/DSCResources/DSC_SqlServerEndpoint/DSC_SqlServerEndpoint.psm1 @@ -63,6 +63,7 @@ function Get-TargetResource $getTargetResourceReturnValues = @{ ServerName = $ServerName InstanceName = $InstanceName + EndpointType = $EndpointType Ensure = 'Absent' EndpointName = '' Port = '' @@ -206,7 +207,6 @@ function Set-TargetResource { if ($getTargetResourceResult.Ensure -eq 'Absent') { - Write-Verbose -Message ( $script:localizedData.CreateEndpoint -f $EndpointName, $InstanceName ) diff --git a/source/Examples/Resources/SqlAG/1-CreateAvailabilityGroup.ps1 b/source/Examples/Resources/SqlAG/1-CreateAvailabilityGroup.ps1 index 57164eaca0..54809d5125 100644 --- a/source/Examples/Resources/SqlAG/1-CreateAvailabilityGroup.ps1 +++ b/source/Examples/Resources/SqlAG/1-CreateAvailabilityGroup.ps1 @@ -45,6 +45,7 @@ Configuration Example SqlServerEndpoint 'HADREndpoint' { EndPointName = 'HADR' + EndpointType = 'DatabaseMirroring' Ensure = 'Present' Port = 5022 ServerName = $Node.NodeName diff --git a/source/Examples/Resources/SqlAG/3-CreateAvailabilityGroupDetailed.ps1 b/source/Examples/Resources/SqlAG/3-CreateAvailabilityGroupDetailed.ps1 index 79ac51ef1a..b43b987b5c 100644 --- a/source/Examples/Resources/SqlAG/3-CreateAvailabilityGroupDetailed.ps1 +++ b/source/Examples/Resources/SqlAG/3-CreateAvailabilityGroupDetailed.ps1 @@ -48,6 +48,7 @@ Configuration Example SqlServerEndpoint 'HADREndpoint' { EndPointName = 'HADR' + EndpointType = 'DatabaseMirroring' Ensure = 'Present' Port = 5022 ServerName = $Node.NodeName diff --git a/source/Examples/Resources/SqlAGReplica/1-CreateAvailabilityGroupReplica.ps1 b/source/Examples/Resources/SqlAGReplica/1-CreateAvailabilityGroupReplica.ps1 index 21d66147be..132f959e0e 100644 --- a/source/Examples/Resources/SqlAGReplica/1-CreateAvailabilityGroupReplica.ps1 +++ b/source/Examples/Resources/SqlAGReplica/1-CreateAvailabilityGroupReplica.ps1 @@ -51,6 +51,7 @@ Configuration Example SqlServerEndpoint 'HADREndpoint' { EndPointName = 'HADR' + EndpointType = 'DatabaseMirroring' Ensure = 'Present' Port = 5022 ServerName = $Node.NodeName diff --git a/source/Examples/Resources/SqlServerEndpoint/1-CreateEndpointWithDefaultValues.ps1 b/source/Examples/Resources/SqlServerEndpoint/1-CreateEndpointWithDefaultValues.ps1 index f69bd46ba8..ceb897c145 100644 --- a/source/Examples/Resources/SqlServerEndpoint/1-CreateEndpointWithDefaultValues.ps1 +++ b/source/Examples/Resources/SqlServerEndpoint/1-CreateEndpointWithDefaultValues.ps1 @@ -20,6 +20,7 @@ Configuration Example SqlServerEndpoint 'SQLConfigureEndpoint-Instance1' { EndpointName = 'HADR' + EndpointType = 'DatabaseMirroring' InstanceName = 'INST1' PsDscRunAsCredential = $SqlAdministratorCredential @@ -28,6 +29,7 @@ Configuration Example SqlServerEndpoint 'SQLConfigureEndpoint-Instances2' { EndpointName = 'HADR' + EndpointType = 'DatabaseMirroring' InstanceName = 'INST2' PsDscRunAsCredential = $SqlAdministratorCredential diff --git a/source/Examples/Resources/SqlServerEndpoint/3-RemoveEndpoint.ps1 b/source/Examples/Resources/SqlServerEndpoint/3-RemoveEndpoint.ps1 index 6d4d024035..e18e084c22 100644 --- a/source/Examples/Resources/SqlServerEndpoint/3-RemoveEndpoint.ps1 +++ b/source/Examples/Resources/SqlServerEndpoint/3-RemoveEndpoint.ps1 @@ -20,6 +20,7 @@ Configuration Example Ensure = 'Absent' EndpointName = 'HADR' + EndpointType = 'DatabaseMirroring' InstanceName = 'INST1' PsDscRunAsCredential = $SqlAdministratorCredential @@ -30,6 +31,7 @@ Configuration Example Ensure = 'Absent' EndpointName = 'HADR' + EndpointType = 'DatabaseMirroring' InstanceName = 'INST2' PsDscRunAsCredential = $SqlAdministratorCredential diff --git a/tests/Integration/DSC_SqlServerEndpoint.Integration.Tests.ps1 b/tests/Integration/DSC_SqlServerEndpoint.Integration.Tests.ps1 index cf57bbaa49..1d1a77b3a1 100644 --- a/tests/Integration/DSC_SqlServerEndpoint.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlServerEndpoint.Integration.Tests.ps1 @@ -74,6 +74,7 @@ try $resourceCurrentState.Ensure | Should -Be 'Present' $resourceCurrentState.EndpointName | Should -Be $ConfigurationData.AllNodes.EndpointName + $resourceCurrentState.EndpointType | Should -Be 'DatabaseMirroring' $resourceCurrentState.Port | Should -Be $ConfigurationData.AllNodes.Port $resourceCurrentState.IpAddress | Should -Be $ConfigurationData.AllNodes.IpAddress $resourceCurrentState.Owner | Should -Be $ConfigurationData.AllNodes.Owner @@ -124,6 +125,7 @@ try $resourceCurrentState.Ensure | Should -Be 'Absent' $resourceCurrentState.EndpointName | Should -BeNullOrEmpty + $resourceCurrentState.EndpointType | Should -Be 'DatabaseMirroring' } It 'Should return $true when Test-DscConfiguration is run' { diff --git a/tests/Integration/DSC_SqlServerEndpoint.config.ps1 b/tests/Integration/DSC_SqlServerEndpoint.config.ps1 index 7f63e518ef..3a6d4d0355 100644 --- a/tests/Integration/DSC_SqlServerEndpoint.config.ps1 +++ b/tests/Integration/DSC_SqlServerEndpoint.config.ps1 @@ -46,6 +46,7 @@ Configuration DSC_SqlServerEndpoint_Add_Config Ensure = 'Present' EndpointName = $Node.EndpointName + EndpointType = 'DatabaseMirroring' Port = $Node.Port IpAddress = $Node.IpAddress Owner = $Node.Owner @@ -72,6 +73,7 @@ Configuration DSC_SqlServerEndpoint_Remove_Config Ensure = 'Absent' EndpointName = $Node.EndpointName + EndpointType = 'DatabaseMirroring' ServerName = $Node.ServerName InstanceName = $Node.InstanceName