summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/tests/neutron_utils_tests.py
AgeCommit message (Collapse)AuthorFilesLines
2018-06-11Added MTU network config and updated flavor_metadata test supportspisarski1-4/+8
JIRA: SNAPS-315 Change-Id: Ie4cbab24ea0af41e93c475e04c9440422617466f Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-04-19Fixed bug with regards to subnet lookups.spisarski1-21/+42
Neutron returns all subnets regardless of visibility which cause problems within routers if there is another subnet with the same name attached to a different network. JIRA: SNAPS-304 In addition, this patch contains two other minor fixes. launch_utils.py - raise an exception when the creator is not properly instantiated network.py - allow fixed IPs to be none. Change-Id: Ib343074d925be4592a713727a03d5b531890eada Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-04-17Add listing security groups functionalityManuel Buil1-0/+27
JIRA: SNAPS-302 Be able to list the available security groups Change-Id: I82e2daeb388f4eb3bc8cbc5fd02006b30b959c2f Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-03-12Closing keystone sessions after done with them.spisarski1-14/+38
By not closing all of the keystone sessions being created when running all of the tests, this may be the root cause to the IOError occasionally being observed: IOError: [Errno 24] Too many open files JIRA: SNAPS-285 Change-Id: I7fc7ab0c6cdd02f1ae32bb3ae4f121cb465d5693 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-28Ensure project for routers are handled properly.spisarski1-12/+23
Routers should be able to be created by admin users to other projects. Routers without admin users should only be able to create ones to their default project. JIRA: SNAPS-266 Change-Id: I5ecfbcc2ed94bbab211751da9521f3ec1d4ff66d Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-22Changed pattern on how objects lookup themselves by name and project.spisarski1-72/+78
The pattern being replaced has unwittingly added the requirement that all creator credentials must be of type 'admin' as when looking up the associated project ID required a call to keystone.projects.list(). As the SNAPS integration tests were always creating users with an 'admin' role, this issue was not caught. As part of this patch, integration test users will no longer be admin. JIRA: SNAPS-274 Change-Id: I02957f69e31a9d4dfa63362d371f061687e59fbf Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-16Ensure project IDs are handled correctly for Network/Subnetsspisarski1-21/+42
JIRA: SNAPS-265 Change-Id: If58f5817e52e21be377d2b06a5f7c3a413454350 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-15Added functionality for OpenStackSecurityGroup#initialize() not to acceptspisarski1-13/+19
security groups with the same name from a different project JIRA: SNAPS-264 Change-Id: I7c905e5588d5e503b47ea0e9f5997be89e841aec Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-01-31Changed invalid gateway IP to ensure fails with all OSspisarski1-1/+1
configurations. Change-Id: I35374ea5fa79974c43c2a474e43ff275b26dfc02 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-21Refactoring of SecurityGroupSettings to extend SecurityGroupConfigspisarski1-13/+13
SecurityGroupSettings, SecurityGroupSettings and neutron_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the SecurityGroupSettings and SecurityGroupRuleSettings class with snaps.config.security_group SecurityGroupConfig and SecurityGroupRuleConfg classes JIRA: SNAPS-224 Change-Id: I6cd82ed5be31f4a24449be767b203e86489b1962 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-20Refactoring of NetworkSettings to extend NetworkConfigspisarski1-33/+31
This also includes SubnetSettings extending to SubnetConfig and PortSettings extenting to Portconfig and neutron_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the NetworkSettings, SubnetSettings, and PortSettings classes. JIRA: SNAPS-220 Change-Id: I996d73d9b910c075a6511a423f01d966f5b6fb74 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-08Adding tests for IPv6.spisarski1-105/+284
Included in patch: 1. Refactor Network domain object to include Subnet objects 2. Removed subnet members from OpenStackNetwork 3. Added exhausive IPv6 tests to neutron_utils_tests.py 4. Added two IPv6 integration tests to create_network_tests.py 5. Added two tests where VM instances have ports with IPv6 addresses 6. Updated docs JIRA: SNAPS-178 Change-Id: Id3e5448cb431d2acf47029244fe6773f3f29d368 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-02Added method to OpenStackHeatStack to return OpenStackRouter objects.spisarski1-1/+1
Continuation of the story SNAPS-153 for adding creator/state machine instances for OpenStack objects deployed via Heat. JIRA: SNAPS-173 Change-Id: Iac9138ef7827c10db1637447d3a909e714a0301b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-24Added method to return OpenStackVmInstance from Heat.spisarski1-10/+11
OpenStackHeatStack now can introspect the VMs that the template was responsible for deploying and return an instanitated instance of OpenStackVmInstance for each VM deployed. When the VM has a Floating IP, these instances have the ability to connect via SSH just like one created from scratch. JIRA: SNAPS-172 Change-Id: I5a7ed3a09bb871afc55c718aa80a9069b1eb4da7 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-09SNAPS Stack creators can now return SNAPS network creators.spisarski1-9/+51
As Heat Stacks are responsible for spawning objects in OpenStack, the class OpenStackHeatStack which is responsible for applying and managing the state of a stack now can retrieve OpenStackNetwork objects for the networks created in the stack for clients who would like to query the networks and subnets or update them outside of Heat. JIRA: SNAPS-171 Change-Id: I9bf0b81d4f7bfeb1b6392f345022c7d9a57d0415 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-07Refactored neutron_utils#get_router_by_name() to get_router()spisarski1-1/+1
Added a router_settings (RouterSettings) object parameter in addition to router_name for more robust query options. JIRA: SNAPS-163 Change-Id: I47672f531171d6ee0c90dabb6641640bf97c1d20 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-07Refactored neutron_utils#get_security_group()spisarski1-9/+9
Added a sec_grp_settings (SecurityGroupSettings) object parameter in addition to sec_grp_name for more robust query options. JIRA: SNAPS-164 Change-Id: I8bb21ff9e5e6b1f532773ca01d37964f8b47b530 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-04Refactored neutron_utils#get_subnet_by_name() to get_subnet()spisarski1-39/+24
Renamed utility function and added a subnet_settings parameter to hold a SubnetSettings object to help make the query more robust by being able to leverage values on the settings object. JIRA: SNAPS-165 Change-Id: I226a1217dc4ba7bb50f7d985ecfaf3b7bc4f610b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-02Refactor network retrieval API calls.spisarski1-2/+3
Refactored neutron_utils#get_network() to also accept a NetworkSettings object for more robust queries in addition to the old network_name parameter. Also refactored neutron_utils# get_network_by_id to add in the ID to list_networks((**{'id': id) and returning the first item contains the expected ID value. JIRA: SNAPS-161 Change-Id: Ie670a442dd70633bbef7a1233e630672ebac6b0c Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-24Added validation router is attached to the external network.spisarski1-1/+4
Verifying that the external network's ID is the same as the 'network_id' value in router.external_gateway_info. JIRA: SNAPS-145 Change-Id: I60795c69679f6e439e6e102115e228a65572db52 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-18Merge "Created new class NeutronException."Steven Pisarski1-2/+3
2017-07-17Last task necessary to stop users from easily obtaining OS objects.spisarski1-1/+1
Changed external interfaces still exposing OpenStack created APIs to either return SNAPS-OO domain objects or objects contained on the OpenStack generated objects as to not leak implementation details that would eventually break the library when new API versions are released. JIRA: SNAPS-125 Change-Id: Iab6d6d298c4c5da68daed4b1b252313a1595a295 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-17Created new class NeutronException.spisarski1-2/+3
Raising NeutronException in neutron_utils.py instead of Exception. JIRA: SNAPS-128 Change-Id: I567db38a5dfcaae9bbfc6c74558521b0e28d9d46 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-13Created domain classes for networks and subnets.spisarski1-104/+75
Created Network and Subnet domain classes so neutron_utils.py functions returning these types of objects will not be leaking out implementation details as each API version can change these data structures which is now being handled by the SNAPS neutron utility. JIRA: SNAPS-113 Change-Id: Id95dd0f8c2618c20a1a73a428abb95686dfa8251 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-13Created domain class for routers.spisarski1-4/+4
Created Router domain class so neutron_utils.py functions returning router objects will not be leaking out implementation details as each API version can change these data structures and this should all be handled by the SNAPS neutron utility. JIRA: SNAPS-115 & SNAPS-14 Change-Id: Ib6d36a735d835a6ed4ede489b14e33a261458fed Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-13Created domain class for ports.spisarski1-1/+1
Create Port domain class so neutron_utils.py functions returning port objects will not be leaking out implementation details as each API version can change these data structures and this should all be handled by the SNAPS neutron utility. JIRA: SNAPS-118 Change-Id: If031a094a9da284e2838691c3b3490359f710c61 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-11Created domain classes for security groups.spisarski1-25/+13
Created SecurityGroup and SecurityGroupRule classes so the neutron_utils for security groups will be returning objects of these types instead of the OpenStack objects returned by the API calls. JIRA: SNAPS-116 Change-Id: I76ed1f85f7d54b984fc6f6ac28cee7680a1109e5 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-06-22Use neutron to create floating IPs.spisarski1-222/+464
This patch moves the floating IP creation out of nova and into neutron. Other changes include the use of domain objects for VM and Floating IP instances, addition of new nova_utils tests to exercise the create server functionality, and more PEP8 compliance. JIRA: SNAPS-92 Change-Id: I16c12b26b56008901633e90ae307586ad2045f9b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-17bugfix: get_security_group_by_id always return first elementMorgan Richomme1-20/+43
add check on id before return value fixed kwarg into the neutron.list_security_groups to the correct one 'id' added unit test to ensure this function always works as designed JIRA: SNAPS-82 Change-Id: I965e1dd54fd1efa8c2d7f6efb87c78ab24cca0e5 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
2017-05-08Modified code to support both Python 2.7 and 3.xspisarski1-4/+6
* Tested on Python 2.7.10 and 3.4.4 * Updated installation documentation JIRA: SNAPS-30 Change-Id: I94a37d218be8ea47bbbcfb560197737430fcb3ba Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-02-15Initial patch with all code from CableLabs repository.spisarski1-0/+651
Change-Id: I70a2778718c5e7f21fd14e4ad28c9269d3761cc7 Signed-off-by: spisarski <s.pisarski@cablelabs.com>