Skip to content

Commit

Permalink
Merge pull request #542 from zancas/bugfix.fdb_532
Browse files Browse the repository at this point in the history
fix fdb bug, and add test
  • Loading branch information
pjbreaux authored Jul 7, 2016
2 parents 2dba23a + fd60df3 commit f898e44
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
4 changes: 2 additions & 2 deletions f5/bigip/tm/net/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from f5.bigip.resource import OrganizingCollection
from f5.bigip.tm.net.arp import Arps
from f5.bigip.tm.net.dns_resolver import Dns_Resolvers
from f5.bigip.tm.net.fdb import Fdbs
from f5.bigip.tm.net.fdb import Fdb
from f5.bigip.tm.net.interface import Interfaces
from f5.bigip.tm.net.route import Routes
from f5.bigip.tm.net.route_domain import Route_Domains
Expand All @@ -45,7 +45,7 @@ def __init__(self, tm):
self._meta_data['allowed_lazy_attributes'] = [
Arps,
Dns_Resolvers,
Fdbs,
Fdb,
Interfaces,
Routes,
Route_Domains,
Expand Down
4 changes: 2 additions & 2 deletions f5/bigip/tm/net/fdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
from f5.bigip.resource import Resource


class Fdbs(OrganizingCollection):
class Fdb(OrganizingCollection):
'''A Collection concrete subclass docstring.'''
def __init__(self, net):
'''Auto generated constructor.'''
super(Fdbs, self).__init__(net)
super(Fdb, self).__init__(net)
self._meta_data['allowed_lazy_attributes'] = [Tunnels]
self._meta_data['template_generated'] = True
self._meta_data['icontrol_version'] = '11.5.0'
Expand Down
35 changes: 35 additions & 0 deletions test/functional/tm/net/test_fdb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

TEST_MAC = '02:00:00:00:00:01'


def test_tunnels_get_collection(mgmt_root):
tunnels_collection = mgmt_root.tm.net.fdb.tunnels.get_collection()
for tunnel in tunnels_collection:
assert tunnel.name == 'http-tunnel' or tunnel.name == 'socks-tunnel'


def test_tunnel_exists_load_update_refresh(mgmt_root):
t_fact = mgmt_root.tm.net.fdb.tunnels.tunnel
assert t_fact.exists(partition='Common', name='http-tunnel')
assert t_fact.exists(partition='Common', name='socks-tunnel')
http_tunnel = t_fact.load(partition='Common', name='http-tunnel')
http2_tunnel = t_fact.load(partition='Common', name='http-tunnel')
http_tunnel.update(records=TEST_MAC)
http2_tunnel.refresh()
assert http2_tunnel.records == [{u'name': u'02:00:00:00:00:01'}]
http_tunnel.update(records=None)
assert 'records' not in http_tunnel.__dict__

0 comments on commit f898e44

Please sign in to comment.