Skip to content

Commit

Permalink
desktopvirtualization v0.1.0: modify test code to enable codegen end-…
Browse files Browse the repository at this point in the history
…to-end test (Azure#2145)

* version 0.1.1

* live run

* run in AzureCloud

* keep origin version since only test changed
  • Loading branch information
changlong-liu authored Aug 17, 2020
1 parent 9f8dd92 commit 16610a3
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 231 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,58 +11,13 @@
from azure.cli.testsdk.checkers import JMESPathCheck, JMESPathCheckExists


# EXAMPLE: /HostPools/put/HostPool_Create
def step__hostpools_put_hostpool_create(test, rg):
test.cmd('az desktopvirtualization hostpool create '
'--location "centralus" '
'--description "des1" '
'--friendly-name "friendly" '
'--host-pool-type "Pooled" '
'--load-balancer-type "BreadthFirst" '
'--max-session-limit 999999 '
'--personal-desktop-assignment-type "Automatic" '
'--registration-info expiration-time="2020-07-01T14:01:54.9571247Z" registration-token-operation="Update" '
''
'--sso-context "KeyVaultPath" '
'--tags tag1="value1" tag2="value2" '
'--name "{MyHostPool}" '
'--resource-group "{rg}"',
checks=[
# JMESPathCheckExists('[?name==\'{MyHostPool}\']'),
JMESPathCheck('name', test.kwargs["MyHostPool"]),
JMESPathCheck('tags.tag1', 'value1'),
JMESPathCheck('tags.tag2', 'value2'),
])


# EXAMPLE: /HostPools/get/HostPool_List
def step__hostpools_get_hostpool_list(test, rg):
test.cmd('az desktopvirtualization hostpool list '
'-g ""',
checks=[
JMESPathCheckExists('[?name==\'{}\']'.format(
test.kwargs["MyHostPool"])),
])


# EXAMPLE: /HostPools/patch/HostPool_Update
def step__hostpools_patch_hostpool_update(test, rg):
test.cmd('az desktopvirtualization hostpool update '
'--description "des1" '
'--friendly-name "friendly" '
'--load-balancer-type "BreadthFirst" '
'--max-session-limit 999999 '
'--personal-desktop-assignment-type "Automatic" '
'--registration-info expiration-time="2020-07-01T15:01:54.9571247Z" registration-token-operation="Update" '
''
'--sso-context "KeyVaultPath" '
'--tags tag1="value3" tag2="value4" '
'--name "{MyHostPool}" '
'--resource-group "{rg}"',
checks=[
JMESPathCheck('name', test.kwargs["MyHostPool"]),
JMESPathCheck('tags.tag1', 'value3'),
JMESPathCheck('tags.tag2', 'value4'),
test.kwargs["myHostPool"])),
])


Expand All @@ -74,12 +29,12 @@ def step__applicationgroups_put_applicationgroup_create(test, rg):
'--application-group-type "RemoteApp" '
'--friendly-name "friendly" '
'--host-pool-arm-path "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.DesktopVir'
'tualization/hostPools/{MyHostPool}" '
'tualization/hostPools/{myHostPool}" '
'--tags tag1="value1" tag2="value2" '
'--name "{MyApplicationGroup}" '
'--name "{myApplicationGroup}" '
'--resource-group "{rg}"',
checks=[
JMESPathCheck('name', test.kwargs["MyApplicationGroup"]),
JMESPathCheck('name', test.kwargs["myApplicationGroup"]),
JMESPathCheck('tags.tag1', 'value1'),
JMESPathCheck('tags.tag2', 'value2'),
])
Expand All @@ -92,7 +47,7 @@ def step__applicationgroups_get_applicationgroup_listbyresourcegroup(test, rg):
'--resource-group "{rg}"',
checks=[
JMESPathCheckExists('[?name==\'{}\']'.format(
test.kwargs["MyApplicationGroup"])),
test.kwargs["myApplicationGroup"])),
])


Expand All @@ -102,10 +57,10 @@ def step__applicationgroups_patch_applicationgroups_update(test, rg):
'--description "des1" '
'--friendly-name "friendly" '
'--tags tag1="value3" tag2="value4" '
'--name "{MyApplicationGroup}" '
'--name "{myApplicationGroup}" '
'--resource-group "{rg}"',
checks=[
JMESPathCheck('name', test.kwargs["MyApplicationGroup"]),
JMESPathCheck('name', test.kwargs["myApplicationGroup"]),
JMESPathCheck('tags.tag1', 'value3'),
JMESPathCheck('tags.tag2', 'value4'),
])
Expand All @@ -119,9 +74,9 @@ def step__workspaces_put_workspace_create(test, rg):
'--description "des1" '
'--friendly-name "friendly" '
'--tags tag1="value1" tag2="value2" '
'--name "{MyWorkspace}"',
'--name "{myWorkspace}"',
checks=[
JMESPathCheck('name', test.kwargs["MyWorkspace"]),
JMESPathCheck('name', test.kwargs["myWorkspace"]),
JMESPathCheck('tags.tag1', 'value1'),
JMESPathCheck('tags.tag2', 'value2'),
])
Expand All @@ -131,9 +86,9 @@ def step__workspaces_put_workspace_create(test, rg):
def step__workspaces_get_workspace_get(test, rg):
test.cmd('az desktopvirtualization workspace show '
'--resource-group "{rg}" '
'--name "{MyWorkspace}"',
'--name "{myWorkspace}"',
checks=[
JMESPathCheck('name', test.kwargs["MyWorkspace"]),
JMESPathCheck('name', test.kwargs["myWorkspace"]),
])


Expand All @@ -144,9 +99,9 @@ def step__workspaces_patch_workspace_update(test, rg):
'--description "des1" '
'--friendly-name "friendly" '
'--tags tag1="value3" tag2="value4" '
'--name "{MyWorkspace}"',
'--name "{myWorkspace}"',
checks=[
JMESPathCheck('name', test.kwargs["MyWorkspace"]),
JMESPathCheck('name', test.kwargs["myWorkspace"]),
JMESPathCheck('tags.tag1', 'value3'),
JMESPathCheck('tags.tag2', 'value4'),
])
Loading

0 comments on commit 16610a3

Please sign in to comment.