Skip to content

Commit 7060901

Browse files
committed
couple of corrections in test
1 parent dccc0e3 commit 7060901

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ function Test-E2E_DeleteAndDissociate
7272
{
7373
if ($association.AssociationStatus -eq "Paired")
7474
{
75-
// We have got the paired profile. Fire delete and dissociate
75+
# We have got the paired profile. Fire delete and dissociate
7676
$pcPri = Get-AzureSiteRecoveryProtectionContainer -Id $association.PrimaryProtectionContainerId
7777
$pcRec = Get-AzureSiteRecoveryProtectionContainer -Id $association.RecoveryProtectionContainerId
7878
$job = Start-AzureSiteRecoveryProtectionProfileDissociationJob -PrimaryProtectionContainer $pcPri -RecoveryProtectionContainer $pcRec -ProtectionProfile $profile
7979

8080
# Validate_ProfileDissociation_JobSucceeded
8181
if ($Validate_ProfileDissociation_JobSucceeded -eq $true)
8282
{
83-
WaitForJobCompletion -JobId $job.ID
83+
WaitForJobCompletion -JobId $job.ID -NumOfSecondsToWait 600
8484
$job = Get-AzureSiteRecoveryJob -Id $job.ID
8585
Assert-True { $job.State -eq "Succeeded" }
8686
}
@@ -127,14 +127,14 @@ function Test-E2E_CreateAndAssociate
127127
}
128128

129129
# we have got second pc as well create profile and associate
130-
$pp = New-AzureSiteRecoveryProtectionProfile -ReplicationProvider HyperVReplica -ReplicationMethod Online -ReplicationFrequencyInSeconds 300 -RecoveryPoints 1 -ApplicationConsistentSnapshotFrequencyInHours 1 -CompressionEnabled -ReplicationPort 8083 -Authentication Kerberos -AllowReplicaDeletion
130+
$pp = New-AzureSiteRecoveryProtectionProfileObject -ReplicationProvider HyperVReplica -ReplicationMethod Online -ReplicationFrequencyInSeconds 300 -RecoveryPoints 1 -ApplicationConsistentSnapshotFrequencyInHours 1 -CompressionEnabled -ReplicationPort 8083 -Authentication Kerberos -AllowReplicaDeletion
131131

132132
$job = Start-AzureSiteRecoveryProtectionProfileAssociationJob -ProtectionProfile $pp -PrimaryProtectionContainer $priPC -RecoveryProtectionContainer $protectionContainer
133133

134134
# Validate_ProfileAssociation_JobSucceeded
135135
if ($Validate_ProfileAssociation_JobSucceeded -eq $true)
136136
{
137-
WaitForJobCompletion -JobId $job.ID
137+
WaitForJobCompletion -JobId $job.ID -NumOfSecondsToWait 600
138138
$job = Get-AzureSiteRecoveryJob -Id $job.ID
139139
Assert-True { $job.State -eq "Succeeded" }
140140
}
@@ -547,13 +547,9 @@ function Test-Failback
547547
{
548548
Assert-NotNull($protectionEntity.Name)
549549
Assert-NotNull($protectionEntity.ID)
550-
Write-Host "Checking PE"
551-
$protectionEntity
552550
if ($protectionEntity.CanFailover -eq $true -and $protectionEntity.ActiveLocation -eq "Recovery")
553551
{
554-
Write-Host "Firing failback"
555-
556-
$job = Start-AzureSiteRecoveryPlannedFailoverJob -Direction RecoveryToPrimary -Optimize ForDowntime -ProtectionEntity $protectionEntity -WaitForCompletion
552+
$job = Start-AzureSiteRecoveryPlannedFailoverJob -Direction RecoveryToPrimary -ProtectionEntity $protectionEntity -WaitForCompletion
557553

558554
# Validate_Failback_JobSucceeded
559555
if ($Validate_Failback_JobSucceeded -eq $true)

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/StartAzureSiteRecoveryPlannedFailoverJob.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public class StartAzureSiteRecoveryPlannedFailoverJob : RecoveryServicesCmdletBa
8888
/// <summary>
8989
/// Gets or sets the Optimize value.
9090
/// </summary>
91-
[Parameter(ParameterSetName = ASRParameterSets.ByPEObjectE2AFailback)]
92-
[Parameter(ParameterSetName = ASRParameterSets.ByPEObjectE2AFailback)]
91+
[Parameter(ParameterSetName = ASRParameterSets.ByPEObjectE2AFailback, Mandatory = true)]
92+
[Parameter(ParameterSetName = ASRParameterSets.ByRPObjectE2AFailback, Mandatory = true)]
9393
[ValidateSet(
9494
Constants.ForDowntime,
9595
Constants.ForSynchronization)]

0 commit comments

Comments
 (0)