Skip to content

Commit 948f90f

Browse files
Merge pull request #1029 from dataplat/feature/fix-hadr
So that we can have HADR checks with the latest dbatools properties
2 parents 0fa1983 + d114dac commit 948f90f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
## [Unreleased]
77

88
- fixed typo in Invoke-PerfAndValidateCheck so we know which version we're looking at
9+
- Updated HADR checks to use dbatools new outputs
910

1011
## [3.0.2] - 2025-03-10
1112

source/checks/HADR.Tests.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,32 +353,32 @@ foreach ($clustervm in $clusters) {
353353
Context "Database availability group status for $($AG.Name) on $clustername" {
354354
@($ag.AvailabilityReplicas.Where{ $_.AvailabilityMode -eq 'SynchronousCommit' }).ForEach{
355355
@(Get-DbaAgDatabase -SqlInstance $psitem.Name -AvailabilityGroup $Ag.Name).ForEach{
356-
It "Database $($psitem.DatabaseName) should be synchronised on the replica $($psitem.Replica)" {
356+
It "Database $($psitem.Name) should be synchronised on the replica $($psitem.sqlInstance)" {
357357
$psitem.SynchronizationState | Should -Be 'Synchronized' -Because 'The database on the synchronous replica should be synchronised'
358358
}
359-
It "Database $($psitem.DatabaseName) should be failover ready on the replica $($psitem.Replica)" {
359+
It "Database $($psitem.Name) should be failover ready on the replica $($psitem.sqlInstance)" {
360360
$psitem.IsFailoverReady | Should -BeTrue -Because 'The database on the synchronous replica should be ready to failover'
361361
}
362-
It "Database $($psitem.DatabaseName) should be joined on the replica $($psitem.Replica)" {
362+
It "Database $($psitem.Name) should be joined on the replica $($psitem.sqlInstance)" {
363363
$psitem.IsJoined | Should -BeTrue -Because 'The database on the synchronous replica should be joined to the availability group'
364364
}
365-
It "Database $($psitem.DatabaseName) should not be suspended on the replica $($psitem.Replica)" {
365+
It "Database $($psitem.Name) should not be suspended on the replica $($psitem.sqlInstance)" {
366366
$psitem.IsSuspended | Should -Be $False -Because 'The database on the synchronous replica should not be suspended'
367367
}
368368
}
369369
}
370370
@($ag.AvailabilityReplicas.Where{ $_.AvailabilityMode -eq 'AsynchronousCommit' }).ForEach{
371371
@(Get-DbaAgDatabase -SqlInstance $PSItem.Name -AvailabilityGroup $Ag.Name).ForEach{
372-
It "Database $($psitem.DatabaseName) should be synchronising as it is Async on the secondary replica $($psitem.Replica)" {
372+
It "Database $($psitem.Name) should be synchronising as it is Async on the secondary replica $($psitem.sqlInstance)" {
373373
$psitem.SynchronizationState | Should -Be 'Synchronizing' -Because 'The database on the asynchronous secondary replica should be synchronising'
374374
}
375-
It "Database $($psitem.DatabaseName) should not be failover ready on the secondary replica $($psitem.Replica)" {
375+
It "Database $($psitem.Name) should not be failover ready on the secondary replica $($psitem.sqlInstance)" {
376376
$psitem.IsFailoverReady | Should -BeFalse -Because 'The database on the asynchronous secondary replica should be ready to failover'
377377
}
378-
It "Database $($psitem.DatabaseName) should be joined on the secondary replica $($psitem.Replica)" {
378+
It "Database $($psitem.Name) should be joined on the secondary replica $($psitem.sqlInstance)" {
379379
$psitem.IsJoined | Should -BeTrue -Because 'The database on the asynchronous secondary replica should be joined to the availability group'
380380
}
381-
It "Database $($psitem.DatabaseName) should not be suspended on the secondary replica $($psitem.Replica)" {
381+
It "Database $($psitem.Name) should not be suspended on the secondary replica $($psitem.sqlInstance)" {
382382
$psitem.IsSuspended | Should -Be $False -Because 'The database on the asynchronous secondary replica should not be suspended'
383383
}
384384
}

0 commit comments

Comments
 (0)