Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ script:
- sudo chown travis:travis ${DIST_REPO}/deb_dist/*.deb
after_success:
- md5sum ${PKG_RELEASE_EL7} > ${PKG_RELEASE_EL7}.md5 && md5sum --check ${PKG_RELEASE_EL7}.md5
- md5sum ${PKG_RELEASE_1404} > ${PKG_RELEASE_1404}.md5 && md5sum --check ${PKG_RELASE_1404}.md5
- md5sum ${PKG_RELEASE_1404} > ${PKG_RELEASE_1404}.md5 && md5sum --check ${PKG_RELEASE_1404}.md5

before_deploy: PKG_VERSION=$(python -c "import f5; print(f5.__version__)")
deploy:
Expand Down
6 changes: 5 additions & 1 deletion f5-sdk-dist/scripts/construct_setups.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@

from collections import deque
from collections import namedtuple
from pip.req import parse_requirements as p_reqs

try: # for pip >= 10
from pip._internal.req import parse_requirements as p_reqs
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements as p_reqs


def construct_cfgs(**kargs):
Expand Down
2 changes: 1 addition & 1 deletion f5/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = '3.0.11'
__version__ = '3.0.11.1'
2 changes: 1 addition & 1 deletion f5/bigip/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ class AsmFileMixin(object):
"""
def _download_file(self, filepathname):
self._download(filepathname)
self._download(filepathname)

def _download(self, filepathname):
session = self._meta_data['icr_session']
Expand Down
22 changes: 11 additions & 11 deletions f5/bigip/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ def _check_generation(self):
response = session.get(self._meta_data['uri'])
current_gen = response.json().get('generation', None)
if current_gen is not None and current_gen != self.generation:
error_message = ("The generation of the object on the BigIP " +
"(" + str(current_gen) + ")" +
" does not match the current object" +
"(" + str(self.generation) + ")")
error_message = ("The generation of the object on the BigIP "
+ "(" + str(current_gen) + ")"
+ " does not match the current object"
+ "(" + str(self.generation) + ")")
raise GenerationMismatch(error_message)

def _handle_requests_params(self, kwargs):
Expand Down Expand Up @@ -974,7 +974,7 @@ def _create(self, **kwargs):
return result

def create(self, **kwargs):
"""Create the resource on the BIG-IP®.
r"""Create the resource on the BIG-IP®.

Uses HTTP POST to the `collection` URI to create a resource associated
with a new unique URI on the device.
Expand Down Expand Up @@ -1041,7 +1041,7 @@ def _load(self, **kwargs):
return self._produce_instance(response)

def load(self, **kwargs):
"""Load an already configured service into this instance.
r"""Load an already configured service into this instance.

This method uses HTTP GET to obtain a resource from the BIG-IP®.

Expand Down Expand Up @@ -1081,7 +1081,7 @@ def _delete(self, **kwargs):
self.__dict__ = {'deleted': True}

def delete(self, **kwargs):
"""Delete the resource on the BIG-IP®.
r"""Delete the resource on the BIG-IP®.

Uses HTTP DELETE to delete the resource on the BIG-IP®.

Expand All @@ -1103,7 +1103,7 @@ def delete(self, **kwargs):
# Need to implement correct teardown here.

def exists(self, **kwargs):
"""Check for the existence of the named object on the BIG-IP
r"""Check for the existence of the named object on the BIG-IP

Sends an HTTP GET to the URI of the named object and if it fails with
a :exc:~requests.HTTPError` exception it checks the exception for
Expand Down Expand Up @@ -1252,7 +1252,7 @@ def _load(self, **kwargs):
return self._produce_instance(response)

def load(self, **kwargs):
"""Load an already configured service into this instance.
r"""Load an already configured service into this instance.

This method uses HTTP GET to obtain a resource from the BIG-IP®.

Expand Down Expand Up @@ -1303,7 +1303,7 @@ def delete(self, **kwargs):
# Need to implement correct teardown here.

def exists(self, **kwargs):
"""Check for the existence of the ASM object on the BIG-IP
r"""Check for the existence of the ASM object on the BIG-IP

Sends an HTTP GET to the URI of the ASM object and if it fails with
a :exc:~requests.HTTPError` exception it checks the exception for
Expand Down Expand Up @@ -1504,7 +1504,7 @@ def delete(self, **kwargs):
# Need to implement correct teardown here.

def exists(self, **kwargs):
"""Check for the existence of the Task object on the BIG-IP
r"""Check for the existence of the Task object on the BIG-IP

Sends an HTTP GET to the URI of the ASM object and if it fails with
a :exc:~requests.HTTPError` exception it checks the exception for
Expand Down
8 changes: 4 additions & 4 deletions f5/bigip/test/unit/test_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def fake_http_server(uri, **kwargs):


class FakeAsmFileMixin(AsmFileMixin):
def __init__(self, uri, **kwargs):
session = fake_http_server(uri, **kwargs)
self._meta_data = {'icr_session': session}
self.file_bound_uri = uri
def __init__(self, uri, **kwargs):
session = fake_http_server(uri, **kwargs)
self._meta_data = {'icr_session': session}
self.file_bound_uri = uri


class TestAsmFileMixin(object):
Expand Down
29 changes: 14 additions & 15 deletions f5/bigip/tm/gtm/test/functional/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ def test_load_no_object(self, mgmt_root):
name='fake_serv1')
assert err.value.response.status_code == 404

@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) ==
'11.5.4',
reason='Needs > v11.5.4 TMOS to pass')
@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release')) == '11.5.4',
reason='Needs > v11.5.4 TMOS to pass'
)
def test_load(self, request, mgmt_root):
setup_basic_test(request, mgmt_root, 'fake_serv1', 'Common')
s1 = mgmt_root.tm.gtm.servers.server.load(name='fake_serv1')
Expand All @@ -192,9 +193,9 @@ def test_load(self, request, mgmt_root):
assert s2.disabled is True

@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release')) >= LooseVersion(
'11.6.0'),
reason='This test is for 11.5.4 or less.')
LooseVersion(pytest.config.getoption('--release')) >= LooseVersion('11.6.0'),
reason='This test is for 11.5.4 or less.'
)
def test_load_11_5_4_and_less(self, request, mgmt_root):
setup_basic_test(request, mgmt_root, 'fake_serv1', 'Common')
s1 = mgmt_root.tm.gtm.servers.server.load(name='fake_serv1')
Expand Down Expand Up @@ -237,8 +238,7 @@ def test_delete(self, request, mgmt_root):
class TestServerCollection(object):
def test_server_collection(self, request, mgmt_root):
s1 = setup_basic_test(request, mgmt_root, 'fake_serv1', 'Common')
if LooseVersion(pytest.config.getoption('--release')) >= \
LooseVersion('12.1.0'):
if LooseVersion(pytest.config.getoption('--release')) >= LooseVersion('12.1.0'):
link = 'https://localhost/mgmt/tm/gtm/server/~Common~fake_serv1'
else:
link = 'https://localhost/mgmt/tm/gtm/server/fake_serv1'
Expand All @@ -259,8 +259,7 @@ def test_create_req_arg(self, request, mgmt_root):
s1 = setup_basic_test(request, mgmt_root, 'fake_serv1', 'Common')
vs = s1.virtual_servers_s
vs1 = vs.virtual_server.create(name='vs1', destination='5.5.5.5:80')
if LooseVersion(pytest.config.getoption('--release')) >= \
LooseVersion('12.1.0'):
if LooseVersion(pytest.config.getoption('--release')) >= LooseVersion('12.1.0'):
link = 'https://localhost/mgmt/tm/gtm/server/~Common~fake_serv1' \
'/virtual-servers/vs'
else:
Expand Down Expand Up @@ -347,9 +346,10 @@ def test_modify(self, request, mgmt_root):
elif k == limit:
assert vs1.__dict__[k] == 'enabled'

@pytest.mark.skipif(pytest.config.getoption('--release') == '11.6.0',
reason='Due to a bug in 11.6.0 Final this test '
'fails')
@pytest.mark.skipif(
pytest.config.getoption('--release') == '11.6.0',
reason='Due to a bug in 11.6.0 Final this test fails'
)
def test_delete(self, request, mgmt_root):
vs1 = setup_vs_basic_test(request, mgmt_root, 'vs2', '5.5.5.5:80')
vs1.delete()
Expand All @@ -361,8 +361,7 @@ def test_delete(self, request, mgmt_root):

def test_virtual_server_collection(self, request, mgmt_root):
vs1 = setup_vs_basic_test(request, mgmt_root, 'vs1', '5.5.5.5:80')
if LooseVersion(pytest.config.getoption('--release')) >= \
LooseVersion('12.1.0'):
if LooseVersion(pytest.config.getoption('--release')) >= LooseVersion('12.1.0'):
link = 'https://localhost/mgmt/tm/gtm/server/~Common~fake_serv1' \
'/virtual-servers/vs'
else:
Expand Down
88 changes: 50 additions & 38 deletions f5/bigip/tm/gtm/test/functional/test_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
from pytest import symbols
from requests.exceptions import HTTPError

RELEASE_LOOSE_VERSION = LooseVersion(pytest.config.getoption('--release'))

pytestmark = pytest.mark.skipif(
symbols
and hasattr(symbols, 'modules')
Expand Down Expand Up @@ -64,10 +66,10 @@ def teardown():
return top1


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) <
'12.1.0' or
LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Needs > v12.1.0 TMOS to pass')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION < '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
reason='Needs > v12.1.0 TMOS to pass'
)
class TestCreate(object):
def test_create_no_args(self, mgmt_root):
with pytest.raises(MissingRequiredCreationParameter):
Expand Down Expand Up @@ -105,10 +107,10 @@ def test_create_duplicate(self, request, mgmt_root):
assert err.value.response.status_code == 409


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) >=
'12.1.0' or
LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Needs < v12.1.0 TMOS to pass')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION >= '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
reason='Needs < v12.1.0 TMOS to pass'
)
class TestCreate_pre_12_1_0(object):
def test_create_no_args(self, mgmt_root):
with pytest.raises(MissingRequiredCreationParameter):
Expand Down Expand Up @@ -146,18 +148,20 @@ def test_create_duplicate(self, request, mgmt_root):
assert err.value.response.status_code == 409


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Resource disabled for TMOS 12.0.0')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION == '12.0.0',
reason='Resource disabled for TMOS 12.0.0'
)
class TestRefresh(object):
def test_refresh_raises(self, mgmt_root):
with pytest.raises(UnsupportedOperation):
mgmt_root.tm.gtm.topology_s.topology.refresh()


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) <
'12.1.0' or
LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Needs > v12.1.0 TMOS to pass')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION < '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
reason='Needs > v12.1.0 TMOS to pass'
)
class TestLoad(object):
def test_load_no_object(self, mgmt_root):
with pytest.raises(HTTPError) as err:
Expand All @@ -174,10 +178,10 @@ def test_load(self, request, mgmt_root):
assert t1.selfLink == t2.selfLink


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) >=
'12.1.0' or
LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Needs < v12.1.0 TMOS to pass')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION >= '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
reason='Needs < v12.1.0 TMOS to pass'
)
class TestLoad_pre_12_1_0(object):
def test_load_no_object(self, mgmt_root):
with pytest.raises(HTTPError) as err:
Expand All @@ -194,24 +198,30 @@ def test_load(self, request, mgmt_root):
assert t1.selfLink == t2.selfLink


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Resource disabled for TMOS 12.0.0')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION == '12.0.0',
reason='Resource disabled for TMOS 12.0.0'
)
class TestUpdate(object):
def test_update_raises(self, mgmt_root):
with pytest.raises(UnsupportedOperation):
mgmt_root.tm.gtm.topology_s.topology.update()


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Resource disabled for TMOS 12.0.0')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION == '12.0.0',
reason='Resource disabled for TMOS 12.0.0'
)
class TestModify(object):
def test_modify_raises(self, mgmt_root):
with pytest.raises(UnsupportedOperation):
mgmt_root.tm.gtm.topology_s.topology.modify()


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) <
'12.1.0', reason='Needs > v12.1.0 TMOS to pass')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION < '12.1.0',
reason='Needs > v12.1.0 TMOS to pass'
)
class TestDelete(object):
def test_delete(self, request, mgmt_root):
r1 = setup_basic_test(request, mgmt_root, NAME)
Expand All @@ -221,10 +231,10 @@ def test_delete(self, request, mgmt_root):
assert err.value.response.status_code == 404


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) >=
'12.1.0' or
LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Needs < v12.1.0 TMOS to pass')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION >= '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
reason='Needs < v12.1.0 TMOS to pass'
)
class TestDelete_pre_12_1_0(object):
def test_delete(self, request, mgmt_root):
r1 = setup_basic_test(request, mgmt_root, NAME_SPACES)
Expand All @@ -234,10 +244,10 @@ def test_delete(self, request, mgmt_root):
assert err.value.response.status_code == 404


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) <
'12.1.0' or
LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Needs > v12.1.0 TMOS to pass')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION < '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
reason='Needs > v12.1.0 TMOS to pass'
)
class TestTopologyCollection(object):
def test_region_collection(self, request, mgmt_root):
setup_create_test(request, mgmt_root, NAME)
Expand All @@ -257,10 +267,10 @@ def test_region_collection(self, request, mgmt_root):
assert isinstance(rc[0], Topology)


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) >=
'12.1.0' or
LooseVersion(pytest.config.getoption('--release')) ==
'12.0.0', reason='Needs < v12.1.0 TMOS to pass')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION >= '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
reason='Needs < v12.1.0 TMOS to pass'
)
class TestTopologyCollection_pre_12_1_0(object):
def test_region_collection(self, request, mgmt_root):
setup_create_test(request, mgmt_root, NAME_SPACES)
Expand All @@ -280,8 +290,10 @@ def test_region_collection(self, request, mgmt_root):
assert isinstance(rc[0], Topology)


@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) !=
'12.0.0', reason='Only TMOS 12.0.0 test')
@pytest.mark.skipif(
RELEASE_LOOSE_VERSION != '12.0.0',
reason='Only TMOS 12.0.0 test'
)
class TestTopology_12_0_0(object):
def test_topology_raises(self, request, mgmt_root):
with pytest.raises(UnsupportedTmosVersion):
Expand Down
2 changes: 1 addition & 1 deletion f5/bigip/tm/gtm/test/unit/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def test_non_404_response__v12_1(self, fakeicontrolsession_v12):
session.post.side_effect = error
memres._meta_data['bigip']._meta_data['icr_session'] = session
with pytest.raises(HTTPError) as err:
memres.create(name='fake', partition='fakepart')
memres.create(name='fake', partition='fakepart')
assert err.value.response.status_code == 500

def test_404_response_v12_1(self, fakeicontrolsession_v12):
Expand Down
2 changes: 1 addition & 1 deletion f5/bigip/tm/ltm/test/functional/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_get_collection(self, request, mgmt_root, opt_release):
member1.refresh()
except HTTPError as err:
if err.response.status_code != 404:
raise
raise
pre_del = set(iterkeys(pool1.__dict__))
pool1.refresh()
post_del = set(iterkeys(pool1.__dict__))
Expand Down
Loading