Skip to content

Commit ef0c520

Browse files
author
Paul Breaux
committed
Functional test fixups for scale_up and scale_down.
1 parent 8eff9c0 commit ef0c520

3 files changed

Lines changed: 33 additions & 52 deletions

File tree

f5/multi_device/cluster/__init__.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,36 @@
4646
* ClusterManager -- manages a cluster of devices with the methods above
4747
* TrustDomain -- manages the trust domain for a cluster
4848
* DeviceGroup -- manages the device group for a cluster
49+
50+
Usage:
51+
52+
There are two major use-cases here:
53+
54+
* Manage an existing cluster:
55+
56+
list_of_bigips = [ManagementRoot(...), ManagementRoot(...)]
57+
cluster_mgr = ClusterManager(
58+
devices=list_of_bigips,
59+
device_group_name='my_cluster',
60+
device_group_type='sync-failover',
61+
device_group_partition='Common'
62+
)
63+
new_bigip_device = ManagementRoot(...)
64+
cluster_mgr.scale_up_by_one(new_bigip_device)
65+
list_of_bigips.append(new_bigip_device)
66+
assert cluster_mgr.cluster.devices == list_of_bigips
67+
68+
* Create a new cluster and manage it:
69+
70+
list_of_bigips = [ManagementRoot(...), ManagementRoot(...)]
71+
cluster_mgr = ClusterManager()
72+
cluster_mgr.create(
73+
devices=list_of_bigips,
74+
device_group_name='my_cluster',
75+
device_group_type='sync-failover',
76+
device_group_partition='Common
77+
)
78+
assert cluster_mgr.cluster.devices == list_of_bigips
4979
'''
5080

5181
from f5.sdk_exception import F5SDKError

f5/utils/mixins.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

test/functional/cluster/test_cluster.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,6 @@ def teardown_cluster():
7676
request.addfinalizer(teardown_cluster)
7777

7878

79-
def test_existing_failover_cluster(BigIPSetup):
80-
a, b, = BigIPSetup
81-
bigip_list = [a, b]
82-
83-
cm = ClusterManager(
84-
devices=bigip_list,
85-
device_group_name=DEVICE_GROUP_NAME,
86-
device_group_partition=PARTITION,
87-
device_group_type='sync-failover'
88-
)
89-
assert cm.cluster.devices == bigip_list
90-
assert cm.cluster.device_group_name == DEVICE_GROUP_NAME
91-
assert cm.cluster.device_group_type == 'sync-failover'
92-
assert cm.cluster.device_group_partition == PARTITION
93-
94-
9579
def test_new_failover_cluster_two_member(BigIPSetup):
9680
a, b, c = BigIPSetup
9781
bigip_list = [a, b]
@@ -143,7 +127,7 @@ def test_scale_up_sync_failover(BigIPSetup, ThreeBigIPTeardownSyncFailover):
143127
'device_group_partition': PARTITION,
144128
'device_group_type': 'sync-failover'}
145129
cm.create(**kwargs)
146-
cm.scale_up(c)
130+
cm.scale_up_by_one(c)
147131

148132

149133
def test_scale_up_down_up_down_sync_failover(
@@ -157,5 +141,5 @@ def test_scale_up_down_up_down_sync_failover(
157141
'device_group_type': 'sync-failover'}
158142
cm.create(**kwargs)
159143
for x in range(3):
160-
cm.scale_up(c)
161-
cm.scale_down(c)
144+
cm.scale_up_by_one(c)
145+
cm.scale_down_by_one(c)

0 commit comments

Comments
 (0)