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
8 changes: 8 additions & 0 deletions f5/bigip/tm/ltm/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def __init__(self, profile):
self._meta_data['allowed_lazy_attributes'] = [Client_Ldap]
self._meta_data['attribute_registry'] = \
{'tm:ltm:profile:client-ldap:client-ldapstate': Client_Ldap}
self._meta_data['minimum_version'] = '11.6.0'


class Client_Ldap(Resource):
Expand All @@ -252,6 +253,7 @@ def __init__(self, profile):
self._meta_data['allowed_lazy_attributes'] = [Dhcpv4]
self._meta_data['attribute_registry'] = \
{'tm:ltm:profile:dhcpv4:dhcpv4state': Dhcpv4}
self._meta_data['minimum_version'] = '11.6.0'


class Dhcpv4(Resource):
Expand All @@ -269,6 +271,7 @@ def __init__(self, profile):
self._meta_data['allowed_lazy_attributes'] = [Dhcpv6]
self._meta_data['attribute_registry'] = \
{'tm:ltm:profile:dhcpv6:dhcpv6state': Dhcpv6}
self._meta_data['minimum_version'] = '11.6.0'


class Dhcpv6(Resource):
Expand Down Expand Up @@ -407,6 +410,7 @@ def __init__(self, profile):
self._meta_data['allowed_lazy_attributes'] = [Gtp]
self._meta_data['attribute_registry'] = \
{'tm:ltm:profile:gtp:gtpstate': Gtp}
self._meta_data['minimum_version'] = '11.6.0'


class Gtp(Resource):
Expand Down Expand Up @@ -478,6 +482,7 @@ def __init__(self, profile):
self._meta_data['allowed_lazy_attributes'] = [Http2]
self._meta_data['attribute_registry'] = \
{'tm:ltm:profile:http2:http2state': Http2}
self._meta_data['minimum_version'] = '11.6.0'


class Http2(Resource):
Expand Down Expand Up @@ -600,6 +605,7 @@ def __init__(self, profile):
{'tm:ltm:profile:ocsp-stapling-params:ocsp-stapling-paramsstate':
Ocsp_Stapling_Params}
self._meta_data['attribute_registry'] = temp
self._meta_data['minimum_version'] = '11.6.0'


class Ocsp_Stapling_Params(Resource):
Expand Down Expand Up @@ -878,6 +884,7 @@ def __init__(self, profile):
self._meta_data['allowed_lazy_attributes'] = [Server_Ldap]
self._meta_data['attribute_registry'] = \
{'tm:ltm:profile:server-ldap:server-ldapstate': Server_Ldap}
self._meta_data['minimum_version'] = '11.6.0'


class Server_Ldap(Resource):
Expand Down Expand Up @@ -933,6 +940,7 @@ def __init__(self, profile):
self._meta_data['allowed_lazy_attributes'] = [Smtp]
self._meta_data['attribute_registry'] = \
{'tm:ltm:profile:smtp:smtpstate': Smtp}
self._meta_data['minimum_version'] = '11.6.0'


class Smtp(Resource):
Expand Down
156 changes: 147 additions & 9 deletions test/functional/tm/ltm/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# limitations under the License.
#


from distutils.version import LooseVersion
from f5.bigip.mixins import UnsupportedTmosVersion
from pprint import pprint as pp
pp(__file__)
import pytest
Expand Down Expand Up @@ -210,10 +213,25 @@ def test_RUL(self, request, bigip):


class TestClientLdap(object):
def test_CURDL(self, request, bigip):
@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
< LooseVersion('11.6.0'),
reason='This collection exists on 11.6.0 or greater.'
)
def test_CURDL_11_6_and_greater(self, request, bigip):
ldap = HelperTest(end_lst, 2)
ldap.test_CURDL(request, bigip)

