Skip to content

Commit d648642

Browse files
authored
Merge pull request #570 from pjbreaux/bugfix.failover_tests_11_5_4
Bugfix.failover tests 11 5 4
2 parents bf3a942 + 5d8be4b commit d648642

3 files changed

Lines changed: 158 additions & 9 deletions

File tree

f5/bigip/tm/ltm/profile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def __init__(self, profile):
235235
self._meta_data['allowed_lazy_attributes'] = [Client_Ldap]
236236
self._meta_data['attribute_registry'] = \
237237
{'tm:ltm:profile:client-ldap:client-ldapstate': Client_Ldap}
238+
self._meta_data['minimum_version'] = '11.6.0'
238239

239240

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

256258

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

273276

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

411415

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

482487

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

604610

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

882889

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

937945

938946
class Smtp(Resource):

test/functional/tm/ltm/test_profile.py

Lines changed: 147 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# limitations under the License.
1414
#
1515

16+
17+
from distutils.version import LooseVersion
18+
from f5.bigip.mixins import UnsupportedTmosVersion
1619
from pprint import pprint as pp
1720
pp(__file__)
1821
import pytest
@@ -210,10 +213,25 @@ def test_RUL(self, request, bigip):
210213

211214

212215
class TestClientLdap(object):
213-
def test_CURDL(self, request, bigip):
216+
@pytest.mark.skipif(
217+
LooseVersion(pytest.config.getoption('--release'))
218+
< LooseVersion('11.6.0'),
219+
reason='This collection exists on 11.6.0 or greater.'
220+
)
221+
def test_CURDL_11_6_and_greater(self, request, bigip):
214222
ldap = HelperTest(end_lst, 2)
215223
ldap.test_CURDL(request, bigip)
216224

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

218236
# End ClientLdap tests
219237

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

233251

234252
class TestDhcpv4(object):
235-
def test_CURDL(self, request, bigip):
253+
@pytest.mark.skipif(
254+
LooseVersion(pytest.config.getoption('--release'))
255+
< LooseVersion('11.6.0'),
256+
reason='This collection exists on 11.6.0 or greater.'
257+
)
258+
def test_CURDL_11_6_and_greater(self, request, bigip):
236259
dhcpv4 = HelperTest(end_lst, 4)
237260
dhcpv4.test_CURDL(request, bigip)
238261

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

240274
# End Dhcpv4 tests
241275

242276
# Begin Dhcpv6 tests
243277

244278

245279
class TestDhcpv6(object):
246-
def test_CURDL(self, request, bigip):
280+
@pytest.mark.skipif(
281+
LooseVersion(pytest.config.getoption('--release'))
282+
< LooseVersion('11.6.0'),
283+
reason='This collection exists on 11.6.0 or greater.'
284+
)
285+
def test_CURDL_11_6_and_greater(self, request, bigip):
247286
dhcpv6 = HelperTest(end_lst, 5)
248287
dhcpv6.test_CURDL(request, bigip)
249288

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

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

375423

376424
class TestGtp(object):
377-
def test_CURDL(self, request, bigip):
425+
@pytest.mark.skipif(
426+
LooseVersion(pytest.config.getoption('--release'))
427+
< LooseVersion('11.6.0'),
428+
reason='This collection exists on 11.6.0 or greater.'
429+
)
430+
def test_CURDL_11_6_and_greater(self, request, bigip):
378431
gtp = HelperTest(end_lst, 13)
379432
gtp.test_CURDL(request, bigip)
380433

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

382446
# End GTP tests
383447

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

419483

420484
class TestHttp2(object):
421-
def test_CURDL(self, request, bigip):
485+
@pytest.mark.skipif(
486+
LooseVersion(pytest.config.getoption('--release'))
487+
< LooseVersion('11.6.0'),
488+
reason='This collection exists on 11.6.0 or greater.'
489+
)
490+
def test_CURDL_11_6_and_greater(self, request, bigip):
422491
http2 = HelperTest(end_lst, 17)
423492
http2.test_CURDL(request, bigip)
424493

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

426506
# End HTTP tests
427507

@@ -542,7 +622,12 @@ def teardown():
542622

543623

544624
class TestOcspStaplingParams(object):
545-
def test_CURDL(self, request, bigip):
625+
@pytest.mark.skipif(
626+
LooseVersion(pytest.config.getoption('--release'))
627+
< LooseVersion('11.6.0'),
628+
reason='This collection exists on 11.6.0 or greater.'
629+
)
630+
def test_CURDL_11_6_and_greater(self, request, bigip):
546631

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

578663
assert ocsp1.selfLink == ocsp2.selfLink
579664

665+
@pytest.mark.skipif(
666+
LooseVersion(pytest.config.getoption('--release'))
667+
>= LooseVersion('11.6.0'),
668+
reason='This collection does not exist on 11.5.4 or less.'
669+
)
670+
def test_CURDL_11_6_and_less(self, request, bigip):
671+
672+
# Setup DNS resolver as prerequisite
673+
dns = setup_dns_resolver(request, bigip, 'test_resolv')
674+
675+
# Test CURDL
676+
ocsp = HelperTest(end_lst, 24)
677+
678+
# Testing create
679+
with pytest.raises(UnsupportedTmosVersion) as ex:
680+
ocsp.setup_test(
681+
request, bigip, dnsResolver=dns.name,
682+
trustedCa='/Common/ca-bundle.crt',
683+
useProxyServer='disabled'
684+
)
685+
assert 'Minimum TMOS version supported is 11.6.0' in ex.value.message
580686

581687
# End Ocsp Stapling Params tests
582688

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

796902

797903
class TestServerLdap(object):
798-
def test_CURDL(self, request, bigip):
904+
@pytest.mark.skipif(
905+
LooseVersion(pytest.config.getoption('--release'))
906+
< LooseVersion('11.6.0'),
907+
reason='This collection exists on 11.6.0 or greater.'
908+
)
909+
def test_CURDL_11_6_and_greater(self, request, bigip):
799910
sldap = HelperTest(end_lst, 35)
800911
sldap.test_CURDL(request, bigip)
801912

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

803925
# End Server Ldap tests
804926

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

829951

830952
class TestSmtp(object):
831-
def test_CURDL(self, request, bigip):
953+
@pytest.mark.skipif(
954+
LooseVersion(pytest.config.getoption('--release'))
955+
< LooseVersion('11.6.0'),
956+
reason='This collection exists on 11.6.0 or greater.'
957+
)
958+
def test_CURDL_11_6_and_greater(self, request, bigip):
832959
smtp = HelperTest(end_lst, 38)
833960
smtp.test_CURDL(request, bigip)
834961

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

836974
# End Smtp tests
837975

test/functional/tm/sys/test_failover.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ def test_exec_cmd(self, mgmt_root, teardown_device_failover_state):
9393
f = mgmt_root.tm.sys.failover
9494
f.exec_cmd('run', offline=True)
9595
get_activation_state(mgmt_root)
96+
# Use the pollster to check for expected state. The pollster uses
97+
# a method which checks for any exception. If one is found, it keeps
98+
# trying.
9699
pollster(check_device_state_as_expected)(mgmt_root, 'forced-offline')
97100
fl.refresh()
98101
pp(fl.raw)

0 commit comments

Comments
 (0)