Skip to content

Commit 7c76173

Browse files
sssharma24p-thompsonVeryEarly
authored
updating vnv and ipam cmdlets (#26654)
* updating cmdlets * update getipampool cmdlet * updated all vnv cmdlets * ipam cmdlet update * revert setipampool changes * revert set and add help text * Update Get-AzNetworkManagerVerifierWorkspaceReachabilityAnalysisRun.md * pipeline errors * fix ipam static crud test * update help * Update Get-AzNetworkManagerIpamPoolStaticCidr.md * Update Remove-AzNetworkManagerIpamPoolStaticCidr.md * Update ChangeLog.md --------- Co-authored-by: p-thompson <[email protected]> Co-authored-by: Yabo Hu <[email protected]>
1 parent f63dbbd commit 7c76173

File tree

39 files changed

+2423
-1231
lines changed

39 files changed

+2423
-1231
lines changed

src/Network/Network.Test/ScenarioTests/NetworkManagerTests.ps1

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ function Test-NetworkManagerIpamPoolStaticCidrCRUD
15281528
New-AzNetworkManagerIpamPool -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -Name $ipamPoolName -Location $rglocation -AddressPrefix $addressPrefixes
15291529

15301530
# Create static cidr
1531-
New-AzNetworkManagerIpamPoolStaticCidr -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -IpamPoolName $ipamPoolName -Name $staticCidrName -AddressPrefix $addressPrefixes
1531+
New-AzNetworkManagerIpamPoolStaticCidr -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -PoolName $ipamPoolName -Name $staticCidrName -AddressPrefix $addressPrefixes
15321532

15331533
# Get static cidr
15341534
$staticCidr = Get-AzNetworkManagerIpamPoolStaticCidr -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -IpamPoolName $ipamPoolName -Name $staticCidrName
@@ -1588,12 +1588,11 @@ function Test-NetworkManagerVerifierWorkspaceReachabilityAnalysisRunCRUD
15881588
Assert-NotNull $verifierWorkspaceList;
15891589
Assert-AreEqual $verifierWorkspaceList.Count 1;
15901590

1591-
# Update verifier workspace
1592-
$verifierWorkspace.Properties.Description = "A different description."
1593-
$newVerifierWorkspace = Set-AzNetworkManagerVerifierWorkspace -InputObject $verifierWorkspace
1594-
Assert-NotNull $newVerifierWorkspace;
1595-
Assert-AreEqual "A different description." $newVerifierWorkspace.Properties.Description;
1596-
Assert-AreEqual $verifierWorkspaceName $newVerifierWorkspace.Name;
1591+
# Get by resourceId
1592+
$resourceId = $verifierWorkspace.Id
1593+
$verifierWorkspace = Get-AzNetworkManagerVerifierWorkspace -ResourceId $resourceId
1594+
Assert-NotNull $verifierWorkspace
1595+
Assert-AreEqual $resourceId $verifierWorkspace.Id
15971596

15981597
# Create analysis intent
15991598
$sourcePortList = @("100")
@@ -1605,13 +1604,19 @@ function Test-NetworkManagerVerifierWorkspaceReachabilityAnalysisRunCRUD
16051604

16061605
$analysisIntent = New-AzNetworkManagerVerifierWorkspaceReachabilityAnalysisIntent -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -VerifierWorkspaceName $verifierWorkspaceName -Name $reachabilityAnalysisIntentName -SourceResourceId "/subscriptions/c9295b92-3574-4021-95a1-26c8f74f8359/resourceGroups/ipam-test-rg/providers/Microsoft.Compute/virtualMachines/testVM" -DestinationResourceId "/subscriptions/c9295b92-3574-4021-95a1-26c8f74f8359/resourceGroups/ipam-test-rg/providers/Microsoft.Compute/virtualMachines/ipam-test-vm-integration-test" -IpTraffic $groupItem
16071606

1608-
# Get analysis intent
1607+
# Get analysis intent
16091608
$reachabilityAnalysisIntent = Get-AzNetworkManagerVerifierWorkspaceReachabilityAnalysisIntent -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -VerifierWorkspaceName $verifierWorkspaceName -Name $reachabilityAnalysisIntentName
16101609
Assert-NotNull $reachabilityAnalysisIntent;
16111610
Assert-AreEqual $reachabilityAnalysisIntentName $reachabilityAnalysisIntent.Name;
16121611
Assert-AreEqual $reachabilityAnalysisIntent.Properties.IpTraffic.SourceIps $sourceIpList;
16131612
Assert-AreEqual $reachabilityAnalysisIntent.Properties.IpTraffic.DestinationIps $destinationIpList;
16141613

1614+
# Get by resourceId
1615+
$resourceId = $reachabilityAnalysisIntent.Id
1616+
$reachabilityAnalysisIntent = Get-AzNetworkManagerVerifierWorkspaceReachabilityAnalysisIntent -ResourceId $resourceId
1617+
Assert-NotNull $reachabilityAnalysisIntent
1618+
Assert-AreEqual $resourceId $reachabilityAnalysisIntent.Id
1619+
16151620
# Get analysis intent list
16161621
$reachabilityAnalysisIntentList = Get-AzNetworkManagerVerifierWorkspaceReachabilityAnalysisIntent -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -VerifierWorkspaceName $verifierWorkspaceName
16171622
Assert-NotNull $reachabilityAnalysisIntentList;
@@ -1620,7 +1625,6 @@ function Test-NetworkManagerVerifierWorkspaceReachabilityAnalysisRunCRUD
16201625
# Create analysis run
16211626
# Get the intent ID
16221627
$intentId = $analysisIntent.Id
1623-
Write-Host "Analysis Intent ID: $intentId"
16241628

16251629
New-AzNetworkManagerVerifierWorkspaceReachabilityAnalysisRun -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -VerifierWorkspaceName $verifierWorkspaceName -Name $reachabilityAnalysisRunName -IntentId $intentId -Description "DESCription"
16261630

@@ -1634,18 +1638,22 @@ function Test-NetworkManagerVerifierWorkspaceReachabilityAnalysisRunCRUD
16341638
Assert-NotNull $reachabilityAnalysisRunList;
16351639
Assert-AreEqual $reachabilityAnalysisRunList.Count 1
16361640

1641+
# Get by resourceId
1642+
$resourceId = $reachabilityAnalysisRun.Id
1643+
$reachabilityAnalysisRun = Get-AzNetworkManagerVerifierWorkspaceReachabilityAnalysisRun -ResourceId $resourceId
1644+
Assert-NotNull $reachabilityAnalysisRun
1645+
Assert-AreEqual $resourceId $reachabilityAnalysisRun.Id
1646+
16371647
Start-TestSleep -Seconds 300
16381648
Assert-NotNull $reachabilityAnalysisRun
16391649

1640-
# Output the value of AnalysisResult for debugging
1641-
Write-Output "AnalysisResult: $($reachabilityAnalysisRun.Properties.AnalysisResult)"
16421650

16431651
Assert-NotNull $reachabilityAnalysisRun.Properties.AnalysisResult
16441652
Assert-AreEqual "DESCription" $reachabilityAnalysisRun.Properties.Description;
16451653
Assert-AreEqual $intentId $reachabilityAnalysisRun.Properties.IntentId;
16461654

16471655
# Delete analysis run
1648-
$job = Remove-AzNetworkManagerVerifierWorkspaceReachabilityAnalysisRun -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -Name $reachabilityAnalysisRunName -VerifierWorkspaceName $verifierWorkspaceName -PassThru -Force -AsJob;
1656+
$job = Remove-AzNetworkManagerVerifierWorkspaceReachabilityAnalysisRun -ResourceId $reachabilityAnalysisRun.Id -PassThru -Force -AsJob
16491657
$job | Wait-Job;
16501658
$removeResult = $job | Receive-Job;
16511659

@@ -1655,7 +1663,8 @@ function Test-NetworkManagerVerifierWorkspaceReachabilityAnalysisRunCRUD
16551663
$removeResult = $job | Receive-Job;
16561664

16571665
# Delete verifier workspace
1658-
$job = Remove-AzNetworkManagerVerifierWorkspace -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -Name $verifierWorkspaceName -PassThru -Force -AsJob;
1666+
# Remove by InputObject
1667+
$job = Remove-AzNetworkManagerVerifierWorkspace -InputObject $verifierWorkspace -PassThru -Force -AsJob;
16591668
$job | Wait-Job;
16601669
$removeResult = $job | Receive-Job;
16611670
}

0 commit comments

Comments
 (0)