@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
>= LooseVersion('11.6.0'),
reason='This collection does not exist on 11.5.4 or less.'
)
def test_CURDL_11_5_4_and_less(self, request, bigip):
ldap = HelperTest(end_lst, 2)
with pytest.raises(UnsupportedTmosVersion) as ex:
ldap.test_CURDL(request, bigip)
assert 'Minimum TMOS version supported is 11.6.0' in ex.value.message

# End ClientLdap tests

Expand All @@ -232,22 +250,52 @@ def test_CURDL(self, request, bigip):


class TestDhcpv4(object):
def test_CURDL(self, request, bigip):
@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
< LooseVersion('11.6.0'),
reason='This collection exists on 11.6.0 or greater.'
)
def test_CURDL_11_6_and_greater(self, request, bigip):
dhcpv4 = HelperTest(end_lst, 4)
dhcpv4.test_CURDL(request, bigip)

@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
>= LooseVersion('11.6.0'),
reason='This collection does not exist on 11.5.4 or less.'
)
def test_CURDL_11_5_4_and_less(self, request, bigip):
dhcpv4 = HelperTest(end_lst, 4)
with pytest.raises(UnsupportedTmosVersion) as ex:
dhcpv4.test_CURDL(request, bigip)
assert 'Minimum TMOS version supported is 11.6.0' in ex.value.message


# End Dhcpv4 tests

# Begin Dhcpv6 tests


class TestDhcpv6(object):
def test_CURDL(self, request, bigip):
@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
< LooseVersion('11.6.0'),
reason='This collection exists on 11.6.0 or greater.'
)
def test_CURDL_11_6_and_greater(self, request, bigip):
dhcpv6 = HelperTest(end_lst, 5)
dhcpv6.test_CURDL(request, bigip)


@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
>= LooseVersion('11.6.0'),
reason='This collection does not exist on 11.5.4 or less.'
)
def test_CURDL_11_5_4_and_less(self, request, bigip):
dhcpv4 = HelperTest(end_lst, 5)
with pytest.raises(UnsupportedTmosVersion) as ex:
dhcpv4.test_CURDL(request, bigip)
assert 'Minimum TMOS version supported is 11.6.0' in ex.value.message
# End Dhcpv6 tests

# Begin Diameter tests
Expand Down Expand Up @@ -374,10 +422,26 @@ def test_CURDL(self, request, bigip):


class TestGtp(object):
def test_CURDL(self, request, bigip):
@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
< LooseVersion('11.6.0'),
reason='This collection exists on 11.6.0 or greater.'
)
def test_CURDL_11_6_and_greater(self, request, bigip):
gtp = HelperTest(end_lst, 13)
gtp.test_CURDL(request, bigip)

@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
>= LooseVersion('11.6.0'),
reason='This collection does not exist on 11.5.4 or less.'
)
def test_CURDL_11_5_4_and_less(self, request, bigip):
dhcpv4 = HelperTest(end_lst, 13)
with pytest.raises(UnsupportedTmosVersion) as ex:
dhcpv4.test_CURDL(request, bigip)
assert 'Minimum TMOS version supported is 11.6.0' in ex.value.message


# End GTP tests

Expand Down Expand Up @@ -418,10 +482,26 @@ def test_CURDL(self, request, bigip):


class TestHttp2(object):
def test_CURDL(self, request, bigip):
@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
< LooseVersion('11.6.0'),
reason='This collection exists on 11.6.0 or greater.'
)
def test_CURDL_11_6_and_greater(self, request, bigip):
http2 = HelperTest(end_lst, 17)
http2.test_CURDL(request, bigip)

@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
>= LooseVersion('11.6.0'),
reason='This collection does not exist on 11.5.4 or less.'
)
def test_CURDL_11_5_4_and_less(self, request, bigip):
dhcpv4 = HelperTest(end_lst, 17)
with pytest.raises(UnsupportedTmosVersion) as ex:
dhcpv4.test_CURDL(request, bigip)
assert 'Minimum TMOS version supported is 11.6.0' in ex.value.message


