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

Commit

Permalink
Merge pull request #139 from szakeri/master
Browse files Browse the repository at this point in the history
newton qual code changes
  • Loading branch information
pjbreaux authored Jun 19, 2017
2 parents 5b37aae + 3506408 commit 28377e0
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 50 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
url='https://github.com/F5Networks/f5-openstack-heat-plugins/',
keywords=['F5', 'openstack', 'heat', 'bigip', 'orchestration'],
install_requires=[
'f5-sdk == 1.0.0'
'f5-sdk == 2.3.3'
],
packages=find_packages(
exclude=[
Expand Down
18 changes: 9 additions & 9 deletions test/functional/f5_ltm_pool/test_ltm_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
TEST_DIR = os.path.dirname(os.path.realpath(__file__))


def test_create_complete(HeatStack, bigip):
def test_create_complete(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'success.yaml'),
'success_test',
Expand All @@ -30,10 +30,10 @@ def test_create_complete(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.ltm.pools.pool.exists(
assert mgmt_root.tm.ltm.pools.pool.exists(
name='test_pool', partition='Common'
) is True
loaded_pool = bigip.tm.ltm.pools.pool.load(
loaded_pool = mgmt_root.tm.ltm.pools.pool.load(
name='test_pool', partition='Common'
)
assert loaded_pool.members_s.members.exists(
Expand All @@ -46,16 +46,16 @@ def test_create_complete(HeatStack, bigip):

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


# Copying this with a new template, which has no pool members
def test_create_complete_new_partition(HeatStack, bigip):
def test_create_complete_new_partition(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'new_partition_no_members.yaml'),
'new_partition_no_members_test',
Expand All @@ -65,12 +65,12 @@ def test_create_complete_new_partition(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.ltm.pools.pool.exists(
assert mgmt_root.tm.ltm.pools.pool.exists(
name='test_pool', partition='test_partition'
) is True


def test_create_failed_bad_members(HeatStack, bigip):
def test_create_failed_bad_members(HeatStack, mgmt_root):
with pytest.raises(Exception) as ex:
HeatStack(
os.path.join(TEST_DIR, 'bad_members.yaml'),
Expand All @@ -83,6 +83,6 @@ def test_create_failed_bad_members(HeatStack, bigip):
expect_fail=True
)
assert 'Property member_port not assigned' in ex.value.message
assert bigip.tm.ltm.pools.pool.exists(
assert mgmt_root.tm.ltm.pools.pool.exists(
name='test_pool', partition='Common'
) is False
11 changes: 6 additions & 5 deletions test/functional/f5_ltm_virtualserver/test_ltm_virtualserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
TEST_DIR = os.path.dirname(os.path.realpath(__file__))


def test_create_complete(HeatStack, bigip):
def test_create_complete(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'success.yaml'),
'success_test',
Expand All @@ -29,12 +29,12 @@ def test_create_complete(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.ltm.virtuals.virtual.exists(
assert mgmt_root.tm.ltm.virtuals.virtual.exists(
name='test_vs', partition='Common'
) is True


def test_create_complete_new_partition(HeatStack, bigip):
def test_create_complete_new_partition(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'new_partition.yaml'),
'new_partition_test',
Expand All @@ -44,7 +44,8 @@ def test_create_complete_new_partition(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.ltm.virtuals.virtual.exists(
assert mgmt_root.tm.ltm.virtuals.virtual.exists(
name='test_vs', partition='test_partition'
) is True
assert bigip.tm.sys.folders.folder.exists(name='test_partition') is True
assert \
mgmt_root.tm.sys.folders.folder.exists(name='test_partition') is True
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
TEST_DIR = os.path.dirname(os.path.realpath(__file__))


def test_create_complete(HeatStack, bigip):
def test_create_complete(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'success.yaml'),
'success_test',
Expand All @@ -30,12 +30,12 @@ def test_create_complete(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='test_template', partition='Common'
) is True


def test_create_complete_new_partition(HeatStack, bigip):
def test_create_complete_new_partition(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'new_partition.yaml'),
'new_partition_test',
Expand All @@ -45,12 +45,12 @@ def test_create_complete_new_partition(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='test_template', partition='test_partition'
) is True


def test_create_failed_no_implementation(HeatStack, bigip):
def test_create_failed_no_implementation(HeatStack, mgmt_root):
with pytest.raises(Exception) as ex:
HeatStack(
os.path.join(TEST_DIR, 'no_implementation.yaml'),
Expand All @@ -62,7 +62,7 @@ def test_create_failed_no_implementation(HeatStack, bigip):
},
expect_fail=True
)
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='test_template', partition='Common'
) is False
assert 'Property implementation not assigned' in ex.value.message
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
TEST_DIR = os.path.dirname(os.path.realpath(__file__))


def test_create_complete(HeatStack, bigip):
def test_create_complete(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'success_common_partition.yaml'),
'success_common_partition_test',
Expand All @@ -30,12 +30,12 @@ def test_create_complete(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='thanks_world', partition='Common'
) is True


def test_create_complete_new_partition(HeatStack, bigip):
def test_create_complete_new_partition(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'success_new_partition.yaml'),
'success_new_partition_test',
Expand All @@ -45,7 +45,7 @@ def test_create_complete_new_partition(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='thanks_world', partition='test_partition') is True


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


def test_create_failed_bad_iapp_parsing(HeatStack, bigip):
def test_create_failed_bad_iapp_parsing(HeatStack, mgmt_root):
with pytest.raises(Exception) as ex:
HeatStack(
os.path.join(TEST_DIR, 'bad_iapp.yaml'),
Expand All @@ -69,6 +69,6 @@ def test_create_failed_bad_iapp_parsing(HeatStack, bigip):
},
expect_fail=True
)
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='thanks_world', partition='Common') is False
assert 'NonextantSectionException' in ex.value.message
36 changes: 18 additions & 18 deletions test/functional/f5_sys_iappservice/test_sys_iappservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
TEST_DIR = os.path.dirname(os.path.realpath(__file__))


def test_create_complete(HeatStack, bigip):
def test_create_complete(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'success.yaml'),
'success_test',
Expand All @@ -30,11 +30,11 @@ def test_create_complete(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.sys.application.services.service.exists(
assert mgmt_root.tm.sys.application.services.service.exists(
name='test_service', partition='Common') is True


def test_create_complete_no_answers(HeatStack, bigip):
def test_create_complete_no_answers(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'success_no_answers.yaml'),
'success_no_answers_test',
Expand All @@ -44,13 +44,13 @@ def test_create_complete_no_answers(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.sys.application.services.service.exists(
assert mgmt_root.tm.sys.application.services.service.exists(
name='test_service', partition='Common') is True
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='test_template', partition='Common') is True


def test_create_complete_new_partition(HeatStack, bigip):
def test_create_complete_new_partition(HeatStack, mgmt_root):
HeatStack(
os.path.join(TEST_DIR, 'success_new_partition.yaml'),
'success_new_partition_test',
Expand All @@ -60,17 +60,17 @@ def test_create_complete_new_partition(HeatStack, bigip):
'bigip_pw': symbols.bigip_pw
}
)
assert bigip.tm.sys.application.services.service.exists(
assert mgmt_root.tm.sys.application.services.service.exists(
name='test_service', partition='test_partition') is True
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='test_template', partition='test_partition') is True
assert bigip.tm.sys.folders.folder.exists(name='test_partition')
assert mgmt_root.tm.sys.folders.folder.exists(name='test_partition')


# The stack deployed here depends on several pre-existing Openstack resources
# A client image is used (ubuntu), a server image with a node server
# pre-installed and networks.
def itest_create_complete_lb_deploy(HeatStack, bigip):
def itest_create_complete_lb_deploy(HeatStack, mgmt_root):
hc, stack = HeatStack(
os.path.join(TEST_DIR, 'lb_deploy.yaml'),
'lb_deploy_test',
Expand All @@ -81,27 +81,27 @@ def itest_create_complete_lb_deploy(HeatStack, bigip):
},
teardown=False
)
assert bigip.tm.sys.application.services.service.exists(
assert mgmt_root.tm.sys.application.services.service.exists(
name='lb_service', partition='Common'
) is True
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='lb_template', partition='Common'
) is True
assert bigip.tm.ltm.virtuals.virtual.exists(
assert mgmt_root.tm.ltm.virtuals.virtual.exists(
name='virtual_server1', partition='Common'
) is True
assert bigip.tm.ltm.pools.pool.exists(
assert mgmt_root.tm.ltm.pools.pool.exists(
name='pool1', partition='Common'
) is True
hc.delete_stack()
assert bigip.tm.sys.application.services.service.exists(
assert mgmt_root.tm.sys.application.services.service.exists(
name='lb_service', partition='Common'
) is False
assert bigip.tm.sys.application.templates.template.exists(
assert mgmt_root.tm.sys.application.templates.template.exists(
name='lb_template', partition='Common'
) is False
assert bigip.tm.ltm.virtuals.virtual.exists(
assert mgmt_root.tm.ltm.virtuals.virtual.exists(
name='virtual_server1', partition='Common'
) is False
assert bigip.tm.ltm.pools.pool.exists(name='pool1', partition='Common') is \
assert mgmt_root.tm.ltm.pools.pool.exists(name='pool1', partition='Common') is \
False
13 changes: 8 additions & 5 deletions test/functional/f5_sys_partition/test_sys_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_create_complete(HeatStack):
)


def test_create_complete_new_partition(HeatStack, bigip):
def test_create_complete_new_partition(HeatStack, mgmt_root):
hc, stack = HeatStack(
os.path.join(TEST_DIR, 'new_partition.yaml'),
'new_partition_test',
Expand All @@ -43,12 +43,14 @@ def test_create_complete_new_partition(HeatStack, bigip):
},
teardown=False
)
assert bigip.tm.sys.folders.folder.exists(name='test_partition') is True
assert \
mgmt_root.tm.sys.folders.folder.exists(name='test_partition') is True
hc.delete_stack(stack.id)
assert bigip.tm.sys.folders.folder.exists(name='test_partition') is False
assert \
mgmt_root.tm.sys.folders.folder.exists(name='test_partition') is False


def test_create_failed_bad_subpath(HeatStack, bigip):
def test_create_failed_bad_subpath(HeatStack, mgmt_root):
msg = '(/BadSubPath) folder does not exist'
hc, stack = HeatStack(
os.path.join(TEST_DIR, 'bad_subpath.yaml'),
Expand All @@ -61,4 +63,5 @@ def test_create_failed_bad_subpath(HeatStack, bigip):
expect_fail=True
)
assert msg in stack.stack_status_reason
assert bigip.tm.sys.folders.folder.exists(name='test_partition') is False
assert \
mgmt_root.tm.sys.folders.folder.exists(name='test_partition') is False

0 comments on commit 28377e0

Please sign in to comment.