Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2560574
Intial rework.
tjprescott May 4, 2016
9b2caab
Much closer to completion!
tjprescott May 5, 2016
582aa54
Finally storage works again!!!!!!
tjprescott May 5, 2016
ff3ea55
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 5, 2016
4b53467
Merge branch 'AddResourceGroupCommand' of https://github.com/tjpresco…
tjprescott May 5, 2016
45f2beb
Fix resource group commands
tjprescott May 5, 2016
cb30be5
Progress porting VM commands away from decorator-style.
tjprescott May 5, 2016
ac5f3a8
Updates to work with "patches vm" commands and VM create command.
tjprescott May 5, 2016
7b3f45b
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 5, 2016
4b73df7
Progress on converting network.
tjprescott May 5, 2016
36fafe3
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 5, 2016
c3402dd
Fix issue with LRO attempting to execute twice.
tjprescott May 6, 2016
7556884
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 6, 2016
d64fc6c
Fixed issues with VM conversion. All tests re-run and re-recorded.
tjprescott May 6, 2016
bc0229f
Rename AutoCommandDefintion to just CommandDefinition
tjprescott May 6, 2016
b05dd0c
Convert component package to semi-auto
tjprescott May 6, 2016
055d9c5
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 6, 2016
ca6cfa2
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 6, 2016
4652170
Fix import error.
tjprescott May 6, 2016
c87b004
Convert profile package.
tjprescott May 6, 2016
4521a41
Convert task help and clean up.
tjprescott May 6, 2016
05085ee
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 6, 2016
4f60b0d
Progress on resource group scenario tests and test framework enhancem…
tjprescott May 9, 2016
19c7998
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 9, 2016
55761a7
Import Derek's test enhancements and fixes.
tjprescott May 9, 2016
949fc75
Merge Yugang's changes to VM
tjprescott May 9, 2016
ec1ca8b
Post merge fixes.
tjprescott May 9, 2016
e7a9f3a
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 9, 2016
d3308a2
Pylint fixes.
tjprescott May 9, 2016
81cb325
Make storage tests fully automatic.
tjprescott May 9, 2016
ec37436
Update VM test cassettes.
tjprescott May 9, 2016
3fbf53d
Code review comments.
tjprescott May 9, 2016
ada85dc
Fix _vm_get so client only required if vm_name and resource_group pro…
tjprescott May 9, 2016
94fa3f9
Code review comments.
tjprescott May 10, 2016
28cc5ac
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 10, 2016
c33abe5
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott May 10, 2016
0acd909
Re-record a couple VM tests.
tjprescott May 10, 2016
122ef11
Move help entry to dedicated file.
tjprescott May 10, 2016
f91b517
PYLINT!
tjprescott May 10, 2016
dae6b5b
Eliminate duplicate test statement.
tjprescott May 10, 2016
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
Prev Previous commit
Next Next commit
Make storage tests fully automatic.
  • Loading branch information
tjprescott committed May 9, 2016
commit 81cb3252c95a2e6a9e8769161aab90db1a43cbb5
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,26 @@ def test_body(self):
s.test('storage account check-name --name teststorageomega', {'nameAvailable': True})
s.test('storage account check-name --name {}'.format(account),
{'nameAvailable': False, 'reason': 'AlreadyExists'})
s.rec('storage account list -g {}'.format(rg))
s.test('storage account list -g {}'.format(rg),
{'name': account, 'accountType': 'Standard_LRS', 'location': 'westus', 'resourceGroup': rg})
s.test('storage account show --resource-group {} --account-name {}'.format(rg, account),
{'name': account, 'accountType': 'Standard_LRS', 'location': 'westus', 'resourceGroup': rg})
s.rec('storage account show-usage')
s.rec('storage account connection-string -g {} --account-name {} --use-http'.format(rg, account))
s.rec('storage account keys list -g {} --account-name {}'.format(rg, account))
s.rec('storage account keys renew -g {} --account-name {}'.format(rg, account))
s.rec('storage account keys renew -g {} --account-name {} --key key2'.format(rg, account))
s.test('storage account show-usage', {'name': {'value': 'StorageAccounts'}})
cs = s.run('storage account connection-string -g {} --account-name {} --use-http'.format(rg, account))
assert 'https' not in cs
assert account in cs
keys = json.loads(s.run('storage account keys list -g {} --account-name {} -o json'.format(rg, account)))
key1 = keys['key1']
key2 = keys['key2']
assert key1 and key2
keys = json.loads(s.run('storage account keys renew -g {} --account-name {} -o json'.format(rg, account)))
assert key1 != keys['key1']
key1 = keys['key1']
assert key2 != keys['key2']
key2 = keys['key2']
keys = json.loads(s.run('storage account keys renew -g {} --account-name {} --key key2 -o json'.format(rg, account)))
assert key1 == keys['key1']
assert key2 != keys['key2']
s.test('storage account set -g {} -n {} --tags foo=bar;cat'.format(rg, account),
{'tags': {'cat':'', 'foo':'bar'}})
# TODO: This should work like other tag commands--no value to clear
Expand Down Expand Up @@ -110,7 +122,12 @@ def _storage_blob_scenario(self):
new_lease_id = s.new_lease_id
date = s.date

s.rec('storage blob service-properties show')
s.test('storage blob service-properties show', {
'cors': [],
'hourMetrics': {'enabled': True},
'logging': {'delete': False},
'minuteMetrics': {'enabled': False}
})

# test block blob upload
s.run('storage blob upload -b {} -c {} --type block --upload-from {}'.format(block_blob, container, os.path.join(TEST_DIR, 'testfile.rst')))
Expand All @@ -133,7 +150,11 @@ def _storage_blob_scenario(self):
s.run('storage blob metadata set -b {} -c {}'.format(blob, container))
s.test('storage blob metadata show -b {} -c {}'.format(blob, container), None)

s.rec('storage blob list --container-name {}'.format(container))
res = json.loads(s.run('storage blob list --container-name {} -o json'.format(container)))['items']
blob_list = [block_blob, append_blob, page_blob]
for item in res:
assert item['name'] in blob_list

s.test('storage blob show --container-name {} --blob-name {}'.format(container, block_blob),
{'name': block_blob, 'properties': {'blobType': 'BlockBlob'}})
s.run('storage blob download -b {} -c {} --download-to {}'.format(blob, container, dest_file))
Expand Down Expand Up @@ -173,8 +194,11 @@ def test_body(self):
date = s.date
s.test('storage container create --container-name {} --fail-on-exist'.format(container), True)
s.test('storage container exists --container-name {}'.format(container), True)

s.test('storage container show --container-name {}'.format(container), {'name': container})
s.rec('storage container list')
res = json.loads(s.run('storage container list -o json'))['items']
assert container in [x['name'] for x in res]

s.run('storage container metadata set -c {} --metadata foo=bar;moo=bak;'.format(container))
s.test('storage container metadata show -c {}'.format(container), {'foo': 'bar', 'moo': 'bak'})
s.run('storage container metadata set -c {}'.format(container)) # reset metadata
Expand Down Expand Up @@ -271,7 +295,9 @@ def _storage_file_scenario(self, share):
file_url = 'https://{}.file.core.windows.net/{}/{}'.format(STORAGE_ACCOUNT_NAME, share, filename)
s.test('storage file url -s {} --file-name {}'.format(share, filename), file_url)

s.rec('storage share contents --share-name {}'.format(share))
res = [x['name'] for x in json.loads(s.run('storage share contents --share-name {} -o json'.format(share)))['items']]
assert filename in res

s.run('storage file delete --share-name {} --file-name {}'.format(share, filename))
s.test('storage file exists --share-name {} --file-name {}'.format(share, filename), False)

Expand All @@ -289,7 +315,10 @@ def _storage_file_in_subdir_scenario(self, share, dir):
os.remove(dest_file)
else:
io.print_('\nDownload failed. Test failed!')
s.rec('storage share contents --share-name {} --directory-name {}'.format(share, dir))

res = [x['name'] for x in json.loads(s.run('storage share contents --share-name {} --directory-name {} -o json'.format(share, dir)))['items']]
assert filename in res

s.test('storage share stats -s {}'.format(share), "1")
s.run('storage file delete --share-name {} --directory-name {} --file-name {}'.format(share, dir, filename))
s.test('storage file exists --share-name {} --file-name {}'.format(share, filename), False)
Expand All @@ -302,7 +331,9 @@ def test_body(self):
s.test('storage share create --share-name {} --fail-on-exist --metadata foo=bar;cat=hat'.format(share2), True)
s.test('storage share exists --share-name {}'.format(share1), True)
s.test('storage share metadata show --share-name {}'.format(share2), {'cat': 'hat', 'foo': 'bar'})
s.rec('storage share list')
res = [x['name'] for x in json.loads(s.run('storage share list -o json'))['items']]
assert share1 in res
assert share2 in res

# verify metadata can be set, queried, and cleared
s.run('storage share metadata set --share-name {} --metadata a=b;c=d'.format(share1))
Expand All @@ -316,7 +347,12 @@ def test_body(self):
self._storage_file_scenario(share1)
self._storage_directory_scenario(share1)

s.rec('storage file service-properties show')
s.test('storage file service-properties show', {
'cors': [],
'hourMetrics': {'enabled': True},
'minuteMetrics': {'enabled': False}
})


def tear_down(self):
self.run('storage share delete --share-name {} --fail-not-exist'.format(self.share1))
Expand Down
Loading