summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils
AgeCommit message (Collapse)AuthorFilesLines
2018-07-24Small fix to network/project when creating ports andspisarski1-2/+5
added new tests for routers that create ports to external and shared networks created by the 'admin' user. Change-Id: I0365e9843e0837d720ca8dd907c45afa2c512047 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-07-13Switch to OS::Neutron::FloatingIPAssociationCédric Ollivier1-1/+1
OS::Nova::FloatingIPAssociation is hugely deprecated and doesn't work with latest OpenStack Queens deliverables. Change-Id: Icc43ba8a3466efbcc03e190b7e56f84eb69b7e51 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-11Added additional check for the returned project object is not None.spisarski1-1/+1
There were 3 other instances of this check in neutron_utils.py but this one was missed and could potentially cause issues. Change-Id: I599e63e14a9b08ba34f50e060c7dfa5fbdd631f7 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-06-20Adds Stack Updatembeierl2-3/+26
Adds function to allow stack update to occur. Includes higher level object calls for stack update. Added blocking parameter to create() and update() Rebase screwed up some changes. Added new test to test_suite_builder.py and updated IntegrationTests.rst accordingly Change-Id: I4558befb3ea8ea7982faff79d1ebb54fbb3d44a7 Signed-off-by: mbeierl <mark.beierl@dell.com>
2018-06-19Adds Threads to Heat Callsmbeierl2-22/+83
Adds thread pool and coverts looping calls to OpenStack to be submitted to it, allowing them to be run in parallel. Places a configurable maximum size (default 5) of concurrent calls on the thread pool. JIRA: SNAPS-316 Change-Id: Id209c5fe9b7ee7d755d3210a124b38fc3234f0d7 Signed-off-by: mbeierl <mark.beierl@dell.com>
2018-06-11Added MTU network config and updated flavor_metadata test supportspisarski2-12/+19
JIRA: SNAPS-315 Change-Id: Ie4cbab24ea0af41e93c475e04c9440422617466f Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-06-08Merge "Added support for OSCreds output to SNAPS-OO orchestrator app."Steven Pisarski2-23/+46
2018-06-04Added support for OSCreds output to SNAPS-OO orchestrator app.spisarski2-23/+46
Change-Id: Ic690ebff47d137fdd172f5dd5f263cd7f4a6ae04 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-06-04Fix to a router's internal subnet resoulution.spisarski1-1/+1
Ensures that any subnet added to the router is available to that project. Change-Id: Iddfad14a093551bc0f4a05c52b20f02db2474d78 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-05-29Fixed issue when attempting to add an internal subnet to a router.spisarski1-14/+11
Internal subnets that are owned by the same user who is creating a router now can be added properly. Attempted to fix an issue with the change in https://gerrit.opnfv.org/gerrit/#/c/57853/ that was allowing for subnets with the same name to be assigned but ended up breaking this functionality completely. JIRA: SNAPS-312 Change-Id: I1687f66db47520e93e401d3e9fb5f0c4f45d460f Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-05-24Miscellaneous minor stability fixesspisarski1-2/+3
Change-Id: Iad8a7b6358f881d1c2935cc619cfa96f1196a675 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-05-24New functionality for snaps-oo application.spisarski1-16/+58
1. Utility for saving a dict to a YAML file 2. Added new hook that will create a file with the VMs created with the associated OpenStack credentials Change-Id: I124db00e4375603e9473cceab3e2846582d6cb22 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-05-22Extra changes on Flavor ConfigPanagiotis Karalis1-1/+1
JIRA: SNAPS-254 Change-Id: I4f18c0d11fe2e8456c0ebce0681f22e3e1daf6bf Signed-off-by: Panagiotis Karalis <pkaralis@intracom-telecom.com>
2018-05-09Patch to make flavor configuration for tests more flexible.spisarski1-4/+4
Also fixed potential issues with downloading images from https locations JIRA: SNAPS-254 Change-Id: Ib81569df499bbf0652c2025fc7de37af92525f7f Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-04-19Fixed bug with regards to subnet lookups.spisarski5-30/+81
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-19Adding assertion message to test validation.spisarski1-3/+5
Change-Id: I609d09ed8b4f75baeb1ad5454c9ddde9e996a3fe Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-04-18Add flavor metadata for volume related testsMichael Polenchuk1-1/+2
These tests are very sensitive to the state of instance which might be active in terms of nova, but in fact still trying to get an ip address in case of dpdk scenarios. Change-Id: I739044c2edd360535ce1d3531549263163cfea19 Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
2018-04-17Add listing security groups functionalityManuel Buil2-0/+42
JIRA: SNAPS-302 Be able to list the available security groups Change-Id: I82e2daeb388f4eb3bc8cbc5fd02006b30b959c2f Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-04-04Enable get_project_by_id when only tenant_id is providedLinda Wang1-8/+24
This is to improve: https://gerrit.opnfv.org/gerrit/#/c/52675/ Change-Id: I7228e5eadcc121fe94a869c6cbbeac412d972868 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2018-03-13Reverse engineer OpenStackHeatStackspisarski1-2/+2
Added support for obtaining an initialized OpenStackHeatStack object from an existing Stack object JIRA: SNAPS-278 Change-Id: I68cb0c85179868e4e3899b5516316dda3321e9f6 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-03-12Added support for running tests in parallel.spisarski1-2/+2
JIRA: SNAPS-215 Change-Id: I94923a9f184b0d370159b499919e8fc20a2fef90 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-03-12Closing keystone sessions after done with them.spisarski16-105/+256
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-03-08Added members to VmInst that will contain the availability_zonespisarski1-1/+3
and compute_host names while deprecating the method get_vm_info(). JIRA: SNAPS-277 Change-Id: Idc8578b3f2cf2be8ef90f52dd025dbea729b222b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-03-08Ensure the project for volumes are handled properly.spisarski3-33/+84
Although this patch has added the project_name member to VolumeConfig, it does not work properly due to a cinder bug https://bugs.launchpad.net/cinder/+bug/1641982. However, the code will now allow for volumes with the same name to be created on the same pod just as long as they do not exist within the same project/tenant. JIRA: SNAPS-270 Change-Id: Ia6f98e9b66793a69c0205d2d8e38bb3d03f3333e Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-03-07Updated stack tests to only use an admin user when necessary.spisarski1-2/+10
Changed super test class OSIntegrationTestCase to allow subclasses to set the user roles when required. For all heat stack test, the user role will always be 'heat_stack_owner'. 'admin' will be used for tests requiring this role (i.e. heat template creates flavors) JIRA: SNAPS-268 Change-Id: I0ec01cfea6297547a6a158eec8e5c69af6d6c7d7 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-28Ensure project for routers are handled properly.spisarski2-20/+35
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.spisarski10-197/+270
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-20openstack: nova_utils_tests: Wait for volume detachmentMarkos Chandras1-6/+14
The 'test_add_remove_volum' is supposed to wait for volume attachment and detachments. However, the code for the latter was missing. Moreover, we remove some code that checks for attached volumes since that should never happen when detaching the volume. Change-Id: I9ed54a467062d0ddc4efeddf03af7ebe6173e789 Signed-off-by: Markos Chandras <mchandras@suse.de>
2018-02-20openstack: nova_utils_tests: Increase timeout for API callsMarkos Chandras1-2/+2
Patch I2245adb84d0e6d4e3350d17d0c2e44baf5202d51 increased the timeout for the API calls to 2 minutes which was then somewhat reverted in Iea3aeab59c378917fbd175d673113e8d30e2e4b9. However, the problem still persists on slow systems and 30 seconds may not be enough to confirm a volume attachment to the VM. Change-Id: I860b2a797917e13772e95c5d756919e9792b63a6 Signed-off-by: Markos Chandras <mchandras@suse.de>
2018-02-16Ensure project IDs are handled correctly for Network/Subnetsspisarski8-84/+138
JIRA: SNAPS-265 Change-Id: If58f5817e52e21be377d2b06a5f7c3a413454350 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-15Added functionality for OpenStackSecurityGroup#initialize() not to acceptspisarski2-17/+25
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-02-14Fixed commentspisarski1-1/+1
Change-Id: Ib226ef99eed2fda2c7112faf0f0e9339afed90fe Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-06Merge "Fixed timeout logic when attaching/detaching volumes."Steven Pisarski2-44/+133
2018-02-06Fixed timeout logic when attaching/detaching volumes.spisarski2-44/+133
The timeout logic in nova_utils.attach_volume() and detach_volume() was not correct which may have been the root cause behind the issue FUNCTEST-927. Timeout in both attach and detach is no longer optional. Also added a test to attach and detach without timeout as that path was never tested. Updated associated test documentation as well. JIRA: SNAPS-263 JIRA: FUNCTEST-927 Change-Id: Iea3aeab59c378917fbd175d673113e8d30e2e4b9 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-05Added 3 new subnet values for ansible substitutionsspisarski1-0/+6
Change-Id: Idd39e4f6e3f22fcbafe3aae2512ac36cf9e2a417 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-01Merge "openstack: nova_utils_tests: Use API timeout argument instead of sleep()"Steven Pisarski1-6/+2
2018-01-31openstack: nova_utils_tests: Use API timeout argument instead of sleep()Markos Chandras1-6/+2
On slow environments, time.sleep(10) is not enough for attach/detach API calls to propage properly leading to failures like the following one (reduced api_check test) 2018-01-31 18:53:19,297 - functest.ci.run_tests - INFO - Running test case 'api_check'... 2018-01-31 18:54:27,434 - functest.ci.run_tests - INFO - Test result: +-------------------+------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +-------------------+------------------+------------------+----------------+ | api_check | functest | 01:07 | FAIL | +-------------------+------------------+------------------+----------------+ We can workaround this by using the nova_utils.{de,at}tach_volume} 'timeout' argument to wait up to 2 minutes for the attach/detach call to complete. This doesn't affect normal exception whilst it helps get the test going on slow systems. WIth this change, the api_check (reduced test) passes as follows: 2018-01-31 18:48:35,469 - functest.ci.run_tests - INFO - Running test case 'api_check'... 2018-01-31 18:50:56,705 - functest.ci.run_tests - INFO - Test result: +-------------------+------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +-------------------+------------------+------------------+----------------+ | api_check | functest | 02:20 | PASS | +-------------------+------------------+------------------+----------------+ Change-Id: I2245adb84d0e6d4e3350d17d0c2e44baf5202d51 Signed-off-by: Markos Chandras <mchandras@suse.de>
2018-01-31Merge "Changed invalid gateway IP to ensure fails with all OS configurations."Steven Pisarski1-1/+1
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>
2018-01-31Merge "Changed the way floating IPs are getting assigned to VMs as the ↵Steven Pisarski2-16/+8
previous means was not compatible with python-novaclient==10.0.0"
2018-01-29Changed the way floating IPs are getting assigned to VMs as the previousspisarski2-16/+8
means was not compatible with python-novaclient==10.0.0 JIRA: SNAPS-258 Change-Id: I56f7a8341c81e0ae5596f67d4d15ef6c26e0e680 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-01-29Avoid checking Keystone v3 domains when using API v2.0Georg Kunz2-5/+9
Introducing a version check to avoid checking keystone domains, which are an auth API v3 feature, when only auth API v2.0 is being used. Change-Id: I220c6637e5f65124e5dbe7d5246490c3986b7a66 Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
2018-01-23Added password support for SSH and Ansiblespisarski2-3/+6
Additional protections when initializing network resources Enhanced playbook runner variable support Change-Id: Id897c4ece1de706afbc52d0a034ca3bfb68fdce3 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-01-18Change exception message.spisarski1-1/+1
Change-Id: I120faaa8695db5f83e39b521aaa6c1ab68e7fcc1 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-01-16Added post processing task after application of an Ansible playbook.spisarski1-1/+12
The only task currently supported is reboot. Change-Id: I9089c593af30db071508a47667381238fe91e44e Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-01-11Fixed vm instance instantiation from Heat when using nested resourcesspisarski2-19/+39
* Simplified the configuration of file resources * Added integration test JIRA: SNAPS-255 Change-Id: I1065d9352865d7a9f946a5d9947e32e7340f20bc Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-01-10Added port security flag support to ports.spisarski1-1/+2
Change-Id: Ib66607b7656093c5f0cd0e2cb4c0aa9c3b9c661a Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-01-09Merge "Added support for Heat resource files."Steven Pisarski1-0/+3
2017-12-29Added support for Heat resource files.spisarski1-0/+3
Change-Id: I936c0ef5570b5b417e4649504a817f0ca216812f Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-12-28Enhancements to the SNAPS orchestrator/launcherspisarski1-0/+804
Added support for more Ansible substitution values extracted from OpenStack instances (i.e. subnet broadcast address, router external IP for gateway configuration, CIDR IP, netmask, etc.) Removed most try/except blocks to ensure processing does not continue when a problem should arise Added the ability to know when cloud-init has completed Removed nic configuration from OpenStackVmInstance as userdata/ cloud-init/cloud-config should be performing that functionality Fixed some logging messages Misc launcher bug fixes Change-Id: I73e7607ee158cce3d16f9c1c1fc7c32ef5899a1d Signed-off-by: spisarski <s.pisarski@cablelabs.com>