Skip to content

Revert "adding cmdlets for edge storage account and edge storage container" #10796

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/DataBoxEdge/DataBoxEdge.Test/DataBoxEdge.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.DataBoxEdge" Version="1.0.0" />
<PackageReference Include="Microsoft.Azure.Management.EdgeGateway" Version="0.8.1-preview" />
</ItemGroup>

</Project>
59 changes: 21 additions & 38 deletions src/DataBoxEdge/DataBoxEdge.Test/ScenarioTests/Common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,79 +15,62 @@

<#
.SYNOPSIS
Gets valid resource group name
Gets valid Device Connection String
#>
function Get-DeviceResourceGroupName
{
return "psrgpfortest"
}

<#
.SYNOPSIS
Gets valid resource name
#>
function Get-DeviceName
function Get-DeviceConnectionString
{
return "psddataboxedgecan"
return "";
}

<#
.SYNOPSIS
Gets valid resource name
Gets valid IOT Device Connection String
#>
function Get-VaultName
function Get-IotDeviceConnectionString
{
return "azpsdbe"
return "";
}


<#
.SYNOPSIS
Gets valid Device Connection String
#>

function Get-DeviceConnectionString
Returns Userpassword used for password
Gets valid resource group name
#>
function Get-Userpassword
{
$vaultName = Get-VaultName
$val = Get-AzKeyVaultSecret -VaultName $vaultName -Name "DeviceConnectionString"
return $val.SecretValue
return "";
}

<#
.SYNOPSIS
Gets valid IOT Device Connection String
Returns standard EncryptionKey
#>
function Get-IotDeviceConnectionString
function Get-EncryptionKey
{
$vaultName = Get-VaultName
$val = Get-AzKeyVaultSecret -VaultName $vaultName -Name "IotDeviceConnectionString"
return $val.SecretValue
$encryptionKey = ConvertTo-SecureString -String ""
return $encryptionKey
}

<#
.SYNOPSIS
Returns Userpassword used for password
Gets valid resource group name
#>
function Get-Userpassword
#>
function Get-DeviceResourceGroupName
{
$vaultName = Get-VaultName
$val = Get-AzKeyVaultSecret -VaultName $vaultName -Name "UserPassword"
return $val.SecretValue
return "psrgpfortest"
}

<#
.SYNOPSIS
Returns standard EncryptionKey
Gets valid resource name
#>
function Get-EncryptionKey
function Get-DeviceName
{
$val = "faked"
return ConvertTo-SecureString $val -AsPlainText -Force
return "psdataboxedgedevice"
}



