- Makes plugins self contained so they decide their properties file format
- PluggableService creates the contract that implementing entity will return a
properties map which is apiname:rolemask (both are strings)
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
For LB device in inline mode, the ip deployer(the owner of public ip) is the
firewall in front of it, not itself. So check if it's inline or not, if it's
inline, return the firewall as ip deployer
Use SRX firewall filter as SRX firewall. The old security policy mechanism
cannot be used as IP based. This would enable SRX's ability to control traffic
for F5 behind it.
Change access to canHandle so it's easier to unittest.
Make a note that answers can be null if the host is down, there should
be a way to deal with this, but for now an NPE is an adequate indication
that something is wrong.
- Fix interface to return array of strings, or filenames
- Fix StaticRoleBased ACL adapter to process config files by going through all pluggable services
- Refactor interface names
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Automates name field filling using following python program which reads from
various *commands.properties.in files and populates name fields based on the
name cmd class mapping defined in them.
import os
search_pattern = "@APICommand("
pattern_len = len(search_pattern)
prop_files = [
"client/tomcatconf/cisconexusvsm_commands.properties.in",
"client/tomcatconf/f5bigip_commands.properties.in",
"client/tomcatconf/junipersrx_commands.properties.in",
"client/tomcatconf/netapp_commands.properties.in",
"client/tomcatconf/netscalerloadbalancer_commands.properties.in",
"client/tomcatconf/nicira-nvp_commands.properties.in",
"client/tomcatconf/simulator_commands.properties.in",]
file_prefixes = [
"plugins/hypervisors/vmware/src/",
"plugins/network-elements/f5/src/",
"plugins/network-elements/juniper-srx/src/",
"plugins/file-systems/netapp/src/",
"plugins/network-elements/netscaler/src/",
"plugins/network-elements/nicira-nvp/src/",
"plugins/hypervisors/simulator/src/",]
counter = 0
for prop_file in prop_files:
f = open(prop_file, 'r')
data = f.read()
f.close()
file_prefix = file_prefixes[counter]
apis = filter(lambda x: x.strip()!='' and (not x.startswith('#')), data.split('\n'))
for api in apis:
api_name = api.split('=')[0].strip()
cmd_name = file_prefix + api.split('=')[1].split(';')[0].replace('.', '/').strip() + ".java"
if not os.path.exists(cmd_name):
print cmd_name, api_name
f = open(cmd_name, 'r')
d = f.read()
f.close()
idx = d.find(search_pattern) + pattern_len
new_str = d[:idx] + "name = \"%s\", " % api_name + d[idx:]
f = open(cmd_name, 'w')
f.write(new_str)
f.close()
counter += 1
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
These unittests do not depend on the componentlocator but instead are
completely dependent on mock objects. This ensures that they can be run
standalone without any requirements on the environment.
Includes some fixes to NiciraNvpGuestNetworkGuru and GuestNetworkGuru
Note to self, surefire actually runs with assertions enabled where junit
inside eclipse doesn't. Sure surefire will mark tests as failed when an
assertion is triggered. Take care when mocking stuff.
Added some unittests for the NiciraNvpApi. These tests mainly validate
the logic of the execute methods, which are the main thing in this
class. Other methods are basically wrappers around these functions.
Changed NiciraNvpApi to have a factory method for obtaining the
HttpMethod. This makes it easier to mock it.
Changed the executeMethods in NiciraNvpApi to protected so the unittests
have access.
Fixed a bug in NiciraNvpApi where releaseconnection was not called in
some cases.