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

Nfsaas 2102 update to r3 5 #34

Merged
merged 7 commits into from
Apr 8, 2019
Merged
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/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@
"summary": "Provides a preview for upcoming Azure NetApp Files (ANF) features.",
"version": "0.2.0"
},
"sha256Digest": "9b3fdfc6ada7ba058585b9edeb0fb51b23e22cd73f8771f2f25d9b1fda751525"
"sha256Digest": "f0078a9f03416066abc21d6103bb9ddb9cbfb5a994054e1b2280ab89a61116a0"
}
],
"privatedns": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from knack.util import CLIError
from msrest.exceptions import ValidationError # pylint: disable=import-error


def netapp_exception_handler(ex):
from azext_netappfiles_preview.vendored_sdks.models import ErrorException

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@

# No tidy up of tests required. The resource group is automatically removed


class AzureNetAppFilesExtAccountServiceScenarioTest(ScenarioTest):
@ResourceGroupPreparer(name_prefix='cli_tests_rg_')
def test_ext_create_delete_account(self):
account_name = self.create_random_name(prefix='cli', length=24)
tags = 'Tag1=Value1 Tag2=Value2'
active_directories = '[{"username": "aduser", "password": "aduser", "smbservername": "SMBSERVER", "dns": "1.2.3.4", "domain": "westcentralus"}]'
# active_directories = '[{"username": "aduser", "password": "aduser", "smbservername": "SMBSERVER", "dns": "1.2.3.4", "domain": "westcentralus"}]'

# create and check
#account = self.cmd("az netappfiles account create --resource-group {rg} --account-name '%s' -l 'westus2' --tags '%s' --active-directories %s" % (account_name, tags, active_directories)).get_output_in_json()
# account = self.cmd("az netappfiles account create --resource-group {rg} --account-name '%s' -l 'westus2' --tags '%s' --active-directories %s" % (account_name, tags, active_directories)).get_output_in_json()

account = self.cmd("az netappfiles account create --resource-group {rg} --account-name '%s' -l 'westus2' --tags '%s'" % (account_name, tags)).get_output_in_json()
assert account['name'] == account_name
assert account['tags']['Tag1'] == 'Value1'
assert account['tags']['Tag2'] == 'Value2'
# not provided in call - interpreted as kwargs. Tested at command line instead.
#assert account['active_directories'][0]['username'] == 'aduser'
#assert account['active_directories'][0]['smbservername'] == 'SMBSERVER'
# assert account['active_directories'][0]['username'] == 'aduser'
# assert account['active_directories'][0]['smbservername'] == 'SMBSERVER'

account_list = self.cmd("netappfiles account list --resource-group {rg}").get_output_in_json()
assert len(account_list) > 0
Expand All @@ -36,7 +38,8 @@ def test_ext_create_delete_account(self):
account = self.cmd("az netappfiles account create -g {rg} -a %s -l westus2 --tags '%s'" % (account_name, tags)).get_output_in_json()
assert account['name'] == account_name
# note: key case must match
assert account['activeDirectories'] == None
assert account['activeDirectories'] is None

account_list = self.cmd("netappfiles account list --resource-group {rg}").get_output_in_json()
assert len(account_list) > 0

Expand Down Expand Up @@ -79,7 +82,7 @@ def test_ext_set_account_ext(self):
account = self.cmd("az netappfiles account set --resource-group {rg} -a %s -l 'westus2' --tags %s" % (account_name, tag)).get_output_in_json()
assert account['name'] == account_name
assert account['tags']['Tag1'] == 'Value1'
assert account['activeDirectories'] == None
assert account['activeDirectories'] is None

@ResourceGroupPreparer(name_prefix='cli_tests_rg_')
def test_ext_update_account_ext(self):
Expand All @@ -91,4 +94,4 @@ def test_ext_update_account_ext(self):
account = self.cmd("az netappfiles account update --resource-group {rg} -a %s --tags %s -l westus2" % (account_name, tag)).get_output_in_json()
assert account['name'] == account_name
assert account['tags']['Tag1'] == 'Value1'
assert account['activeDirectories'] == None
assert account['activeDirectories'] is None
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_ext_create_delete_volumes(self):
assert volume['tags']['Tag2'] == 'Value2'
# default export policy still present
assert volume['exportPolicy']['rules'][0]['allowedClients'] == '0.0.0.0/0'
assert volume['exportPolicy']['rules'][0]['cifs'] == False
assert not volume['exportPolicy']['rules'][0]['cifs']
assert volume['exportPolicy']['rules'][0]['ruleIndex'] == 1

volume_list = self.cmd("netappfiles volume list --resource-group {rg} --account-name %s --pool-name %s" % (account_name, pool_name)).get_output_in_json()
Expand Down Expand Up @@ -113,5 +113,5 @@ def test_ext_update_volume(self):
assert volume['tags']['Tag1'] == 'Value2'
# default export policy still present
assert volume['exportPolicy']['rules'][0]['allowedClients'] == '0.0.0.0/0'
assert volume['exportPolicy']['rules'][0]['cifs'] == False
assert not volume['exportPolicy']['rules'][0]['cifs']
assert volume['exportPolicy']['rules'][0]['ruleIndex'] == 1