summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/tests/create_instance_tests.py
AgeCommit message (Collapse)AuthorFilesLines
2017-11-21Refactoring of SecurityGroupSettings to extend SecurityGroupConfigspisarski1-48/+42
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 VmInstanceSettings to extend VmInstanceConfigspisarski1-59/+61
VmInstanceSettings, FloatingIPSettings and nova_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the VmInstanceSettings and FloatingIPSettings class with snaps.config.vm_inst VmInstanceConfig and FloatingIpConfg classes JIRA: SNAPS-218 Change-Id: I95688130256bca1df4a5c347bdb741019ae0937e Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-20Refactoring of NetworkSettings to extend NetworkConfigspisarski1-46/+46
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-20Refactoring of VolumeSettings to extend VolumeConfigspisarski1-3/+4
VolumeSettings and cinder_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the VolumeSettings class. JIRA: SNAPS-227 Change-Id: I3f93702ff836af365c811d44bfd0e59b76c3f1f5 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-20Refactoring of RouterSettings to extend RouterConfigspisarski1-5/+6
RouterSettings and neutron_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the RouterSettings class. JIRA: SNAPS-223 Change-Id: I6a2a5e6e6e86204e62148a57e3525da5862841cf Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-20Refactoring of KeypairSettings to extend KeypairConfigspisarski1-4/+5
KeypairSettings and glance_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the KeypairSettings class. JIRA: SNAPS-219 Change-Id: I92f51ecb77238444697e922c8f089e78d1c643aa Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-20Refactoring of FlavorSettings to extend FlavorConfigspisarski1-27/+28
FlavorSettings and glance_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the FlavorSettings class. JIRA: SNAPS-216 Change-Id: Ie9532fcbe16377d4ab608bdacd1982c3c6628fe9 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-16Refactoring of ImageSettings to extend ImageConfigspisarski1-7/+8
ImageSettings and glance_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the ImageSettings class. JIRA: SNAPS-217 Change-Id: I09f34531366f2a5bd3202c9cbbdef878b2542abe Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-08Adding tests for IPv6.spisarski1-24/+231
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-10-24Implemented the ability to attach volumes to VM instances.spisarski1-9/+188
JIRA: SNAPS-198 Change-Id: I30bb92dabab64e6a8918fa5ab0de1bed359a147e Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-24Added method to return OpenStackVmInstance from Heat.spisarski1-6/+20
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-14Fix validate_ssh_clientAlex Yang1-7/+6
After the "try..finally.." statement is executed, the ssh_client is closed by the "finally" statement. So the out.channel.in_buffer is not readable and the testcases failed. Change-Id: I3fbf620cb9ccee62c515b83fed9fd01238ad3262 Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
2017-08-08Added test ability for 2 VMs on different networks to ping each other.spisarski1-2/+273
JIRA: SNAPS-48 Change-Id: I77973fef06343eb7108e998ea8e939c1f2d9d4a6 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-08Configure requirements for AAVMF(UEFI) with Cirros image on AArch64 Delia Popescu1-7/+7
Cirros image on AArch64 with AAVMF(UEFI) requires at least 256MB RAM. The default 128MB was changed to 256MB. Change-Id: I7414de519dcb53337f83690d1470ea672cec739b Signed-off-by: Delia Popescu <delia.popescu@enea.com> JIRA: ARMBAND-279
2017-08-03Refactor server retrieval API calls.spisarski1-4/+4
Refactored nova_utils#get_servers_by_name() to get_server() and include a VmInstSettings object in addition to the server_name parameter as well as only returning one VmInst object. JIRA: SNAPS-168 Change-Id: I30c22a36b07ce143ee8c1c76a77fd75f0062e4aa Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-28Removed floating IP list from OpenStackVmInstance.spisarski1-0/+45
There was a list and dict both holding the same floating IP objects which has been problematic especially when trying to initialize the object with a VM instance that already exists. JIRA: SNAPS-149 Change-Id: If4af6dfef04a40b9c8cd7a8add484c9ec03f1ef8 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-27Ensure library and tests close all necessary resources.spisarski1-1/+4
The SNAPS-OO library and tests had left open files, ssh, and scp connections. These have all now been wrapped with try/finally blocks. JIRA: SNAPS-152 Change-Id: I43e09978b5c075bd78ff3279c0799556b8758878 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-21Merge "Changes required for running CI tests (Pike pod)."Steven Pisarski1-3/+3
2017-07-20Changes required for running CI tests (Pike pod).spisarski1-3/+3
Added support for HTTPS proxies HTTPS OSCreds settings for both RC file and os_env.yaml OSCreds 'cacert' T/F and cert file path support OSCreds API version support cleanup including the addition of heat Added more OSCreds test validations Disabling of InsecureRequestWarning PEP8 line width refactoring heat_utils_test.py fix when stack status is error test suite for CI removed default flavor metadata of mem_page_size: Any to None JIRA: SNAPS-80 Change-Id: I333e83ca79d7403bf43a9b74da4c072b4da976ba Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-18Created custom exceptions for VM instance creation.spisarski1-16/+18
Created VmInstanceSettingsError for errors creating VmInstanceSettings objects Created FloatingIpSettingsError for errors creating FloatingIpSettings objects Created VmInstanceCreationError for errors creating VM instances JIRA: SNAPS-132 Change-Id: I588ae34bf066c8440755a8bf4f3721b946533d99 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-18Merge "Added proper assertion config NIC test."Steven Pisarski1-32/+24
2017-07-17Added proper assertion config NIC test.spisarski1-32/+24
The test that exercises the OpenStackVmInstance class config_nic() now checks the Ansible return code. JIRA: SNAPS-124 Change-Id: I7840cd53eea2eacf7952d14be30870c8fa3aeab8 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-17Last task necessary to stop users from easily obtaining OS objects.spisarski1-24/+17
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-13Created domain class for ports.spisarski1-4/+4
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-06-22Use neutron to create floating IPs.spisarski1-29/+40
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-06-20Changes to VMInstanceSettings and FloatingIPSettings constructors.spisarski1-416/+824
Removed named parameters and replaced with kwargs. JIRA: SNAPS-97 Change-Id: I9e313c342a8fd5a99f3ce6e7274406f8a29b8c8b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-06-06Added custom security group with ICMP and SSH rules.spisarski1-21/+81
This was done for all tests exercising floating IPs. Also added check to all of these tests to ensure the VMs all have received their private IP address via DHCP. JIRA: FUNCTEST-834 Change-Id: I88ae2fecc3f8e507641adf24cb65a0583f4db24c Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-16Added support for offline testingspisarski1-39/+423
Expanded the image_metadata used by the tests for overriding default images for not only supporting 3part images but also to support offline testing as required by Functest. JIRA: SNAPS-67 Change-Id: I6975e7b51fa879fe984af64402939c465df95184 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-08Modified code to support both Python 2.7 and 3.xspisarski1-116/+117
* 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-05-03Changed image metadata to support cirros, ubuntu, and centos.spisarski1-11/+12
The image metadata that was designed for multi-part form support did not take into account tests that require ubuntu or centos tests. JIRA: SNAPS-76 Change-Id: I95c7b74b8f7d7b78c3842b5e716fd7b466107c9c Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-03Merge "Refactored multi-part images."Steven Pisarski1-385/+83
2017-05-02Matching test_check_vm_ip_dhcp on ip onlyDan Radez1-8/+3
No nee dto look for the string surrounding the ip that's being looked for in this test. simplifying the code to only look for the ip Change-Id: I80e6336c58573e5970eafe2608daf7c61e43b717 Signed-off-by: Dan Radez <dradez@redhat.com>
2017-04-27Refactored multi-part images.spisarski1-385/+83
The logic used for creating multi-part images for the Danube release was copied all throughout the tests, which was not sustainable. This patch encapsulates the kernel and ramdisk images within the same OpenStackImage object as the disk image. JIRA: SNAPS-59 Change-Id: I45ec0ccc666accb4e768c41e249e6130dc07f6d1 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-04-13Ensuring each port manipulation test waits for the instance to become activespisarski1-4/+4
The problem with OpenStack is that when one attempts to delete an instance that is still spawning, it can take an inordinate amount of time for OpenStack to complete the request resulting in artifacts being left. JIRA: SNAPS-64 Change-Id: I39f33291e650c00a8b5a40cb0051b99b71923acf Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-04-11Merge "Fixed two tests that never had their networks removed on tearDown()"Randy Levensalor1-4/+10
2017-04-11Fixed two tests that never had their networks removed on tearDown()spisarski1-4/+10
JIRA: SNAPS-56 Change-Id: I43d47f59f5b15805dce425f148ec5c990055ca73 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-03-23Check for kernel_url and ramdisk_url keys in dictCatalina Focsa1-36/+41
Need to check if the above keys exist in image_metadata before checking for their assigned values in case they are not declared (e.g. obsolete when creating a one part image) Change-Id: I22fa259b320a425d6ad030eeb9bf68b4c06b667f Signed-off-by: Catalina Focsa <catalina.focsa@enea.com>
2017-03-10Merge "Add DEBUG logs to SimpleHealthCheck for VM console output."Steven Pisarski1-19/+45
2017-03-10Add DEBUG logs to SimpleHealthCheck for VM console output.spisarski1-19/+45
The test in the class SimpleHealthCheck uses the console output to determine whether or not the VM obtains a DHCP lease which contains a very image-specific check. When a client changes the image from what the test was designed for, the console output can change causing the test to fail unless it is simply timing out. This patch will output the full console log on failure or on success when the logger is configured as DEBUG. JIRA: SNAPS-47 Change-Id: I2041ca1aed8bd1e2fb65932591f4acbd4d3cd720 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-03-10reduce instance's memory sizeSerenaFeng1-7/+7
when using snaps to test small OpenStack env(devstack or all-in-one), testcase will fail due to not enough memory for a vm. As a basic test using cirros, only allocating ip and test the connectivity is needed, 128M should be enough. the error msg is: File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 80, in request raise exceptions.from_response(resp, body, url, method) ClientException: Unknown Error (HTTP 504) Change-Id: Ibfb27018ffd25292bcf80f69e8cb205b2c9c334b Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-03-08Merge "Adapt integration tests to use custom image config"Steven Pisarski1-56/+217
2017-03-08Adapt integration tests to use custom image configCristina Pauna1-56/+217
This fix uses the possibility to pass custom imformation about the image via image_metadata variable. In the integration tests it checks for this info and creates a 3-part image if the kernel_url and ramdisk_url are set. The fix also allows the default url to be overriden as well as passing extra-properties. All the metadata info comes from the app. The part in functest where the custom config is set for creating a 3-part image is https://gerrit.opnfv.org/gerrit/29987 Change-Id: Ib2ad823705dbea68d672514c7c89b150c9c6dc63 Signed-off-by: Cristina Pauna <cristina.pauna@enea.com>
2017-03-06Add check that SSH validate returns truerandyl1-2/+2
The SSH Validate call needs to be checked before passing tests. test_ssh_client_fip_before_active and test_ssh_client_fip_after_active run the SSH Verify function, but do not check the return value. You will see an error in the test log file, but the test will appear to have passed. JIRA: SNAPS-45 Added an Assert True test to the SSH Validate return. Change-Id: Ib86ec38c7b5a64061a1ace4293336e3021c59013 Signed-off-by: randyl <r.levensalor@cablelabs.com>
2017-03-06Adapt simple health check to use 3-part imageCristina Pauna1-13/+31
This fix adds the possibility to pass custom imformation about the image via image_metadata variable. In SimpleHealthcheck it checks for this info and creates a 3-part image if the kernel_url and ramdisk_url are set. The fix also allows the default url to be overriden as well as passing extra-properties. All the metadata info comes from the app. The part in functest where the custom config is set for creating a 3-part image is https://gerrit.opnfv.org/gerrit/#/c/29851/ JIRA: ARMBAND-222 Change-Id: I11435d8bab4cf097b4079b6984741869f83aee2b Signed-off-by: Cristina Pauna <cristina.pauna@enea.com>
2017-03-06Added the ability to give the tests the ability to add in flavor metadata.spisarski1-20/+29
NFVI's configured for OVS/DPDK and fd.io scenarios required special metadata for flavors in order for VM instances to be activated. This patch allows for setting a value to be applied to all tests. With this change, the default value is being removed that only partially addressed this issue. JIRA: SNAPS-38 Change-Id: Ic42944a849f710f631fe7ac6fbefb720a73f0b77 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-03-01Merge "Add support for extra properties in an image"Steven Pisarski1-0/+125
2017-03-01Add support for extra properties in an imageCristina Pauna1-0/+125
This patch adds a new setting for images, extra_properties. This field is a dict and can be used to create a 3-part image by setting the kernel_id and the ramdisk_id of the main image. Unit tests have been added to set some generic property, for creation of the 3-part image, and for creating an instance with that 3-part image JIRA: SNAPS-32 Change-Id: Ifb53d1da1085fcd6429ddc0607c905522db5e8bb Signed-off-by: Cristina Pauna <cristina.pauna@enea.com>
2017-02-28Ensuring all instances must have ports/network.spisarski1-51/+58
Fixing the addition of security groups during server instantiation. JIRA: SNAPS-35 Change-Id: Id29b18ba1454538e2cd72ffa33ed3dc47120944f Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-02-24Improve way to check instances getting an IPjose.lausuch1-4/+12
JIRA: SNAPS-33 Change-Id: I7f8e0ff80da97f6be6df21b20e0a878f2fc18636 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-02-15Initial patch with all code from CableLabs repository.spisarski1-0/+1474
Change-Id: I70a2778718c5e7f21fd14e4ad28c9269d3761cc7 Signed-off-by: spisarski <s.pisarski@cablelabs.com>