Skip to content

pull from dev branch of azure/azure-powershell #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Jan 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1c75923
add warning for commands to be removed
Dec 19, 2014
7320b63
tweak wording
Dec 19, 2014
13e79c2
remove a useless empty line
Dec 19, 2014
c77f6e8
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
26273de
FW: Re-recording the Test-GetAzureADUserWithUPN.
Jan 8, 2015
7df1dc3
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
1710cf5
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
b2fa151
FW: Re-recording the Test-GetAzureADUserWithUPN.
Jan 8, 2015
5abe3be
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
0f5b12b
Merge branch 'master' of https://github.com/perseusCode/azure-powershell
Jan 9, 2015
8db9886
FW: Adding Hyak.Common to Commands.Resources.proj as Jenkins complains
Jan 13, 2015
2de6931
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
e7eff28
FW: Re-recording the Test-GetAzureADUserWithUPN.
Jan 8, 2015
0d56c55
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
7819550
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
471f0a0
FW: Getting rid of build and test failures after merge.
Jan 13, 2015
4ea884d
Merge branch 'master' of https://github.com/perseusCode/azure-powershell
Jan 13, 2015
d366494
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
72442fb
FW: Re-recording the Test-GetAzureADUserWithUPN.
Jan 8, 2015
84726a0
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
ba61a3c
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
8901c05
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
b8689f6
Improve ADF naming restriction error message and updated help xml con…
Jan 15, 2015
a1cd4fb
Format change in ps1 file.
Jan 15, 2015
8f29d2e
Fix the resource group invalid name test.
Jan 15, 2015
f492200
Fix the missing copy if newer property in test.
Jan 15, 2015
7d1b492
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
a6f4a4f
FW: Getting rid of build and test failures after merge.
Jan 13, 2015
af3f5e5
Merge branch 'master' of https://github.com/perseusCode/azure-powershell
Jan 15, 2015
383c254
Merge pull request #88 from yitao-zhang/dev
stankovski Jan 15, 2015
915b585
Merge pull request #61 from yugangw-msft/gone
yugangw-msft Jan 15, 2015
c004ef9
Merge pull request #87 from perseusCode/master
ogail Jan 16, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ScenarioTests\NamingValidationTests.cs" />
<Compile Include="ScenarioTests\HubTests.cs" />
<Compile Include="UnitTests\GetHubTests.cs" />
<Compile Include="UnitTests\NewDataFactoryEncryptValueTests.cs" />
Expand Down Expand Up @@ -193,6 +194,9 @@
<None Include="ScenarioTests\DataFactoryGatewayTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\NamingValidationTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\HubTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -259,6 +263,21 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.DataFactories.Test.LinkedServiceTests\TestLinkedServiceWithDataFactoryParameter.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataFactories.Test.NamingValidationTests\TestInvalidDataFactoryName.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataFactories.Test.NamingValidationTests\TestInvalidHubName.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataFactories.Test.NamingValidationTests\TestInvalidPipelineName.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataFactories.Test.NamingValidationTests\TestInvalidResourceGroupName.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataFactories.Test.NamingValidationTests\TestInvalidTableName.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataFactories.Test.TableTests\TestGetTableWithEmptyName.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;

