Skip to content

Az.Ssh Preview 2 #3

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
72 changes: 72 additions & 0 deletions src/Ssh/Backup/Ssh.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31702.278
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ssh", "Ssh\Ssh.csproj", "{42656543-77AD-4968-BA4B-BE0778705625}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{F12822FD-CE14-4C35-80CC-5094C82955C9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{3E016018-D65D-4336-9F64-17DA97783AD0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScenarioTest.ResourceManager", "..\..\tools\ScenarioTest.ResourceManager\ScenarioTest.ResourceManager.csproj", "{F83FBA8D-732D-437C-A0E2-02E45B01E123}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFx", "..\..\tools\TestFx\TestFx.csproj", "{BC80A1D0-FFA4-43D9-AA74-799F5CB54B58}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ssh.Helpers", "Ssh.Helpers\Ssh.Helpers.csproj", "{CB857704-977C-40BB-880E-C6ADDDBE2AD1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ssh.Test", "Ssh.Test\Ssh.Test.csproj", "{D7433FFA-1008-4C8E-8E64-3419D20BDCCC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{42656543-77AD-4968-BA4B-BE0778705625}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42656543-77AD-4968-BA4B-BE0778705625}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42656543-77AD-4968-BA4B-BE0778705625}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42656543-77AD-4968-BA4B-BE0778705625}.Release|Any CPU.Build.0 = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Release|Any CPU.Build.0 = Release|Any CPU
{F12822FD-CE14-4C35-80CC-5094C82955C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F12822FD-CE14-4C35-80CC-5094C82955C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F12822FD-CE14-4C35-80CC-5094C82955C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F12822FD-CE14-4C35-80CC-5094C82955C9}.Release|Any CPU.Build.0 = Release|Any CPU
{3E016018-D65D-4336-9F64-17DA97783AD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E016018-D65D-4336-9F64-17DA97783AD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E016018-D65D-4336-9F64-17DA97783AD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E016018-D65D-4336-9F64-17DA97783AD0}.Release|Any CPU.Build.0 = Release|Any CPU
{F83FBA8D-732D-437C-A0E2-02E45B01E123}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F83FBA8D-732D-437C-A0E2-02E45B01E123}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F83FBA8D-732D-437C-A0E2-02E45B01E123}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F83FBA8D-732D-437C-A0E2-02E45B01E123}.Release|Any CPU.Build.0 = Release|Any CPU
{BC80A1D0-FFA4-43D9-AA74-799F5CB54B58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC80A1D0-FFA4-43D9-AA74-799F5CB54B58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC80A1D0-FFA4-43D9-AA74-799F5CB54B58}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC80A1D0-FFA4-43D9-AA74-799F5CB54B58}.Release|Any CPU.Build.0 = Release|Any CPU
{CB857704-977C-40BB-880E-C6ADDDBE2AD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB857704-977C-40BB-880E-C6ADDDBE2AD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB857704-977C-40BB-880E-C6ADDDBE2AD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB857704-977C-40BB-880E-C6ADDDBE2AD1}.Release|Any CPU.Build.0 = Release|Any CPU
{D7433FFA-1008-4C8E-8E64-3419D20BDCCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7433FFA-1008-4C8E-8E64-3419D20BDCCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7433FFA-1008-4C8E-8E64-3419D20BDCCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7433FFA-1008-4C8E-8E64-3419D20BDCCC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F9B3D96E-9680-40BE-A917-02EE655D6030}
EndGlobalSection
EndGlobal
6 changes: 3 additions & 3 deletions src/Ssh/Ssh.Test/ScenarioTests/Common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ function RandomString([bool]$allChars, [int32]$len) {

function Get-RandomArcName
{
return 'arc-' + (RandomString -allChars $false -len 6)
return 'arc-' + (getAssetName)
}

function Get-RandomVmName
{
return 'vm-' + (RandomString -allChars $false -len 6)
return 'vm-' + (getAssetName)
}

function Get-RandomResourceGroupName
{
return 'rg-' + (RandomString -allChars $false -len 6)
return 'rg-' + (getAssetName)
}

function Get-PasswordForVM
Expand Down
4 changes: 2 additions & 2 deletions src/Ssh/Ssh.Test/ScenarioTests/GetAzSshConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public GetAzSshConfigTests(ITestOutputHelper output) : base(output)
}

[Fact]
[Trait(Category.AcceptanceType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetArcConfig()
{
TestRunner.RunTestScript("Test-GetArcConfig");
}

[Fact]
[Trait(Category.AcceptanceType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetVmConfig()
{
TestRunner.RunTestScript("Test-GetVmConfig");
Expand Down
5 changes: 4 additions & 1 deletion src/Ssh/Ssh.Test/ScenarioTests/GetAzSshConfigTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ function Test-GetVmConfig
{
$VmName = Get-RandomVmName
$ResourceGroupName = Get-RandomResourceGroupName
#$VmName = "myVM"
#$ResourceGroupName = "myRG"
$SubscriptionId = (Get-AzContext).Subscription.Id
$TenantId = (Get-AzContext).Tenant.Id

Expand All @@ -82,9 +84,10 @@ function Test-GetVmConfig

New-AzResourceGroup -Name $ResourceGroupName -Location "eastus" | Out-Null

$domainlabel = "d1" + $ResourceGroupName
try
{
$vm = New-AzVM -ResourceGroupName $ResourceGroupName -Name $VmName -Location "eastus" -Image UbuntuLTS -Credential $cred
$vm = New-AzVM -ResourceGroupName $ResourceGroupName -Name $VmName -Location "eastus" -Credential $cred -DomainNameLabel $domainlabel
Remove-Item ./config -ErrorAction Ignore

Assert-NotNull $vm
Expand Down
15 changes: 3 additions & 12 deletions src/Ssh/Ssh.Test/ScenarioTests/SshTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,11 @@ protected SshTestRunner(ITestOutputHelper output)
{
helper.RMProfileModule,
helper.GetRMModulePath("Az.Ssh.psd1"),
helper.GetRMModulePath("AzureRM.Compute.psd1")
helper.GetRMModulePath("Az.Compute.psd1"),
})
.WithNewRecordMatcherArguments(
userAgentsToIgnore: new Dictionary<string, string>
{
{"Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01"},
{"Microsoft.Azure.Management.ResourceManager.ResourceManagementClient", "2017-05-10"},
{"Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient", "2016-09-01"},
},
resourceProviders: new Dictionary<string, string>
{
{"Microsoft.Resources", null},
{"Microsoft.Compute", null},
}
userAgentsToIgnore: new Dictionary<string, string>(),
resourceProviders: new Dictionary<string, string>()
)
.Build();
}
Expand Down
Loading