# End HTTP tests

Expand Down Expand Up @@ -542,7 +622,12 @@ def teardown():


class TestOcspStaplingParams(object):
def test_CURDL(self, request, bigip):
@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
< LooseVersion('11.6.0'),
reason='This collection exists on 11.6.0 or greater.'
)
def test_CURDL_11_6_and_greater(self, request, bigip):

# Setup DNS resolver as prerequisite
dns = setup_dns_resolver(request, bigip, 'test_resolv')
Expand Down Expand Up @@ -577,6 +662,27 @@ def test_CURDL(self, request, bigip):

assert ocsp1.selfLink == ocsp2.selfLink

@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
>= LooseVersion('11.6.0'),
reason='This collection does not exist on 11.5.4 or less.'
)
def test_CURDL_11_6_and_less(self, request, bigip):

# Setup DNS resolver as prerequisite
dns = setup_dns_resolver(request, bigip, 'test_resolv')

# Test CURDL
ocsp = HelperTest(end_lst, 24)

# Testing create
with pytest.raises(UnsupportedTmosVersion) as ex:
ocsp.setup_test(
request, bigip, dnsResolver=dns.name,
trustedCa='/Common/ca-bundle.crt',
useProxyServer='disabled'
)
assert 'Minimum TMOS version supported is 11.6.0' in ex.value.message

# End Ocsp Stapling Params tests

Expand Down Expand Up @@ -795,10 +901,26 @@ def test_CURDL(self, request, bigip):


class TestServerLdap(object):
def test_CURDL(self, request, bigip):
@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
< LooseVersion('11.6.0'),
reason='This collection exists on 11.6.0 or greater.'
)
def test_CURDL_11_6_and_greater(self, request, bigip):
sldap = HelperTest(end_lst, 35)
sldap.test_CURDL(request, bigip)

@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
>= LooseVersion('11.6.0'),
reason='This collection does not exist on 11.5.4 or less.'
)
def test_CURDL_11_5_4_and_less(self, request, bigip):
dhcpv4 = HelperTest(end_lst, 35)
with pytest.raises(UnsupportedTmosVersion) as ex:
dhcpv4.test_CURDL(request, bigip)
assert 'Minimum TMOS version supported is 11.6.0' in ex.value.message


# End Server Ldap tests

Expand Down Expand Up @@ -828,10 +950,26 @@ def test_CURDL(self, request, bigip):


class TestSmtp(object):
def test_CURDL(self, request, bigip):
@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
< LooseVersion('11.6.0'),
reason='This collection exists on 11.6.0 or greater.'
)
def test_CURDL_11_6_and_greater(self, request, bigip):
smtp = HelperTest(end_lst, 38)
smtp.test_CURDL(request, bigip)

@pytest.mark.skipif(
LooseVersion(pytest.config.getoption('--release'))
>= LooseVersion('11.6.0'),
reason='This collection does not exist on 11.5.4 or less.'
)
def test_CURDL_11_5_4_and_less(self, request, bigip):
dhcpv4 = HelperTest(end_lst, 38)
with pytest.raises(UnsupportedTmosVersion) as ex:
dhcpv4.test_CURDL(request, bigip)
assert 'Minimum TMOS version supported is 11.6.0' in ex.value.message


# End Smtp tests

Expand Down
3 changes: 3 additions & 0 deletions test/functional/tm/sys/test_failover.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def test_exec_cmd(self, mgmt_root, teardown_device_failover_state):
f = mgmt_root.tm.sys.failover
f.exec_cmd('run', offline=True)
get_activation_state(mgmt_root)
# Use the pollster to check for expected state. The pollster uses
# a method which checks for any exception. If one is found, it keeps
# trying.
pollster(check_device_state_as_expected)(mgmt_root, 'forced-offline')
fl.refresh()
pp(fl.raw)
Expand Down