forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. add command: network front-door load-balancing update (Azure#2531)
2. add test scenarios for backend-pool, frontend-endpoint, load-balancing, probe and route-rule
Showing
15 changed files
with
5,482 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,177 changes: 1,177 additions & 0 deletions
1,177
src/front-door/azext_front_door/tests/latest/recordings/test_backend_pool_basic.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
400 changes: 400 additions & 0 deletions
400
src/front-door/azext_front_door/tests/latest/recordings/test_frontend_endpoint_basic.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
1,488 changes: 1,488 additions & 0 deletions
1,488
src/front-door/azext_front_door/tests/latest/recordings/test_load_balancing_basic.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
1,543 changes: 1,543 additions & 0 deletions
1,543
src/front-door/azext_front_door/tests/latest/recordings/test_probe_basic.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
892 changes: 673 additions & 219 deletions
892
src/front-door/azext_front_door/tests/latest/recordings/test_route_rule_basic.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
src/front-door/azext_front_door/tests/latest/test_backend_pool_scenarios.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) | ||
|
||
|
||
class BackendPoolScenarioTest(ScenarioTest): | ||
|
||
@ResourceGroupPreparer(location='westus') | ||
def test_backend_pool_basic(self, resource_group): | ||
self.kwargs.update({ | ||
'front_door': self.create_random_name('clifrontdoor', 20), | ||
'bkp1': 'bkp1', | ||
'lb1': 'lb1', | ||
'pb1': 'pb1' | ||
}) | ||
self.cmd('network front-door create -g {rg} -n {front_door} --backend-address 202.120.2.3') | ||
|
||
self.cmd('network front-door backend-pool create -f {front_door} -g {rg} -n {bkp1} ' | ||
'--address 202.120.2.3 ' | ||
'--load-balancing DefaultLoadBalancingSettings ' | ||
'--probe DefaultProbeSettings ', | ||
checks=[ | ||
self.check('backends[0].address', '202.120.2.3'), | ||
self.check('ends_with(loadBalancingSettings.id, `DefaultLoadBalancingSettings`)', True), | ||
self.check('ends_with(healthProbeSettings.id, `DefaultProbeSettings`)', True) | ||
]) | ||
|
||
self.cmd('network front-door backend-pool list -f {front_door} -g {rg} ', | ||
checks=[ | ||
self.check('length(@)', 2), | ||
]) | ||
self.cmd('network front-door backend-pool show -f {front_door} -g {rg} -n {bkp1} ') | ||
self.cmd('network front-door backend-pool delete -f {front_door} -g {rg} -n {bkp1} ') | ||
self.cmd('network front-door backend-pool list -f {front_door} -g {rg} ', | ||
checks=[ | ||
self.check('length(@)', 1), | ||
]) |
20 changes: 20 additions & 0 deletions
20
src/front-door/azext_front_door/tests/latest/test_frontend_endpoint_scenarios.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) | ||
|
||
|
||
class FrontendEndpointScenarioTests(ScenarioTest): | ||
|
||
@ResourceGroupPreparer(location='westus') | ||
def test_frontend_endpoint_basic(self, resource_group): | ||
self.kwargs.update({ | ||
'front_door': self.create_random_name('clifrontdoor', 20), | ||
}) | ||
self.cmd('network front-door create -g {rg} -n {front_door} --backend-address 202.120.2.3 ') | ||
self.cmd('network front-door frontend-endpoint list -f {front_door} -g {rg} ', | ||
checks=[ | ||
self.check('length(@)', 1), | ||
]) | ||
self.cmd('network front-door frontend-endpoint show -f {front_door} -g {rg} -n DefaultFrontendEndpoint ') |
44 changes: 44 additions & 0 deletions
44
src/front-door/azext_front_door/tests/latest/test_load_balancing_scenarios.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) | ||
|
||
|
||
class LoadBalancingScenarioTest(ScenarioTest): | ||
|
||
@ResourceGroupPreparer(location='westus') | ||
def test_load_balancing_basic(self, resource_group): | ||
self.kwargs.update({ | ||
'front_door': self.create_random_name('clifrontdoor', 20), | ||
'lb1': 'lb1' | ||
}) | ||
self.cmd('network front-door create -g {rg} -n {front_door} --backend-address 202.120.2.3') | ||
self.cmd('network front-door load-balancing create -f {front_door} -g {rg} -n {lb1} ' | ||
'--sample-size 5 ' | ||
'--successful-samples-required 1 ' | ||
'--additional-latency 100 ', | ||
checks=[ | ||
self.check('sampleSize', 5), | ||
self.check('successfulSamplesRequired', 1), | ||
self.check('additionalLatencyMilliseconds', 100), | ||
]) | ||
self.cmd('network front-door load-balancing update -f {front_door} -g {rg} -n {lb1} ' | ||
'--sample-size 4 ' | ||
'--successful-samples-required 2 ' | ||
'--additional-latency 10 ', | ||
checks=[ | ||
self.check('sampleSize', 4), | ||
self.check('successfulSamplesRequired', 2), | ||
self.check('additionalLatencyMilliseconds', 10), | ||
]) | ||
self.cmd('network front-door load-balancing list -f {front_door} -g {rg} ', | ||
checks=[ | ||
self.check('length(@)', 2), | ||
]) | ||
self.cmd('network front-door load-balancing show -f {front_door} -g {rg} -n {lb1} ') | ||
self.cmd('network front-door load-balancing delete -f {front_door} -g {rg} -n {lb1} ') | ||
self.cmd('network front-door load-balancing list -f {front_door} -g {rg} ', | ||
checks=[ | ||
self.check('length(@)', 1), | ||
]) |
52 changes: 52 additions & 0 deletions
52
src/front-door/azext_front_door/tests/latest/test_probe_scenarios.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) | ||
|
||
|
||
class ProbeScenarioTest(ScenarioTest): | ||
|
||
@ResourceGroupPreparer(location='westus') | ||
def test_probe_basic(self, resource_group): | ||
self.kwargs.update({ | ||
'front_door': self.create_random_name('clifrontdoor', 20), | ||
'pb1': 'pb1' | ||
}) | ||
self.cmd('network front-door create -g {rg} -n {front_door} --backend-address 202.120.2.3') | ||
self.cmd('network front-door probe create -f {front_door} -g {rg} -n {pb1} ' | ||
'--interval 100 ' | ||
'--path /abc ' | ||
'--enabled Disabled ' | ||
'--probeMethod GET ' | ||
'--protocol Http ', | ||
checks=[ | ||
self.check('intervalInSeconds', 100), | ||
self.check('path', '/abc'), | ||
self.check('enabledState', 'Disabled'), | ||
self.check('protocol', 'Http'), | ||
self.check('healthProbeMethod', 'Get'), | ||
]) | ||
self.cmd('network front-door probe update -f {front_door} -g {rg} -n {pb1} ' | ||
'--interval 10 ' | ||
'--path / ' | ||
'--enabled Enabled ' | ||
'--probeMethod HEAD ' | ||
'--protocol Https ', | ||
checks=[ | ||
self.check('intervalInSeconds', 10), | ||
self.check('path', '/'), | ||
self.check('enabledState', 'Enabled'), | ||
self.check('protocol', 'Https'), | ||
self.check('healthProbeMethod', 'HEAD'), | ||
]) | ||
self.cmd('network front-door probe list -f {front_door} -g {rg} ', | ||
checks=[ | ||
self.check('length(@)', 2), | ||
]) | ||
self.cmd('network front-door probe show -f {front_door} -g {rg} -n {pb1} ') | ||
self.cmd('network front-door probe delete -f {front_door} -g {rg} -n {pb1} ') | ||
self.cmd('network front-door probe list -f {front_door} -g {rg} ', | ||
checks=[ | ||
self.check('length(@)', 1), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters