diff --git a/setup.py b/setup.py index 6aaf9b1..679b705 100644 --- a/setup.py +++ b/setup.py @@ -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=[ diff --git a/test/functional/f5_ltm_pool/test_ltm_pool.py b/test/functional/f5_ltm_pool/test_ltm_pool.py index cec6162..90dc3dc 100644 --- a/test/functional/f5_ltm_pool/test_ltm_pool.py +++ b/test/functional/f5_ltm_pool/test_ltm_pool.py @@ -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', @@ -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( @@ -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', @@ -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'), @@ -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 diff --git a/test/functional/f5_ltm_virtualserver/test_ltm_virtualserver.py b/test/functional/f5_ltm_virtualserver/test_ltm_virtualserver.py index 5a01ee4..4c2a3cb 100644 --- a/test/functional/f5_ltm_virtualserver/test_ltm_virtualserver.py +++ b/test/functional/f5_ltm_virtualserver/test_ltm_virtualserver.py @@ -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', @@ -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', @@ -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 diff --git a/test/functional/f5_sys_iappcompositetemplate/test_sys_iappcompositetemplate.py b/test/functional/f5_sys_iappcompositetemplate/test_sys_iappcompositetemplate.py index 90d4dd3..0656edb 100644 --- a/test/functional/f5_sys_iappcompositetemplate/test_sys_iappcompositetemplate.py +++ b/test/functional/f5_sys_iappcompositetemplate/test_sys_iappcompositetemplate.py @@ -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', @@ -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', @@ -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'), @@ -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 diff --git a/test/functional/f5_sys_iappfulltemplate/test_sys_iappfulltemplate.py b/test/functional/f5_sys_iappfulltemplate/test_sys_iappfulltemplate.py index 6535ac0..ae9b8b8 100644 --- a/test/functional/f5_sys_iappfulltemplate/test_sys_iappfulltemplate.py +++ b/test/functional/f5_sys_iappfulltemplate/test_sys_iappfulltemplate.py @@ -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', @@ -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', @@ -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 @@ -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'), @@ -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 diff --git a/test/functional/f5_sys_iappservice/test_sys_iappservice.py b/test/functional/f5_sys_iappservice/test_sys_iappservice.py index 5688c96..5534692 100644 --- a/test/functional/f5_sys_iappservice/test_sys_iappservice.py +++ b/test/functional/f5_sys_iappservice/test_sys_iappservice.py @@ -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', @@ -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', @@ -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', @@ -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', @@ -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 diff --git a/test/functional/f5_sys_partition/test_sys_partition.py b/test/functional/f5_sys_partition/test_sys_partition.py index 916ec76..5f3e3ac 100644 --- a/test/functional/f5_sys_partition/test_sys_partition.py +++ b/test/functional/f5_sys_partition/test_sys_partition.py @@ -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', @@ -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'), @@ -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