Skip to content

Commit fd60df3

Browse files
committed
fix fdb bug, and add test
Issues: Fixes #532 Problem: Fdb was misnamed Analysis: Name and type of Fdb fixed Tests: test/functional/tm/net/test_fdb.py
1 parent 2dba23a commit fd60df3

3 files changed

Lines changed: 39 additions & 4 deletions

File tree

f5/bigip/tm/net/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from f5.bigip.resource import OrganizingCollection
3131
from f5.bigip.tm.net.arp import Arps
3232
from f5.bigip.tm.net.dns_resolver import Dns_Resolvers
33-
from f5.bigip.tm.net.fdb import Fdbs
33+
from f5.bigip.tm.net.fdb import Fdb
3434
from f5.bigip.tm.net.interface import Interfaces
3535
from f5.bigip.tm.net.route import Routes
3636
from f5.bigip.tm.net.route_domain import Route_Domains
@@ -45,7 +45,7 @@ def __init__(self, tm):
4545
self._meta_data['allowed_lazy_attributes'] = [
4646
Arps,
4747
Dns_Resolvers,
48-
Fdbs,
48+
Fdb,
4949
Interfaces,
5050
Routes,
5151
Route_Domains,

f5/bigip/tm/net/fdb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
from f5.bigip.resource import Resource
3434

3535

36-
class Fdbs(OrganizingCollection):
36+
class Fdb(OrganizingCollection):
3737
'''A Collection concrete subclass docstring.'''
3838
def __init__(self, net):
3939
'''Auto generated constructor.'''
40-
super(Fdbs, self).__init__(net)
40+
super(Fdb, self).__init__(net)
4141
self._meta_data['allowed_lazy_attributes'] = [Tunnels]
4242
self._meta_data['template_generated'] = True
4343
self._meta_data['icontrol_version'] = '11.5.0'

test/functional/tm/net/test_fdb.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2016 F5 Networks Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
TEST_MAC = '02:00:00:00:00:01'
17+
18+
19+
def test_tunnels_get_collection(mgmt_root):
20+
tunnels_collection = mgmt_root.tm.net.fdb.tunnels.get_collection()
21+
for tunnel in tunnels_collection:
22+
assert tunnel.name == 'http-tunnel' or tunnel.name == 'socks-tunnel'
23+
24+
25+
def test_tunnel_exists_load_update_refresh(mgmt_root):
26+
t_fact = mgmt_root.tm.net.fdb.tunnels.tunnel
27+
assert t_fact.exists(partition='Common', name='http-tunnel')
28+
assert t_fact.exists(partition='Common', name='socks-tunnel')
29+
http_tunnel = t_fact.load(partition='Common', name='http-tunnel')
30+
http2_tunnel = t_fact.load(partition='Common', name='http-tunnel')
31+
http_tunnel.update(records=TEST_MAC)
32+
http2_tunnel.refresh()
33+
assert http2_tunnel.records == [{u'name': u'02:00:00:00:00:01'}]
34+
http_tunnel.update(records=None)
35+
assert 'records' not in http_tunnel.__dict__

0 commit comments

Comments
 (0)