namespace Microsoft.Azure.Commands.DataFactories.Test
{
public class NamingValidationTests : DataFactoriesScenarioTestsBase
{
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestInvalidResourceGroupName()
{
RunPowerShellTest("Test-InvalidResourceGroupName");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestInvalidDataFactoryName()
{
RunPowerShellTest("Test-InvalidDataFactoryName");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestInvalidLinkedServiceName()
{
RunPowerShellTest("Test-InvalidLinkedServiceName");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestInvalidTableName()
{
RunPowerShellTest("Test-InvalidTableName");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestInvalidPipelineName()
{
RunPowerShellTest("Test-InvalidPipelineName");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestInvalidHubName()
{
RunPowerShellTest("Test-InvalidHubName");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

# Make sure the naming error contains the below link to ADF naming rules MSDN page
$invalidNameError = "http://msdn.microsoft.com/en-us/library/dn835027.aspx"

<#
.SYNOPSIS
Test naming restriction support.
#>
function Test-InvalidResourceGroupName
{
$rgName = "adf#$%"
$dfName = "adf"

Assert-ThrowsContains { Get-AzureDataFactory -ResourceGroupName $rgName } $invalidNameError

Assert-ThrowsContains { New-AzureDataFactory -ResourceGroupName $rgName -Name $dfName -Location westus -Force } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactory -ResourceGroupName $rgName -Name $dfName -Force } $invalidNameError

Assert-ThrowsContains { Get-AzureDataFactoryLinkedService -ResourceGroupName $rgName -DataFactoryName $dfName} $invalidNameError

Assert-ThrowsContains { New-AzureDataFactoryLinkedService -ResourceGroupName $rgName -DataFactoryName $dfName -Name "ls" -File .\Resources\linkedService.json -Force } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactoryLinkedService -ResourceGroupName $rgName -DataFactoryName $dfName -Name "ls" -Force } $invalidNameError

Assert-ThrowsContains { Get-AzureDataFactoryTable -ResourceGroupName $rgName -DataFactoryName $dfName} $invalidNameError

Assert-ThrowsContains { New-AzureDataFactoryTable -ResourceGroupName $rgName -DataFactoryName $dfName -Name "table" -File .\Resources\table.json -Force } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactoryTable -ResourceGroupName $rgName -DataFactoryName $dfName -Name "table" -Force } $invalidNameError

Assert-ThrowsContains { Get-AzureDataFactoryPipeline -ResourceGroupName $rgName -DataFactoryName $dfName} $invalidNameError

Assert-ThrowsContains { New-AzureDataFactoryPipeline -ResourceGroupName $rgName -DataFactoryName $dfName -Name "pipeline" -File .\Resources\pipeline.json -Force } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactoryPipeline -ResourceGroupName $rgName -DataFactoryName $dfName -Name "pipeline" -Force } $invalidNameError

Assert-ThrowsContains { Get-AzureDataFactoryHub -ResourceGroupName $rgName -DataFactoryName $dfName} $invalidNameError

Assert-ThrowsContains { New-AzureDataFactoryHub -ResourceGroupName $rgName -DataFactoryName $dfName -Name "hub" -File .\Resources\hub.json -Force } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactoryHub -ResourceGroupName $rgName -DataFactoryName $dfName -Name "hub" -Force } $invalidNameError

Assert-ThrowsContains { Set-AzureDataFactorySliceStatus -ResourceGroupName $rgName -DataFactoryName $rgName -TableName "table" -StartDateTime "2015-01-01" -Status PendingExecution } $invalidNameError

Assert-ThrowsContains { Suspend-AzureDataFactoryPipeline -ResourceGroupName $rgName -DataFactoryName $rgName -Name "pipeline" -Force } $invalidNameError

Assert-ThrowsContains { Resume-AzureDataFactoryPipeline -ResourceGroupName $rgName -DataFactoryName $rgName -Name "pipeline" -Force } $invalidNameError

Assert-ThrowsContains { Set-AzureDataFactoryPipelineActivePeriod -ResourceGroupName $rgName -DataFactoryName $rgName -PipelineName "pipeline" -StartDateTime "2015-01-01" -Force } $invalidNameError

$password = ConvertTo-SecureString "password" -AsPlainText -Force
Assert-ThrowsContains { New-AzureDataFactoryEncryptValue -ResourceGroupName $rgName -DataFactoryName $dfName -Value $password } $invalidNameError

Assert-ThrowsContains { Save-AzureDataFactoryLog -ResourceGroupName $rgName -DataFactoryName $dfName -Id "id" } $invalidNameError
}

<#
.SYNOPSIS
Test naming restriction support.
#>
function Test-InvalidDataFactoryName
{
Assert-ThrowsContains { Get-AzureDataFactory -ResourceGroupName "adf" -Name "adf_invalidname" } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactory -ResourceGroupName "adf" -Name "datafactorynameistolongdatafactorynameistolongdatafactorynameistolongdatafactorynameistolong" -Force } $invalidNameError

Assert-ThrowsContains { New-AzureDataFactory -ResourceGroupName "adf" -Name "adf+invalidname" -Location "westus" -Force } $invalidNameError

$password = ConvertTo-SecureString "password" -AsPlainText -Force
Assert-ThrowsContains { New-AzureDataFactoryEncryptValue -ResourceGroupName "adf" -DataFactoryName "adf+invalidname" -Value $password } $invalidNameError

Assert-ThrowsContains { Save-AzureDataFactoryLog -ResourceGroupName "adf" -DataFactoryName "adf+invalidname" -Id "id" } $invalidNameError
}

<#
.SYNOPSIS
Test naming restriction support.
#>
function Test-InvalidLinkedServiceName
{
Assert-ThrowsContains { Get-AzureDataFactoryLinkedService -ResourceGroupName "adf" -DataFactoryName "adf" -Name "linked.service" } $invalidNameError

Assert-ThrowsContains { New-AzureDataFactoryLinkedService -ResourceGroupName "adf" -DataFactoryName "adf" -Name "linked?service" -File .\Resources\linkedService.json -Force } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactoryLinkedService -ResourceGroupName "adf" -DataFactoryName "adf" -Name "linked%service" -Force } $invalidNameError
}

<#
.SYNOPSIS
Test naming restriction support.
#>
function Test-InvalidTableName
{
Assert-ThrowsContains { Get-AzureDataFactoryTable -ResourceGroupName "adf" -DataFactoryName "adf" -Name "table+" } $invalidNameError

Assert-ThrowsContains { New-AzureDataFactoryTable -ResourceGroupName "adf" -DataFactoryName "adf" -Name "table&" -File .\Resources\table.json -Force } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactoryTable -ResourceGroupName "adf" -DataFactoryName "adf" -Name "table>" -Force } $invalidNameError

Assert-ThrowsContains { Set-AzureDataFactorySliceStatus -ResourceGroupName "adf" -DataFactoryName "adf" -TableName "table<" -StartDateTime "2015-01-01" -Status PendingExecution } $invalidNameError
}

