summaryrefslogtreecommitdiff
path: root/openstack_dashboard/dashboards/project/instances/tests.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Support for Glance v2"Jenkins2016-09-161-37/+126
|\
| * Support for Glance v2Julie Pichon2016-09-121-37/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements wrappers necessary for Horizon to work with either Glance v1 or v2 and removes the dependency on the Glance v1 endpoint. Handles the differences between setting properties with v1 and v2 and restricts some Glance functions that aren't supported in v2. Implements blueprint: horizon-glance-v2 Co-Authored-By: Travis Tripp <travis.tripp@hp.com> Co-Authored-By: Brad Pokorny <Brad_Pokorny@symantec.com> Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com> Co-Authored-By: Liuqing Jing <jing.liuqing@99cloud.net> Change-Id: Icca91c53eabf18c3109b3931ed53f70eaaaa0e56
* | Modify use of assertTrue(A in B)Bin Zhou2016-09-031-1/+1
|/ | | | | | | | Developers should use assertIn(A, B) instead of assertTrue(A in B ). TrivialFix Change-Id: I93f3c540e4cc9015162283ea71813613a13e3555
* Make 'switch' between legacy and Angular ImagesMatt Borland2016-08-051-5/+0
| | | | | | | | | | | | | | | | | | This patch follows on the example that the Containers set, providing a 'switch' in the panel-enablement file that currently defaults to 'legacy' (Python-based Images panel) and allows for 'angular' (Angular- based Images panel). To be clear, this does NOT enable Angular Images. It's just setting the stage to do so at some point, or to allow deployers/devs to easily switch between the two. A switch both for HORIZON_CONFIG and for integration tests is necessary due to the way integration tests operate. Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com> Change-Id: I12cd33552218ed1082d2d9a2ae8982639a217a6a Partially-Implements: blueprint angularize-images-table
* Merge "Implement Manage Attachments in Instances"Jenkins2016-06-301-0/+86
|\
| * Implement Manage Attachments in InstancesAnkur Gupta2016-06-281-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow users in Project view/tables the option to attach existing volumes to an instance. This allows user to be able to attach existing volumes without having to switch tabs or views from instance to volume. Allowing for greater ease of access. Co-Authored-By: Eric Peterson <eric.peterson1@twcable.com> Closes Bug: #1518459 Partially Implements Blueprint: manage-volume-instance-views Change-Id: I9daf508b181aaaf2ac003639f8ab9729442e201b
* | Merge "Make sure we always get all limits"Jenkins2016-06-241-12/+13
|\ \
| * | Make sure we always get all limitsItxaka2016-06-081-12/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | When checking with nova for the absolute limits we were not taking into account the reserved quotas (i.e. instance in rebuilding will take cpu and ram) so this could lead to wrongly thinking that the user could launch more instances that its quota allowed. It also made the overview page display wrong quotas as it didnt took into account those reserved resources. Change-Id: If51470d185ddc122acbdf4cf0d0fd952f3f791a0 Closes-bug: 1561310
* | Horizon selects are now themable: Launch InstanceDiana Whitten2016-06-081-1/+1
|/ | | | | | | | | | | | Horizon was using a standard select input. Unfortunately, this type of input is only customizable to a small extent. Co-Authored-By: Ryan Peters <rjpeter2@gmail.com> Co-Authored-By: Matthew Wood <woodm1979@gmail.com> Co-Authored-By: Brian Tully <brian.tully@hp.com> Change-Id: Iaf8427c3fff6d2fbfae944731fd9f6f754ed7c31 Partially-implements: blueprint horizon-theme-css-reorg
* Choose a server group when booting a VMBrad Pokorny2016-05-031-8/+85
| | | | | | | | | Allow users to choose a server group when booting a VM. Adds a dropdown list to select a server group to the Launch Instance workflow. Change-Id: I0b0d5ec79841da3da569bd22c533fdbf76002c96 Partially-Implements: blueprint nova-server-groups
* removing httplib2 test dependencyDavid Lyle2016-05-021-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once upon a time, the python-*client libraries were primarily built to use httplib2. They have subsequently shift to using requests and thus urllib3. The horizon test helpers code was maintaining a reference to httplib2 as it intercepted errant library calls that were not mocked. httplib2 is not actively maintained and OpenStack is moving to remove it as a dependency. See http://lists.openstack.org/pipermail/openstack-dev/2016-March/089225.html for more details. This patch removed the httplib2 dependency. Upon removing the dependency it exposed a missed update from httplib2 to urllib3. A function that was intended to catch unmocked calls was only listening for httplib2 connections. This patch updates that failsafe to work with urllib3. Upon doing so, it pointed out many, many missing mocks and in turn, many broken tests that appeared to work because of API call failures. This patch adds the missing mocks and fixes the broken tests. The new failsafe prints the stack trace when an outside connection is attempted. Additionally, to fix the fact that a missed mock used to allow tests to potentially pass, as documented by bug 1517704, a test failure is now forced on tests where a missing mock is detected. Closes-Bug: #1517704 Implements blueprint: remove-httplib2-dep Change-Id: Iaabdf03966c14c82e0c58a3b1ab1a6755c05adcb
* Allow delete servers in error stateMarcos Fermin Lobo2016-04-181-0/+25
| | | | | | | | | | | | | | | | | In instance list, when we have one/multiple servers in error state, Horizon does not display "Terminate instances" button in top-right side (close to "Launch instance" button). So, Horizon does not allow terminate instances in error state. When you click on "DELETE INSTANCE" button in Horizon, and something went wrong (for example, the message to delete did not arrive to Nova or Nova was stuck during the deletion process), you can see the instance in "deleting" status forever. Right now, in this status, the "delete instance" button disapears, so the user can not "retry" the deletion. Change-Id: I6486d6989d4bd89d5c9346125aa01ec1359352d4 Closes-bug: #1557353
* Fix remaining Django 1.9 test failuresRob Cresswell2016-04-091-1/+2
| | | | | | | | | This patch gets Horizon to a passing state in the Django 1.9 tests Co-Authored-By: Itxaka <iserrano@redhat.com> Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com> Change-Id: Icbc1a3c039de658faa9fba4a2cdd5027345fe94d Partially-Implements: blueprint drop-dj17
* Enable Angular Launch Instance by defaultRob Cresswell2016-03-031-4/+3
| | | | | | | | | | | | | | This patch enables the Angular Launch Instance workflow by default. The toggle has been maintained for those running the Python workflow, and also for the integration tests to run against both simultaneously. Keep integration tests running for a legacy Launch Instance workflow by means of a separate local_settings.d code snippet activated before starting the tests. Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com> Change-Id: Id0c57b33df46397711e32092cec6cc5268841779 Implements: blueprint enable-angular-launch-instance
* Horizon Checkboxes are now themeable.Diana Whitten2016-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | Horizon checkboxes were using a standard checkbox. Unfortunately, this type of checkbox is only customizable through Chrome, and even then, its not completely flexible. The default checkboxes have now been altered to allow for a highly customized experience through the use of CSS pseudo elements and Icon Fonts. This allows the color, size and unselected and selected states of the checkbox to be customized. The 'default' theme uses the standard Font Awesome checked and unchecked icons. The 'material' now uses the Material Design checkbox design. It was also noticed (and fixed) that the help-icon on the forms were not the same color as its corresponding text. Partially-Implements: blueprint horizon-theme-css-reorg Change-Id: I52602357d831a5e978fe6916b37b0cde9edb2b9b
* Merge "Add missing network mock"Jenkins2016-02-121-1/+2
|\
| * Add missing network mockItxaka2016-02-111-1/+2
| | | | | | | | | | | | | | | | | | InstanceAjaxTests.test_row_update_flavor_not_found was missing a mock for servers_update_addresses causing an error to log while runnig the tests Change-Id: I15bdab7add2e403110a8d85a77ef49aa11ae03ac Closes-Bug: #1544585
* | Merge "Allow setting default value for config_drive"Jenkins2016-02-111-0/+10
|\ \ | |/ |/|
| * Allow setting default value for config_driveJustin Pomeroy2016-02-101-0/+10
| | | | | | | | | | | | | | | | This adds a setting that can be used to specify the default value for the Configuration Drive option when launching an instance. Closes-Bug: #1537106 Change-Id: If402d3331158b462bece27fa6fce2bdb7f6a4a2e
* | Merge "Refresh the networks on ajax update"Jenkins2016-02-101-1/+3
|\ \
| * | Refresh the networks on ajax updateItxaka2016-01-261-1/+3
| |/ | | | | | | | | | | | | | | | | If using neutron, the ajax will query the last status from nova which could be out of date, so any floating ips added wont show up unless you refresh the whole page. Change-Id: Iad1684d1a2fb677ee8850a98c8219794698722e3 Closes-Bug: 1505935
* | Add Network Port selection to instance launchItxaka2016-02-051-22/+253
|/ | | | | | | | | | | Adds a new step to the launch instance wizard to select any available ports to attach on launch. Modifies the existing tests to take the new step and calls insto consideration. DocImpact: Add port info to user-guide/dashboard_launch_instances.html Change-Id: I97b24be0d75b69638aeb52bda7d0d0541a80663a Implements: blueprint allow-launching-ports
* Merge "Trust sql middleware value conversion and stick to the spec type."Jenkins2016-01-221-1/+1
|\
| * Trust sql middleware value conversion and stick to the spec type.Romain Chantereau2015-05-201-1/+1
| | | | | | | | | | | | | | Co-Authored-By: Sylvain Baubeau <sylvain.baubeau@enovance.com> Closes-Bug: #1457028 Change-Id: I2c5bc22c2e024e22ad641d2b367fa3de2dd7636b
* | Merge "Make unit testing less reliant on HTML fragments"Jenkins2015-12-031-21/+57
|\ \
| * | Make unit testing less reliant on HTML fragmentsSteve McLellan2015-11-301-21/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests check for equality with quite large HTML fragments, when the test is only interested in certain specific things (and not style changes etc). This patch alters some of those tests (specifically ones that were tripping up a dependent patch, but can be expanded) to check the context data of the response, since the actual rendering is tested by horizon's tests. It also adds tests to check context data in 'normal' circumstances so that no test coverage should be lost by this. Change-Id: I09be82058edc923521ffb4c022515845a18b158d Closes-Bug: #1517084
* | | Replace "Terminate Instance" with "Delete Instance"Akihiro Motoki2015-11-301-6/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | "Delete" is being used almost everywhere in OpenStack Dashboard except the instance panel. Using "Delete" looks more consistent. In addition, "Delete" tells non-native English speakers that deleted instances will be no longer usable again compared to "Terminate". DocImpact Closes-Bug: #1502773 Change-Id: Idccaf3c45566f20f11d02ada64c1d3934a6f3002
* | Port project instance tests to Python 3Victor Stinner2015-11-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix division: replace a/b with a//b to get integers * test_clean_file_upload_form_invalid_data(): use a byte string, not an unicode string for the test. The test ensures that decoding from UTF-8 fails. * quotas: replace filter() with a list-comprehesion to get a list on Python 3. * tox.ini: add the following tests to Python 3.4 - openstack_dashboard.dashboards.project.instances.tests - openstack_dashboard.test.tests.quotas * tox.ini: add also --exclude-dir=openstack_dashboard/test/integration_tests to openstack_dashboard tests on Python 3.4 Partial-Implements: blueprint porting-python3 Change-Id: I7caed713222b50ffec431155e6f91b543f7df466
* | Mock flavor_list method in tests for instancesRajat Vig2015-10-281-0/+12
| | | | | | | | | | | | | | | | | | nova.flavor_list is not mocked in the tests and that is causing test failures in jenkins. Closes Bug: #1511109 Change-Id: I6b9a457e103571d16dc54f94dae86c8d89feb4cb
* | Remove an unnessary assert call in InstanceTestsCindy Lu2015-10-051-4/+1
| | | | | | | | | | | | Also uncomment an old test case since Django is now <1.9, >=1.7. Change-Id: I25d133f55b8f457c292ab3f51c08d06f30b41ad6
* | Enable pagination for Project->Images viewchenhaiq2015-09-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature is already implemented, but not enabled because it has strange behavior when the image list is filtered by removing aki and ari type of images. The pagination for images view should be enabled since the filtering image code was removed in: https://review.openstack.org/#/c/59935/ Because the ImagesTable is the only one being incorporated into the images view, there is no need to include table.name attribute into _prev and _more attributes of the view (no other tables to distinguish between). This is a refreshment of https://review.openstack.org/#/c/58928/ (which I cannot update because it's abandoned). Change-Id: Ib027a548ee8aa623f0faea86f0ad7570d6ec2360 Co-Authored-By: chenhaiq <chenhaiq@cn.ibm.com> Closes-Bug: #1252649
* | Couldn't provision instance from volume snapshotlyanchih2015-09-181-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When user create instance from volume snapshot. Horizon will send request to nova and it contain some information about block device mapping. But the source type was assigned 'volume'. Therefore nova will recognized this instance was boot from volume instead of snapshot, then nova couldn't find the id of volume. The source type of block device mapping should be determined by whether this instance was boot from volume or snapshot. Closes-Bug: 1474283 Change-Id: I38765513833a03f632be11e168efad28aedcf7f0
* | Enable compute shelve/unshelve commandsCedric Brandily2015-09-111-0/+145
| | | | | | | | | | | | | | | | This change enables shelve/unshelve commands in user/admin views. Closes-Bug: #1285389 Implements: blueprint horizon-shelving-command Change-Id: I15e1e5d2fdb3d246a7f3e7e676c4b364694410fb
* | Launch instance create volume failsDavid Lyle2015-09-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From both launch instances, if selecting create volume the value passed for delete_on_termination is converted to an int. This causes launch instance to fail with an error like: Error: Invalid input for field/attribute delete_on_termination. Value: 0. 0 is not of type 'boolean', 'string' (HTTP 400) (Request-ID: req-aee15975-0351-4477-9007-f8fd090bcc49) This is returned from the nova API. The only reference I can find for the value type is: https://github.com/openstack/nova/blob/master/nova/objects/block_device.py#L75 This change leaves the value as a boolean in both workflows and converts the tests appropriately. Closes-Bug: #1494067 Change-Id: I54591269eafe5b89b49a13c29c53611c100d600e
* | Merge "Replace SortedDict with OrderedDict"Jenkins2015-09-091-5/+5
|\ \
| * | Replace SortedDict with OrderedDictMasco Kaliyamoorthy2015-09-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From django V1.9 django.utils.datastructures.SortedDict will be removed and it is deprecated in V1.7. The similar functionality is added in collections.OrderedDict from python 2.7. Horizon code also should avoid the SortedDict class and start using the OrderedDict class. This patch replacing the SortedDict with OrderedDict. Change-Id: I8dfcf7c29fc49b6215451f160cf7a951bf11b5ad Closes-Bug: #1492270
* | | Merge "Fix a unit test for create instance"Jenkins2015-09-071-1/+4
|\ \ \
| * | | Fix a unit test for create instanceSaksham Varma2015-09-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test_launch_form_keystone_exception test method calls the handle method of the LaunchInstance class. Changes made to the handle method in [1] introduced a new neutron api call that was not being mocked out, causing an unexpected exception in the _cleanup_ports_on_failed_vm_launch function of the create_instance module, while running the test_launch_form_keystone_exception unit test [1] https://review.openstack.org/#/c/202347/ Closes-Bug: 1492065 Change-Id: Ib3ad9146339a60b8d53e849091abf6a9bb64de93
* | | | Merge "Add config setting to require keypair on instance create"Jenkins2015-09-041-4/+20
|\ \ \ \
| * | | | Add config setting to require keypair on instance createericpeterson-l2015-09-011-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: bug #1283148 Change-Id: Ia20afae2b3553f8f43080bc03863d87486a386ab
* | | | | Merge "Use security group id not name in the create instance dialog"Jenkins2015-09-031-19/+19
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Use security group id not name in the create instance dialogRadomir Dopieralski2015-08-241-19/+19
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's possible to create multiple security groups with the same name, and then launching an instance will error with "Error: Multiple security_group matches found for name 'foo', use an ID to be more specific." The solution is to use the group id instead of group name in the form. This only works with Neutron, because Nova-Network not only requires the groups to be passed by name, but also passes them by name internally in several places. Change-Id: I83587e15a8c18d64a29fd1083e786a73162b19f9 Partial-bug: #1203413
* | | | Logout user if he has no valid tokensVlad Okhrimenko2015-08-291-1/+12
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, if user's rights were changed or revoked - there would be "Unauthorized" errors on every page since user had no rights to view them because he had no valid tokens in that case. Now user will be logged out if he has no valid tokens. Set `escalate` to True (for unauthorized-error) to always log user out. Also, now horizon.exceptions.NotAuthorized is a part of UNAUTHORIZED tuple in the exceptions.py, because this type of exception is re-raised after handling services unauthorized errors. Looks like it was missing. Now the horizon.exceptions.NotAuthorized is handled like all NotAuthorized exceptions. And horizon_middleware.py in process_exception now generates logout_reason for cases if user is not authorized. Closes-Bug: #1252341 Closes-Bug: #1407105 Co-Authored-By: Paul Karikh <pkarikh@mirantis.com> Change-Id: I417cad936ea80c0569c2f442fc87cbd58745757e
* | | py3: Replace unicode with six.text_typeVictor Stinner2015-08-271-5/+7
|/ / | | | | | | | | | | | | | | | | Initial patch generated by: sixer.py unicode horizon openstack_dashboard/ tools/ Partial-Implements: blueprint porting-python3 Change-Id: I8bdec74fbe32a6ff0e65f2f0810a0c698a3b9637
* | Merge "Port cleanup on failed VM instance launch"Jenkins2015-08-121-0/+126
|\ \
| * | Port cleanup on failed VM instance launchSaksham Varma2015-08-111-0/+126
| | | | | | | | | | | | | | | | | | | | | Currently if a VM instance launch fails, stale VM ports are left behind Change-Id: I12fcd8263af81b81f4512a95da6e42b08e2e41ec Closes-Bug: 1423453
* | | Use charset instead of _charset for dj18 responselin-hua-cheng2015-07-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | In django-1.8, the charset attribute has been added. Trying to access _charset returns None in django-1.8. Partially Implements: blueprint django18 Change-Id: Id80d5c16aa41706bfe5dfdd026c168ed64289954
* | | Replace mox with mox3Victor Stinner2015-07-131-2/+2
|/ / | | | | | | | | | | | | | | | | mox doesn't work on Python 3, whereas mox3 works on Python 2 and Python 3. Cinder, Nova and many other projects already replaced mox with mox3. mox3 is now maintained by OpenStack. Partial-Implements: blueprint porting-python3 Change-Id: I10e6a9754ebd58a2640d73ec8966527c3aa1fe9a
* | Merge "Use bdmv2 format when instance is boot from volume"Jenkins2015-06-101-5/+34
|\ \
| * | Use bdmv2 format when instance is boot from volumeArvinder Singh2015-03-171-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently boot from volume uses bdmv1 format. In this blueprint bdmv2 format will be used for block device mapping instead bdmv1 format if V2 extension api is supported else bdmv1 format will be used. Unit tests have been added. implements bp horizon-block-device-mapping-v2 Change-Id: I3a6b89d690966080c85b629e0b2b7f2a790a0aaf