function Get-StringHash([String] $String,$HashName = "MD5")
{
$StringBuilder = New-Object System.Text.StringBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,16 @@ function Test-CreateRole
$rgname = Get-DeviceResourceGroupName
$dfname = Get-DeviceName
$name = Get-RoleName
$deviceConnSec = Get-DeviceConnectionString
$iotDeviceConnSec = Get-IotDeviceConnectionString
$encryptionKey = Get-EncryptionKey


$deviceConnectionString = Get-DeviceConnectionString
$deviceConnSec = ConvertTo-SecureString $deviceConnectionString -AsPlainText -Force

$iotDeviceConnectionString = Get-IotDeviceConnectionString
$iotDeviceConnSec = ConvertTo-SecureString $iotDeviceConnectionString -AsPlainText -Force

$encryptionKeyString = Get-EncryptionKey
$encryptionKey = ConvertTo-SecureString $encryptionKeyString -AsPlainText -Force

$enabled = "Enabled"
$platform = "Windows"
# Test
Expand All @@ -68,10 +74,17 @@ function Test-RemoveRole
$rgname = Get-DeviceResourceGroupName
$dfname = Get-DeviceName
$name = Get-RoleName
$deviceConnSec = Get-DeviceConnectionString
$iotDeviceConnSec = Get-IotDeviceConnectionString
$encryptionKey = Get-EncryptionKey


$deviceConnectionString = Get-DeviceConnectionString
$deviceConnSec = ConvertTo-SecureString $deviceConnectionString -AsPlainText -Force

$iotDeviceConnectionString = Get-IotDeviceConnectionString
$iotDeviceConnSec = ConvertTo-SecureString $iotDeviceConnectionString -AsPlainText -Force

$encryptionKeyString = Get-EncryptionKey
$encryptionKey = ConvertTo-SecureString $encryptionKeyString -AsPlainText -Force

$enabled = "Enabled"
$platform = "Windows"
# Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using System.IO;
using System.Linq;
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Management.DataBoxEdge;
using Microsoft.Azure.Management.EdgeGateway;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
Expand Down Expand Up @@ -46,7 +46,18 @@ protected DataBoxEdgeScenarioTestBase()
public static DataBoxEdgeScenarioTestBase NewInstance => new DataBoxEdgeScenarioTestBase();



protected void SetupManagementClients(MockContext context)
{
var dataBoxEdgeManagementClient = GetDataBoxEdgeManagementClient(context);
var resourceManagementClient = GetResourceManagementClient(context);
var storageManagementClient = GetStorageManagementClient(context);

_helper.SetupManagementClients(
dataBoxEdgeManagementClient,
resourceManagementClient,
storageManagementClient);
}

/// <summary>
/// Methods for invoking PowerShell scripts
/// </summary>
Expand Down Expand Up @@ -93,18 +104,17 @@ private void RunPsTestWorkflow(
{
SetupManagementClients(context);

_helper.SetupEnvironment(AzureModule.AzureResourceManager);
var azDBPath = _helper.GetRMModulePath("Az.DataBoxEdge.psd1");
var callingClassName =
callingClassType.Split(new[] {"."}, StringSplitOptions.RemoveEmptyEntries).Last();

var azDBEPath = _helper.GetRMModulePath("Az.DataBoxEdge.psd1");
_helper.SetupModules(AzureModule.AzureResourceManager,
_helper.RMProfileModule,
azDBEPath,
"ScenarioTests\\Common.ps1",
"ScenarioTests\\" + callingClassName + ".ps1",
"AzureRM.Storage.ps1",
"AzureRM.Resources.ps1");

_helper.RMProfileModule,
azDBPath,
"AzureRM.Resources.ps1",
"AzureRM.Storage.ps1");
try
{
var psScripts = scriptBuilder?.Invoke();
Expand All @@ -120,20 +130,6 @@ private void RunPsTestWorkflow(
}
}


protected void SetupManagementClients(MockContext context)
{
var dataBoxEdgeManagementClient = GetDataBoxEdgeManagementClient(context);
var resourceManagementClient = GetResourceManagementClient(context);
var storageManagementClient = GetStorageManagementClient(context);

_helper.SetupManagementClients(
dataBoxEdgeManagementClient,
resourceManagementClient,
storageManagementClient);
}


protected DataBoxEdgeManagementClient GetDataBoxEdgeManagementClient(MockContext context)
{
return context.GetServiceClient<DataBoxEdgeManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function Test-CreateShare


$staname = Get-StorageAccountCredentialName
$encryptionKey = Get-EncryptionKey
$encryptionKeyString = Get-EncryptionKey
$encryptionKey = ConvertTo-SecureString $encryptionKeyString -AsPlainText -Force
$storageAccountType = 'GeneralPurposeStorage'
$storageAccountSkuName = 'Standard_LRS'
$storageAccountLocation = 'WestUS'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ function Test-CreateStorageAccountCredential
$rgname = Get-DeviceResourceGroupName
$dfname = Get-DeviceName
$staname = Get-StorageAccountCredentialName
$encryptionKey = Get-EncryptionKey

$encryptionKeyString = Get-EncryptionKey
$encryptionKey = ConvertTo-SecureString $encryptionKeyString -AsPlainText -Force

$storageAccountType = 'GeneralPurposeStorage'
$storageAccountSkuName = 'Standard_LRS'
$storageAccountLocation = 'WestUS'
Expand Down Expand Up @@ -71,8 +72,9 @@ function Test-RemoveStorageAccountCredential
{
$rgname = Get-DeviceResourceGroupName
$dfname = Get-DeviceName
$staname = Get-StorageAccountCredentialName
$encryptionKey = Get-EncryptionKey
$staname = Get-StorageAccountCredentialName
$encryptionKeyString = Get-EncryptionKey
$encryptionKey = ConvertTo-SecureString $encryptionKeyString -AsPlainText -Force

$storageAccountType = 'GeneralPurposeStorage'
$storageAccountSkuName = 'Standard_LRS'
Expand Down

This file was deleted.

Loading