<#
.SYNOPSIS
Test naming restriction support.
#>
function Test-InvalidPipelineName
{
Assert-ThrowsContains { Get-AzureDataFactoryPipeline -ResourceGroupName "adf" -DataFactoryName "adf" -Name "pipeline&" } $invalidNameError

Assert-ThrowsContains { New-AzureDataFactoryPipeline -ResourceGroupName "adf" -DataFactoryName "adf" -Name "pipeline\\" -File .\Resources\pipeline.json -Force } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactoryPipeline -ResourceGroupName "adf" -DataFactoryName "adf" -Name "pipeline<" -Force } $invalidNameError

Assert-ThrowsContains { Suspend-AzureDataFactoryPipeline -ResourceGroupName "adf" -DataFactoryName "adf" -Name "pipeline<" -Force } $invalidNameError

Assert-ThrowsContains { Resume-AzureDataFactoryPipeline -ResourceGroupName "adf" -DataFactoryName "adf" -Name "pipeline<" -Force } $invalidNameError

Assert-ThrowsContains { Set-AzureDataFactoryPipelineActivePeriod -ResourceGroupName "adf" -DataFactoryName "adf" -PipelineName "pipeline<" -StartDateTime "2015-01-01" -Force } $invalidNameError
}

<#
.SYNOPSIS
Test naming restriction support.
#>
function Test-InvalidHubName
{
Assert-ThrowsContains { Get-AzureDataFactoryHub -ResourceGroupName "adf" -DataFactoryName "adf" -Name "hub&" } $invalidNameError

Assert-ThrowsContains { New-AzureDataFactoryHub -ResourceGroupName "adf" -DataFactoryName "adf" -Name "hub\\" -File .\Resources\hub.json -Force } $invalidNameError

Assert-ThrowsContains { Remove-AzureDataFactoryHub -ResourceGroupName "adf" -DataFactoryName "adf" -Name "hub<" -Force } $invalidNameError
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"Entries": [
{
"RequestUri": "/subscriptions/8d88dc98-ab0c-4b80-825b-123b2cf8443c/providers/Microsoft.DataFactory/register?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOGQ4OGRjOTgtYWIwYy00YjgwLTgyNWItMTIzYjJjZjg0NDNjL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUZhY3RvcnkvcmVnaXN0ZXI/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "POST",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"id\": \"/subscriptions/8d88dc98-ab0c-4b80-825b-123b2cf8443c/providers/Microsoft.DataFactory\",\r\n \"namespace\": \"Microsoft.DataFactory\",\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"dataFactories\",\r\n \"locations\": [\r\n \"West US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2014-05-01-preview\",\r\n \"2014-07-01-preview\",\r\n \"2014-08-01-preview\",\r\n \"2014-09-01-preview\",\r\n \"adfgated1\",\r\n \"adfgated2\",\r\n \"adfgated3\",\r\n \"adfgated4\",\r\n \"adfgated5\",\r\n \"adfgated6\",\r\n \"adfbqupgrade\",\r\n \"2014-04-01\",\r\n \"2014-10-01-preview\",\r\n \"2014-12-01-preview\",\r\n \"2015-01-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dataFactories/diagnosticSettings\",\r\n \"locations\": [\r\n \"East US\",\r\n \"East US 2\",\r\n \"North Central US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"Brazil South\",\r\n \"West US\",\r\n \"Central US\",\r\n \"South Central US\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"East Asia\",\r\n \"Southeast Asia\"\r\n ],\r\n \"apiVersions\": [\r\n \"2014-04-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dataFactories/metricDefinitions\",\r\n \"locations\": [\r\n \"East US\",\r\n \"East US 2\",\r\n \"North Central US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"Brazil South\",\r\n \"West US\",\r\n \"Central US\",\r\n \"South Central US\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"East Asia\",\r\n \"Southeast Asia\"\r\n ],\r\n \"apiVersions\": [\r\n \"2014-04-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"checkDataFactoryNameAvailability\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2014-09-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"activityTypes\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2015-01-01-preview\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registering\"\r\n}",
"ResponseHeaders": {
"Content-Length": [
"1242"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-writes": [
"1195"
],
"x-ms-request-id": [
"83732d58-3733-443b-9848-f0e46c59a881"
],
"x-ms-correlation-request-id": [
"83732d58-3733-443b-9848-f0e46c59a881"
],
"x-ms-routing-request-id": [
"CENTRALUS:20150115T012300Z:83732d58-3733-443b-9848-f0e46c59a881"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Thu, 15 Jan 2015 01:23:00 GMT"
]
},
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "8d88dc98-ab0c-4b80-825b-123b2cf8443c"
}
}
Loading