Skip to content

Commit aa8f5ea

Browse files
committed
Merge branch '2025-09-01-powershell-sdk' of https://github.com/mihretkidane-OCI/azure-powershell into pr-28613
2 parents 71b1ab3 + 56921cb commit aa8f5ea

8 files changed

+151
-66
lines changed

src/Oracle/Oracle.Autorest/test/Get-AzOracleNetworkAnchor.Tests.ps1

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,35 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzOracleNetworkAnchor'))
1515
}
1616

1717
Describe 'Get-AzOracleNetworkAnchor' {
18-
It 'List' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
18+
$subscriptionId = 'fd42b73d-5f28-4a23-ae7c-ca08c625fe07'
19+
$rgName = 'PowerShellTestRg'
20+
$resourceName = 'OFake_PowerShellTestNetworkAnchor' # <- avoid $name
21+
$resourceId = "/subscriptions/$subscriptionId/resourceGroups/$rgName/providers/Oracle.Database/networkAnchors/$resourceName"
22+
23+
It 'List' {
24+
$list = Get-AzOracleNetworkAnchor -ResourceGroupName $rgName
25+
$list | Should -Not -BeNullOrEmpty
26+
($list | Where-Object Name -eq $resourceName).Id | Should -Be $resourceId
2027
}
2128

22-
It 'Get' -skip {
23-
{ throw [System.NotImplementedException] } | Should -Not -Throw
29+
It 'Get' {
30+
$item = Get-AzOracleNetworkAnchor -SubscriptionId $subscriptionId -ResourceGroupName $rgName -Name $resourceName
31+
$item | Should -Not -BeNullOrEmpty
32+
$item.Id | Should -Be $resourceId
33+
$item.Name | Should -Be $resourceName
2434
}
2535

26-
It 'List1' -skip {
27-
{ throw [System.NotImplementedException] } | Should -Not -Throw
36+
It 'List1' {
37+
$list = Get-AzOracleNetworkAnchor -SubscriptionId $subscriptionId
38+
$list | Should -Not -BeNullOrEmpty
39+
($list | Where-Object Name -eq $resourceName).Id | Should -Be $resourceId
2840
}
2941

30-
It 'GetViaIdentity' -skip {
31-
{ throw [System.NotImplementedException] } | Should -Not -Throw
42+
It 'GetViaIdentity' {
43+
$input = @{ Id = $resourceId }
44+
$item = Get-AzOracleNetworkAnchor -InputObject $input
45+
$item | Should -Not -BeNullOrEmpty
46+
$item.Id | Should -Be $resourceId
47+
$item.Name | Should -Be $resourceName
3248
}
3349
}

src/Oracle/Oracle.Autorest/test/Get-AzOracleResourceAnchor.Tests.ps1

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,37 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzOracleResourceAnchor'))
1515
}
1616

1717
Describe 'Get-AzOracleResourceAnchor' {
18-
It 'List' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
18+
$subscriptionId = 'fd42b73d-5f28-4a23-ae7c-ca08c625fe07'
19+
$rgName = 'PowerShellTestRg'
20+
$raName = 'OFake_PowerShellTestResourceAnchor' # avoid Pester's $Name
21+
$resourceId = "/subscriptions/$subscriptionId/resourceGroups/$rgName/providers/Oracle.Database/resourceAnchors/$raName"
22+
23+
It 'List' {
24+
$list = Get-AzOracleResourceAnchor -ResourceGroupName $rgName
25+
if ($list -and $list.value) { $list = $list.value } # handle non-flattened playback
26+
$list | Should -Not -BeNullOrEmpty
27+
($list | Where-Object Name -eq $raName).Id | Should -Be $resourceId
2028
}
2129

22-
It 'Get' -skip {
23-
{ throw [System.NotImplementedException] } | Should -Not -Throw
30+
It 'Get' {
31+
$item = Get-AzOracleResourceAnchor -ResourceGroupName $rgName -Name $raName
32+
$item | Should -Not -BeNullOrEmpty
33+
$item.Id | Should -Be $resourceId
34+
$item.Name | Should -Be $raName
2435
}
2536

26-
It 'List1' -skip {
27-
{ throw [System.NotImplementedException] } | Should -Not -Throw
37+
It 'List1' {
38+
$list = Get-AzOracleResourceAnchor -SubscriptionId $subscriptionId
39+
if ($list -and $list.value) { $list = $list.value } # handle non-flattened playback
40+
$list | Should -Not -BeNullOrEmpty
41+
($list | Where-Object Name -eq $raName).Id | Should -Be $resourceId
2842
}
2943

30-
It 'GetViaIdentity' -skip {
31-
{ throw [System.NotImplementedException] } | Should -Not -Throw
44+
It 'GetViaIdentity' {
45+
$input = @{ Id = $resourceId }
46+
$item = Get-AzOracleResourceAnchor -InputObject $input
47+
$item | Should -Not -BeNullOrEmpty
48+
$item.Id | Should -Be $resourceId
49+
$item.Name | Should -Be $raName
3250
}
3351
}

src/Oracle/Oracle.Autorest/test/New-AzOracleNetworkAnchor.Tests.ps1

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Minimal playback test for New-AzOracleNetworkAnchor using flattened parameters
2+
# RU note: значения ниже должны совпадать с New-AzOracleNetworkAnchor.Recording.json
3+
14
if(($null -eq $TestName) -or ($TestName -contains 'New-AzOracleNetworkAnchor'))
25
{
36
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
@@ -15,15 +18,25 @@ if(($null -eq $TestName) -or ($TestName -contains 'New-AzOracleNetworkAnchor'))
1518
}
1619

1720
Describe 'New-AzOracleNetworkAnchor' {
18-
It 'CreateExpanded' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
20-
}
21+
# Constants matching the recording (RU: синхронизировать с записью)
22+
$rgName = 'PowerShellTestRg'
23+
$location = 'eastus'
24+
$name = 'OFake_PowerShellTestNetworkAnchor'
2125

22-
It 'CreateViaJsonFilePath' -skip {
23-
{ throw [System.NotImplementedException] } | Should -Not -Throw
24-
}
26+
It 'Create' {
27+
{
28+
# Create via flattened parameters (no JsonString)
29+
$created = New-AzOracleNetworkAnchor `
30+
-Name $name `
31+
-ResourceGroupName $rgName `
32+
-Location $location `
33+
-DisplayName $name `
34+
-AnchorType VCN `
35+
-OciResourceId 'ocid1.vcn.oc1.iad.fakeuniqueid'
2536

26-
It 'CreateViaJsonString' -skip {
27-
{ throw [System.NotImplementedException] } | Should -Not -Throw
37+
# Basic assertions only (RU: держим тест максимально лёгким)
38+
$created | Should -Not -BeNullOrEmpty
39+
$created.Name | Should -Be $name
40+
} | Should -Not -Throw
2841
}
2942
}

src/Oracle/Oracle.Autorest/test/New-AzOracleResourceAnchor.Tests.ps1

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Minimal playback test for New-AzOracleResourceAnchor using typed parameters
2+
# Keep these constants in sync with New-AzOracleResourceAnchor.Recording.json
3+
14
if(($null -eq $TestName) -or ($TestName -contains 'New-AzOracleResourceAnchor'))
25
{
36
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
@@ -15,15 +18,24 @@ if(($null -eq $TestName) -or ($TestName -contains 'New-AzOracleResourceAnchor'))
1518
}
1619

1720
Describe 'New-AzOracleResourceAnchor' {
18-
It 'CreateExpanded' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
20-
}
21+
# Constants matching the recording
22+
$rgName = 'PowerShellTestRg'
23+
$location = 'eastus'
24+
$name = 'OFake_PowerShellTestResourceAnchor'
2125

22-
It 'CreateViaJsonFilePath' -skip {
23-
{ throw [System.NotImplementedException] } | Should -Not -Throw
24-
}
26+
It 'Create' {
27+
{
28+
# Use flattened parameters instead of -JsonString
29+
$created = New-AzOracleResourceAnchor `
30+
-Name $name `
31+
-ResourceGroupName $rgName `
32+
-Location $location `
33+
-DisplayName $name `
34+
-AnchorType Exadata `
35+
-OciResourceId 'ocid1.resource.oc1.iad.fakeuniqueid'
2536

26-
It 'CreateViaJsonString' -skip {
27-
{ throw [System.NotImplementedException] } | Should -Not -Throw
37+
$created | Should -Not -BeNullOrEmpty
38+
$created.Name | Should -Be $name
39+
} | Should -Not -Throw
2840
}
2941
}

src/Oracle/Oracle.Autorest/test/Remove-AzOracleNetworkAnchor.Tests.ps1

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@ if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzOracleNetworkAnchor'
1515
}
1616

1717
Describe 'Remove-AzOracleNetworkAnchor' {
18-
It 'Delete' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
18+
$subscriptionId = 'fd42b73d-5f28-4a23-ae7c-ca08c625fe07'
19+
$rgName = 'PowerShellTestRg'
20+
$name = 'OFake_PowerShellTestNetworkAnchor'
21+
$resourceId = "/subscriptions/$subscriptionId/resourceGroups/$rgName/providers/Oracle.Database/networkAnchors/$name"
22+
23+
It 'Delete' {
24+
{
25+
Remove-AzOracleNetworkAnchor -ResourceGroupName $rgName -Name $name -Force -Confirm:$false -NoWait
26+
} | Should -Not -Throw
2027
}
2128

22-
It 'DeleteViaIdentity' -skip {
23-
{ throw [System.NotImplementedException] } | Should -Not -Throw
29+
It 'DeleteViaIdentity' {
30+
{
31+
$input = @{ Id = $resourceId }
32+
Remove-AzOracleNetworkAnchor -InputObject $input -Force -Confirm:$false -NoWait
33+
} | Should -Not -Throw
2434
}
2535
}

src/Oracle/Oracle.Autorest/test/Remove-AzOracleResourceAnchor.Tests.ps1

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@ if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzOracleResourceAnchor
1515
}
1616

1717
Describe 'Remove-AzOracleResourceAnchor' {
18-
It 'Delete' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
18+
$subscriptionId = 'fd42b73d-5f28-4a23-ae7c-ca08c625fe07'
19+
$rgName = 'PowerShellTestRg'
20+
$name = 'OFake_PowerShellTestResourceAnchor'
21+
$resourceId = "/subscriptions/$subscriptionId/resourceGroups/$rgName/providers/Oracle.Database/resourceAnchors/$name"
22+
23+
It 'Delete' {
24+
{
25+
Remove-AzOracleResourceAnchor -ResourceGroupName $rgName -Name $name -Force -Confirm:$false -NoWait
26+
} | Should -Not -Throw
2027
}
2128

22-
It 'DeleteViaIdentity' -skip {
23-
{ throw [System.NotImplementedException] } | Should -Not -Throw
29+
It 'DeleteViaIdentity' {
30+
{
31+
$input = @{ Id = $resourceId }
32+
Remove-AzOracleResourceAnchor -InputObject $input -Force -Confirm:$false -NoWait
33+
} | Should -Not -Throw
2434
}
2535
}

src/Oracle/Oracle.Autorest/test/Update-AzOracleNetworkAnchor.Tests.ps1

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@ if(($null -eq $TestName) -or ($TestName -contains 'Update-AzOracleNetworkAnchor'
1515
}
1616

1717
Describe 'Update-AzOracleNetworkAnchor' {
18-
It 'UpdateExpanded' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
20-
}
21-
22-
It 'UpdateViaJsonString' -skip {
23-
{ throw [System.NotImplementedException] } | Should -Not -Throw
24-
}
25-
26-
It 'UpdateViaJsonFilePath' -skip {
27-
{ throw [System.NotImplementedException] } | Should -Not -Throw
28-
}
18+
$rgName = 'PowerShellTestRg'
19+
$name = 'OFake_PowerShellTestNetworkAnchor'
2920

30-
It 'UpdateViaIdentityExpanded' -skip {
31-
{ throw [System.NotImplementedException] } | Should -Not -Throw
21+
It 'Update' {
22+
{
23+
# Minimal PATCH via JsonString; adjust fields to match recording
24+
$json = @"
25+
{
26+
"properties": {
27+
"displayName": "$name"
28+
}
29+
}
30+
"@
31+
$updated = Update-AzOracleNetworkAnchor -Name $name -ResourceGroupName $rgName -JsonString $json
32+
$updated | Should -Not -BeNullOrEmpty
33+
$updated.Name | Should -Be $name
34+
} | Should -Not -Throw
3235
}
3336
}

src/Oracle/Oracle.Autorest/test/Update-AzOracleResourceAnchor.Tests.ps1

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@ if(($null -eq $TestName) -or ($TestName -contains 'Update-AzOracleResourceAnchor
1515
}
1616

1717
Describe 'Update-AzOracleResourceAnchor' {
18-
It 'UpdateExpanded' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
20-
}
21-
22-
It 'UpdateViaJsonString' -skip {
23-
{ throw [System.NotImplementedException] } | Should -Not -Throw
24-
}
25-
26-
It 'UpdateViaJsonFilePath' -skip {
27-
{ throw [System.NotImplementedException] } | Should -Not -Throw
28-
}
18+
$rgName = 'PowerShellTestRg'
19+
$name = 'OFake_PowerShellTestResourceAnchor'
2920

30-
It 'UpdateViaIdentityExpanded' -skip {
31-
{ throw [System.NotImplementedException] } | Should -Not -Throw
21+
It 'Update' {
22+
{
23+
# Minimal PATCH body per your API spec (ResourceAnchorUpdate)
24+
$json = @"
25+
{
26+
"properties": {
27+
"displayName": "$name"
28+
}
29+
}
30+
"@
31+
$updated = Update-AzOracleResourceAnchor -Name $name -ResourceGroupName $rgName -JsonString $json
32+
$updated | Should -Not -BeNullOrEmpty
33+
$updated.Name | Should -Be $name
34+
} | Should -Not -Throw
3235
}
3336
}

0 commit comments

Comments
 (0)