Skip to content

Commit d94ef0c

Browse files
committed
Fixes the sshd api
Issues: Fixes #438 Problem: The sshd api was inheriting from Resource instead of ResourceBase and this was causing a uri KeyError Analysis: This patch fixes the inheritence to use the ResourceBase class and also adds functional tests for the sshd api to prevent this from happening in the future. Tests: test/functional/tm/sys/test_sshd.py
1 parent bb4925e commit d94ef0c

7 files changed

Lines changed: 332 additions & 6 deletions

File tree

f5/bigip/tm/sys/sshd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"""
2929

3030
from f5.bigip.mixins import UnnamedResourceMixin
31-
from f5.bigip.resource import Resource
31+
from f5.bigip.resource import ResourceBase
3232

3333

34-
class Sshd(UnnamedResourceMixin, Resource):
34+
class Sshd(UnnamedResourceMixin, ResourceBase):
3535
"""BIG-IP® system SSHD unnamed resource
3636
3737
.. note::

requirements.test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ hacking==0.10.2
66
mock==1.3.0
77
pytest==2.9.1
88
pytest-cov>=2.2.1
9+
git+https://github.com/F5Networks/pytest-symbols.git

test/functional/cluster/test_cluster.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def teardown_cluster():
7676
request.addfinalizer(teardown_cluster)
7777

7878

79+
@pytest.mark.skipif(pytest.config.getoption('--symbols') is None,
80+
reason='Symbols must be configured')
7981
def test_new_failover_cluster_two_member(BigIPSetup):
8082
a, b, c = BigIPSetup
8183
bigip_list = [a, b]
@@ -89,6 +91,8 @@ def test_new_failover_cluster_two_member(BigIPSetup):
8991
cm.teardown()
9092

9193

94+
@pytest.mark.skipif(pytest.config.getoption('--symbols') is None,
95+
reason='Symbols must be configured')
9296
def test_new_failover_cluster_three_member(BigIPSetup):
9397
a, b, c = BigIPSetup
9498
bigip_list = [a, b, c]
@@ -102,6 +106,8 @@ def test_new_failover_cluster_three_member(BigIPSetup):
102106
cm.teardown()
103107

104108

109+
@pytest.mark.skipif(pytest.config.getoption('--symbols') is None,
110+
reason='Symbols must be configured')
105111
def test_existing_failover_cluster(BigIPSetup):
106112
a, b, c = BigIPSetup
107113
bigip_list = [a, b]
@@ -118,6 +124,8 @@ def test_existing_failover_cluster(BigIPSetup):
118124
cm.teardown()
119125

120126

127+
@pytest.mark.skipif(pytest.config.getoption('--symbols') is None,
128+
reason='Symbols must be configured')
121129
def test_scale_up_sync_failover(BigIPSetup, ThreeBigIPTeardownSyncFailover):
122130
a, b, c = BigIPSetup
123131
bigip_list = [a, b]
@@ -130,6 +138,8 @@ def test_scale_up_sync_failover(BigIPSetup, ThreeBigIPTeardownSyncFailover):
130138
cm.scale_up_by_one(c)
131139

132140

141+
@pytest.mark.skipif(pytest.config.getoption('--symbols') is None,
142+
reason='Symbols must be configured')
133143
def test_scale_up_down_up_down_sync_failover(
134144
BigIPSetup, TwoBigIPTeardownSyncFailover):
135145
a, b, c = BigIPSetup

test/functional/ssl_profile_creation/test_ssl_profile_creation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ def cleaner():
6565
request.addfinalizer(cleaner)
6666

6767

68+
@pytest.mark.skipif(pytest.config.getoption('--symbols') is None,
69+
reason='Symbols must be configured')
6870
def test_ssl_profile_creation(cleaner, symbols, tmpdir):
6971
testdatadir = tmpdir.mkdir('testdir')
7072
FAKEKEYFILENAME = 'fakekey.key'

test/functional/tm/ltm/test_profile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,10 @@ def test_CURDL(self, request, bigip):
561561
assert ocsp1.cacheErrorTimeout == 3000
562562

563563
# Testing load
564-
ocsp2 = bigip.ltm.profile.ocsp_stapling_params_s
565-
ocsp2.ocsp_stapling_params.load(
564+
ocsp_params = bigip.ltm.profile.ocsp_stapling_params_s
565+
ocsp2 = ocsp_params.ocsp_stapling_params.load(
566566
partition='Common', name='test.ocsp_stapling_params')
567+
567568
assert ocsp1.selfLink == ocsp2.selfLink
568569

569570

test/functional/tm/sys/test_httpd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ def teardown():
2828
class TestHttpd(object):
2929
def test_load(self, cleaner, bigip):
3030
httpd = bigip.sys.httpd.load()
31-
assert httpd.maxClients == 20
31+
assert httpd.maxClients == 10
3232
httpd.refresh()
33-
assert httpd.maxClients == 20
33+
assert httpd.maxClients == 10
3434

3535
def test_update(self, cleaner, bigip):
3636
httpd = bigip.sys.httpd.load()

0 commit comments

Comments
 (0)