Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Commit 28377e0

Browse files
author
pjbreaux
authored
Merge pull request #139 from szakeri/master
newton qual code changes
2 parents 5b37aae + 3506408 commit 28377e0

7 files changed

Lines changed: 54 additions & 50 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
url='https://github.com/F5Networks/f5-openstack-heat-plugins/',
3030
keywords=['F5', 'openstack', 'heat', 'bigip', 'orchestration'],
3131
install_requires=[
32-
'f5-sdk == 1.0.0'
32+
'f5-sdk == 2.3.3'
3333
],
3434
packages=find_packages(
3535
exclude=[

test/functional/f5_ltm_pool/test_ltm_pool.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
2121

2222

23-
def test_create_complete(HeatStack, bigip):
23+
def test_create_complete(HeatStack, mgmt_root):
2424
HeatStack(
2525
os.path.join(TEST_DIR, 'success.yaml'),
2626
'success_test',
@@ -30,10 +30,10 @@ def test_create_complete(HeatStack, bigip):
3030
'bigip_pw': symbols.bigip_pw
3131
}
3232
)
33-
assert bigip.tm.ltm.pools.pool.exists(
33+
assert mgmt_root.tm.ltm.pools.pool.exists(
3434
name='test_pool', partition='Common'
3535
) is True
36-
loaded_pool = bigip.tm.ltm.pools.pool.load(
36+
loaded_pool = mgmt_root.tm.ltm.pools.pool.load(
3737
name='test_pool', partition='Common'
3838
)
3939
assert loaded_pool.members_s.members.exists(
@@ -46,16 +46,16 @@ def test_create_complete(HeatStack, bigip):
4646

4747
# Test causes other tests to fail because the test_partition cannot be deleted
4848
# This will be fixed in Issue #25 in f5-openstack-heat-plugins
49-
def itest_create_complete_new_partition(HeatStack, bigip):
49+
def itest_create_complete_new_partition(HeatStack, mgmt_root):
5050
hc, stack = HeatStack(os.path.join(TEST_DIR, 'new_partition.yaml'))
5151
assert hc.wait_until_status(stack.id, 'create_complete') is True
52-
assert bigip.tm.ltm.pools.pool.exists(
52+
assert mgmt_root.tm.ltm.pools.pool.exists(
5353
name='test_pool', partition='test_partition'
5454
) is True
5555

5656

5757
# Copying this with a new template, which has no pool members
58-
def test_create_complete_new_partition(HeatStack, bigip):
58+
def test_create_complete_new_partition(HeatStack, mgmt_root):
5959
HeatStack(
6060
os.path.join(TEST_DIR, 'new_partition_no_members.yaml'),
6161
'new_partition_no_members_test',
@@ -65,12 +65,12 @@ def test_create_complete_new_partition(HeatStack, bigip):
6565
'bigip_pw': symbols.bigip_pw
6666
}
6767
)
68-
assert bigip.tm.ltm.pools.pool.exists(
68+
assert mgmt_root.tm.ltm.pools.pool.exists(
6969
name='test_pool', partition='test_partition'
7070
) is True
7171

7272

73-
def test_create_failed_bad_members(HeatStack, bigip):
73+
def test_create_failed_bad_members(HeatStack, mgmt_root):
7474
with pytest.raises(Exception) as ex:
7575
HeatStack(
7676
os.path.join(TEST_DIR, 'bad_members.yaml'),
@@ -83,6 +83,6 @@ def test_create_failed_bad_members(HeatStack, bigip):
8383
expect_fail=True
8484
)
8585
assert 'Property member_port not assigned' in ex.value.message
86-
assert bigip.tm.ltm.pools.pool.exists(
86+
assert mgmt_root.tm.ltm.pools.pool.exists(
8787
name='test_pool', partition='Common'
8888
) is False

test/functional/f5_ltm_virtualserver/test_ltm_virtualserver.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
2020

2121

22-
def test_create_complete(HeatStack, bigip):
22+
def test_create_complete(HeatStack, mgmt_root):
2323
HeatStack(
2424
os.path.join(TEST_DIR, 'success.yaml'),
2525
'success_test',
@@ -29,12 +29,12 @@ def test_create_complete(HeatStack, bigip):
2929
'bigip_pw': symbols.bigip_pw
3030
}
3131
)
32-
assert bigip.tm.ltm.virtuals.virtual.exists(
32+
assert mgmt_root.tm.ltm.virtuals.virtual.exists(
3333
name='test_vs', partition='Common'
3434
) is True
3535

3636

37-
def test_create_complete_new_partition(HeatStack, bigip):
37+
def test_create_complete_new_partition(HeatStack, mgmt_root):
3838
HeatStack(
3939
os.path.join(TEST_DIR, 'new_partition.yaml'),
4040
'new_partition_test',
@@ -44,7 +44,8 @@ def test_create_complete_new_partition(HeatStack, bigip):
4444
'bigip_pw': symbols.bigip_pw
4545
}
4646
)
47-
assert bigip.tm.ltm.virtuals.virtual.exists(
47+
assert mgmt_root.tm.ltm.virtuals.virtual.exists(
4848
name='test_vs', partition='test_partition'
4949
) is True
50-
assert bigip.tm.sys.folders.folder.exists(name='test_partition') is True
50+
assert \
51+
mgmt_root.tm.sys.folders.folder.exists(name='test_partition') is True

test/functional/f5_sys_iappcompositetemplate/test_sys_iappcompositetemplate.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
2121

2222

23-
def test_create_complete(HeatStack, bigip):
23+
def test_create_complete(HeatStack, mgmt_root):
2424
HeatStack(
2525
os.path.join(TEST_DIR, 'success.yaml'),
2626
'success_test',
@@ -30,12 +30,12 @@ def test_create_complete(HeatStack, bigip):
3030
'bigip_pw': symbols.bigip_pw
3131
}
3232
)
33-
assert bigip.tm.sys.application.templates.template.exists(
33+
assert mgmt_root.tm.sys.application.templates.template.exists(
3434
name='test_template', partition='Common'
3535
) is True
3636

3737

38-
def test_create_complete_new_partition(HeatStack, bigip):
38+
def test_create_complete_new_partition(HeatStack, mgmt_root):
3939
HeatStack(
4040
os.path.join(TEST_DIR, 'new_partition.yaml'),
4141
'new_partition_test',
@@ -45,12 +45,12 @@ def test_create_complete_new_partition(HeatStack, bigip):
4545
'bigip_pw': symbols.bigip_pw
4646
}
4747
)
48-
assert bigip.tm.sys.application.templates.template.exists(
48+
assert mgmt_root.tm.sys.application.templates.template.exists(
4949
name='test_template', partition='test_partition'
5050
) is True
5151

5252

53-
def test_create_failed_no_implementation(HeatStack, bigip):
53+
def test_create_failed_no_implementation(HeatStack, mgmt_root):
5454
with pytest.raises(Exception) as ex:
5555
HeatStack(
5656
os.path.join(TEST_DIR, 'no_implementation.yaml'),
@@ -62,7 +62,7 @@ def test_create_failed_no_implementation(HeatStack, bigip):
6262
},
6363
expect_fail=True
6464
)
65-
assert bigip.tm.sys.application.templates.template.exists(
65+
assert mgmt_root.tm.sys.application.templates.template.exists(
6666
name='test_template', partition='Common'
6767
) is False
6868
assert 'Property implementation not assigned' in ex.value.message

test/functional/f5_sys_iappfulltemplate/test_sys_iappfulltemplate.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
2121

2222

23-
def test_create_complete(HeatStack, bigip):
23+
def test_create_complete(HeatStack, mgmt_root):
2424
HeatStack(
2525
os.path.join(TEST_DIR, 'success_common_partition.yaml'),
2626
'success_common_partition_test',
@@ -30,12 +30,12 @@ def test_create_complete(HeatStack, bigip):
3030
'bigip_pw': symbols.bigip_pw
3131
}
3232
)
33-
assert bigip.tm.sys.application.templates.template.exists(
33+
assert mgmt_root.tm.sys.application.templates.template.exists(
3434
name='thanks_world', partition='Common'
3535
) is True
3636

3737

38-
def test_create_complete_new_partition(HeatStack, bigip):
38+
def test_create_complete_new_partition(HeatStack, mgmt_root):
3939
HeatStack(
4040
os.path.join(TEST_DIR, 'success_new_partition.yaml'),
4141
'success_new_partition_test',
@@ -45,7 +45,7 @@ def test_create_complete_new_partition(HeatStack, bigip):
4545
'bigip_pw': symbols.bigip_pw
4646
}
4747
)
48-
assert bigip.tm.sys.application.templates.template.exists(
48+
assert mgmt_root.tm.sys.application.templates.template.exists(
4949
name='thanks_world', partition='test_partition') is True
5050

5151

@@ -57,7 +57,7 @@ def itest_create_failed_literal_partition(HeatStack):
5757
# Heat teardown fails now due to bug: Issue #23 in github
5858

5959

60-
def test_create_failed_bad_iapp_parsing(HeatStack, bigip):
60+
def test_create_failed_bad_iapp_parsing(HeatStack, mgmt_root):
6161
with pytest.raises(Exception) as ex:
6262
HeatStack(
6363
os.path.join(TEST_DIR, 'bad_iapp.yaml'),
@@ -69,6 +69,6 @@ def test_create_failed_bad_iapp_parsing(HeatStack, bigip):
6969
},
7070
expect_fail=True
7171
)
72-
assert bigip.tm.sys.application.templates.template.exists(
72+
assert mgmt_root.tm.sys.application.templates.template.exists(
7373
name='thanks_world', partition='Common') is False
7474
assert 'NonextantSectionException' in ex.value.message

test/functional/f5_sys_iappservice/test_sys_iappservice.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
2121

2222

23-
def test_create_complete(HeatStack, bigip):
23+
def test_create_complete(HeatStack, mgmt_root):
2424
HeatStack(
2525
os.path.join(TEST_DIR, 'success.yaml'),
2626
'success_test',
@@ -30,11 +30,11 @@ def test_create_complete(HeatStack, bigip):
3030
'bigip_pw': symbols.bigip_pw
3131
}
3232
)
33-
assert bigip.tm.sys.application.services.service.exists(
33+
assert mgmt_root.tm.sys.application.services.service.exists(
3434
name='test_service', partition='Common') is True
3535

3636

37-
def test_create_complete_no_answers(HeatStack, bigip):
37+
def test_create_complete_no_answers(HeatStack, mgmt_root):
3838
HeatStack(
3939
os.path.join(TEST_DIR, 'success_no_answers.yaml'),
4040
'success_no_answers_test',
@@ -44,13 +44,13 @@ def test_create_complete_no_answers(HeatStack, bigip):
4444
'bigip_pw': symbols.bigip_pw
4545
}
4646
)
47-
assert bigip.tm.sys.application.services.service.exists(
47+
assert mgmt_root.tm.sys.application.services.service.exists(
4848
name='test_service', partition='Common') is True
49-
assert bigip.tm.sys.application.templates.template.exists(
49+
assert mgmt_root.tm.sys.application.templates.template.exists(
5050
name='test_template', partition='Common') is True
5151

5252

53-
def test_create_complete_new_partition(HeatStack, bigip):
53+
def test_create_complete_new_partition(HeatStack, mgmt_root):
5454
HeatStack(
5555
os.path.join(TEST_DIR, 'success_new_partition.yaml'),
5656
'success_new_partition_test',
@@ -60,17 +60,17 @@ def test_create_complete_new_partition(HeatStack, bigip):
6060
'bigip_pw': symbols.bigip_pw
6161
}
6262
)
63-
assert bigip.tm.sys.application.services.service.exists(
63+
assert mgmt_root.tm.sys.application.services.service.exists(
6464
name='test_service', partition='test_partition') is True
65-
assert bigip.tm.sys.application.templates.template.exists(
65+
assert mgmt_root.tm.sys.application.templates.template.exists(
6666
name='test_template', partition='test_partition') is True
67-
assert bigip.tm.sys.folders.folder.exists(name='test_partition')
67+
assert mgmt_root.tm.sys.folders.folder.exists(name='test_partition')
6868

6969

7070
# The stack deployed here depends on several pre-existing Openstack resources
7171
# A client image is used (ubuntu), a server image with a node server
7272
# pre-installed and networks.
73-
def itest_create_complete_lb_deploy(HeatStack, bigip):
73+
def itest_create_complete_lb_deploy(HeatStack, mgmt_root):
7474
hc, stack = HeatStack(
7575
os.path.join(TEST_DIR, 'lb_deploy.yaml'),
7676
'lb_deploy_test',
@@ -81,27 +81,27 @@ def itest_create_complete_lb_deploy(HeatStack, bigip):
8181
},
8282
teardown=False
8383
)
84-
assert bigip.tm.sys.application.services.service.exists(
84+
assert mgmt_root.tm.sys.application.services.service.exists(
8585
name='lb_service', partition='Common'
8686
) is True
87-
assert bigip.tm.sys.application.templates.template.exists(
87+
assert mgmt_root.tm.sys.application.templates.template.exists(
8888
name='lb_template', partition='Common'
8989
) is True
90-
assert bigip.tm.ltm.virtuals.virtual.exists(
90+
assert mgmt_root.tm.ltm.virtuals.virtual.exists(
9191
name='virtual_server1', partition='Common'
9292
) is True
93-
assert bigip.tm.ltm.pools.pool.exists(
93+
assert mgmt_root.tm.ltm.pools.pool.exists(
9494
name='pool1', partition='Common'
9595
) is True
9696
hc.delete_stack()
97-
assert bigip.tm.sys.application.services.service.exists(
97+
assert mgmt_root.tm.sys.application.services.service.exists(
9898
name='lb_service', partition='Common'
9999
) is False
100-
assert bigip.tm.sys.application.templates.template.exists(
100+
assert mgmt_root.tm.sys.application.templates.template.exists(
101101
name='lb_template', partition='Common'
102102
) is False
103-
assert bigip.tm.ltm.virtuals.virtual.exists(
103+
assert mgmt_root.tm.ltm.virtuals.virtual.exists(
104104
name='virtual_server1', partition='Common'
105105
) is False
106-
assert bigip.tm.ltm.pools.pool.exists(name='pool1', partition='Common') is \
106+
assert mgmt_root.tm.ltm.pools.pool.exists(name='pool1', partition='Common') is \
107107
False

test/functional/f5_sys_partition/test_sys_partition.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_create_complete(HeatStack):
3232
)
3333

3434

35-
def test_create_complete_new_partition(HeatStack, bigip):
35+
def test_create_complete_new_partition(HeatStack, mgmt_root):
3636
hc, stack = HeatStack(
3737
os.path.join(TEST_DIR, 'new_partition.yaml'),
3838
'new_partition_test',
@@ -43,12 +43,14 @@ def test_create_complete_new_partition(HeatStack, bigip):
4343
},
4444
teardown=False
4545
)
46-
assert bigip.tm.sys.folders.folder.exists(name='test_partition') is True
46+
assert \
47+
mgmt_root.tm.sys.folders.folder.exists(name='test_partition') is True
4748
hc.delete_stack(stack.id)
48-
assert bigip.tm.sys.folders.folder.exists(name='test_partition') is False
49+
assert \
50+
mgmt_root.tm.sys.folders.folder.exists(name='test_partition') is False
4951

5052

51-
def test_create_failed_bad_subpath(HeatStack, bigip):
53+
def test_create_failed_bad_subpath(HeatStack, mgmt_root):
5254
msg = '(/BadSubPath) folder does not exist'
5355
hc, stack = HeatStack(
5456
os.path.join(TEST_DIR, 'bad_subpath.yaml'),
@@ -61,4 +63,5 @@ def test_create_failed_bad_subpath(HeatStack, bigip):
6163
expect_fail=True
6264
)
6365
assert msg in stack.stack_status_reason
64-
assert bigip.tm.sys.folders.folder.exists(name='test_partition') is False
66+
assert \
67+
mgmt_root.tm.sys.folders.folder.exists(name='test_partition') is False

0 commit comments

Comments
 (0)