Skip to content
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

[Storage] Support NFS and SmbMultichannel #15130

Merged
merged 3 commits into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ public void TestShareSoftDeletee()
public void TestShareSnapshot()
{
TestController.NewInstance.RunPsTest(_logger, "Test-ShareSnapshot");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestFileServiceProperties()
{
TestController.NewInstance.RunPsTest(_logger, "Test-FileServiceProperties");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAzureStorageShareNFS()
{
TestController.NewInstance.RunPsTest(_logger, "Test-AzureStorageShareNFS");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -358,4 +358,103 @@ function Test-ShareSnapshot
}
}

<#
.SYNOPSIS
Test Storage File Service Properties
.DESCRIPTION
SmokeTest
#>
function Test-FileServiceProperties
{
# Setup
$rgname = Get-StorageManagementTestResourceName;

try
{
# Test
$stoname = 'sto' + $rgname;
$stotype = 'Premium_LRS';
$loc = Get-ProviderLocation_Canary2 ResourceManagement;
$kind = 'FileStorage'

Write-Verbose "RGName: $rgname | Loc: $loc"
New-AzResourceGroup -Name $rgname -Location $loc;

# $loc = Get-ProviderLocation_Canary ResourceManagement;
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind
$stos = Get-AzStorageAccount -ResourceGroupName $rgname;

# Enable MC, and set smb setting
Update-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname -EnableSmbMultichannel $true
$servicePropertie = Get-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname
Assert-AreEqual $true $servicePropertie.ProtocolSettings.Smb.Multichannel.Enabled

# Disable MC, update smb setting
Update-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname -EnableSmbMultichannel $false
$servicePropertie = Get-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname
Assert-AreEqual $false $servicePropertie.ProtocolSettings.Smb.Multichannel.Enabled

Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname;
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test Azure storage share with NFS
.DESCRIPTION
Smoke[Broken]Test
#>
function Test-AzureStorageShareNFS
{
# Setup
$rgname = Get-StorageManagementTestResourceName;

try
{
# Test
$stoname = 'sto' + $rgname;
$stotype = 'Premium_LRS';
$kind = 'FileStorage'

$loc = Get-ProviderLocation ResourceManagement;
New-AzResourceGroup -Name $rgname -Location $loc;

New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind;
$sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname;
Assert-AreEqual $stoname $sto.StorageAccountName;
Assert-AreEqual $stotype $sto.Sku.Name;
Assert-AreEqual $kind $sto.Kind;


$shareName = "share"+ $rgname
$sto | New-AzRmStorageShare -Name $shareName -EnabledProtocol NFS -RootSquash RootSquash
$share = $sto | Get-AzRmStorageShare -Name $shareName
Assert-AreEqual $rgname $share.ResourceGroupName
Assert-AreEqual $stoname $share.StorageAccountName
Assert-AreEqual $shareName $share.Name
Assert-AreEqual "NFS" $share.EnabledProtocols
Assert-AreEqual "RootSquash" $share.RootSquash

Update-AzRmStorageShare -ResourceGroupName $rgname -StorageAccountName $stoname -Name $shareName -RootSquash NoRootSquash
$share = $sto | Get-AzRmStorageShare -Name $shareName
Assert-AreEqual $rgname $share.ResourceGroupName
Assert-AreEqual $stoname $share.StorageAccountName
Assert-AreEqual $shareName $share.Name
Assert-AreEqual "NFS" $share.EnabledProtocols
Assert-AreEqual "NoRootSquash" $share.RootSquash

Retry-IfException { Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname; }
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}


Large diffs are not rendered by default.

Loading