summaryrefslogtreecommitdiff
path: root/openstackclient/tests/image/v1
Commit message (Collapse)AuthorAgeFilesLines
* image list: Add Checksum columnMarc Abramowitz2016-07-111-0/+2
| | | | | | | | | The checksum could potentially be useful for spotting duplicated images or checking if images with the same name are identical or different. Closes-Bug: #1602073 Change-Id: Ia0c41970c846d550de14297e18bc738e847e5a3b
* Make set/unset commands in compute/image/common return normally when nothing ↵Tang Chen2016-06-211-2/+2
| | | | | | | | | | specified After this patch, all set/unset commands will return normally when nothing specified. Change-Id: Id94d0329faa1a674006a9aae901f834b41917317 Close-bug: #1588588
* osc-lib: utilsDean Troyer2016-06-131-1/+1
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* osc-lib: exceptionsDean Troyer2016-06-131-1/+2
| | | | | | | | Use osc-lib directly for exceptions. Leave openstackclient.common.exceptions for deprecation period. Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
* [Image] Check return value is None in image unit tests.Tang Chen2016-03-021-11/+15
| | | | | | | | | take_action() in commands inheriting from Command returns nothing. So we should assert the return is None in the unit tests of these commands. Change-Id: I237ea772f74fa52af2e9aacd35d4b9cfb225c94c Partial-Bug: #1550636
* Fixed a bunch of spacingBrandon Palm2016-02-231-0/+2
| | | | | | | Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
* Fix DisplayCommandBase comments for cliff ShowOne subclass testsTang Chen2016-02-101-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As bug #1477199 describes, the wrong comment below is all over the unit test code of OSC. # DisplayCommandBase.take_action() returns two tuples There is no such class named DisplayCommandBase in OSC. It is in cliff. All OSC command classes inherit from the base classes in cliff, class Command, class Lister and class ShowOne. It is like this: Object |--> Command |--> DisplayCommandBase |--> Lister |--> ShowOne take_action() is an abstract method of class Command, and generally is overwritten by subclasses. * Command.take_action() returns nothing. * Lister.take_action() returns a tuple which contains a tuple of columns and a generator used to generate the data. * ShowOne.take_action() returns an iterator which contains a tuple of columns and a tuple of data. So, this problem should be fixed in 3 steps: 1. Remove all DisplayCommandBase comments for tests of classes inheriting from class Command in cliff as it returns nothing. 2. Fix all DisplayCommandBase comments for tests of classes inheriting from class Lister in cliff. Lister.take_action() returns a tuple and a generator. 3. Fix all DisplayCommandBase comments for tests of classes inheriting from class ShowOne in cliff. ShowOne.take_action() returns two tuples. This patch finishes step 3 in all but identity tests. There are too many such comments in identity tests. So fix them all in another patch. Change-Id: I1afe4852069d25d562a9448ec2bf2cff58955052 Partial-bug: #1477199
* Fix DisplayCommandBase comments for cliff Lister subclass testsTang Chen2016-02-091-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As bug #1477199 describes, the wrong comment below is all over the unit test code of OSC. # DisplayCommandBase.take_action() returns two tuples There is no such class named DisplayCommandBase in OSC. It is in cliff. All OSC command classes inherit from the base classes in cliff, class Command, class Lister and class ShowOne. It is like this: Object |--> Command |--> DisplayCommandBase |--> Lister |--> ShowOne take_action() is an abstract method of class Command, and generally is overwritten by subclasses. * Command.take_action() returns nothing. * Lister.take_action() returns a tuple which contains a tuple of columns and a generator used to generate the data. * ShowOne.take_action() returns an iterator which contains a tuple of columns and a tuple of data. So, this problem should be fixed in 3 steps: 1. Remove all DisplayCommandBase comments for tests of classes inheriting from class Command in cliff as it returns nothing. 2. Fix all DisplayCommandBase comments for tests of classes inheriting from class Lister in cliff. Lister.take_action() returns a tuple and a generator. 3. Fix all DisplayCommandBase comments for tests of classes inheriting from class ShowOne in cliff. ShowOne.take_action() returns two tuples. This patch finishes step 2 in all but identity tests. There are too many such comments in identity tests. So fix them all in another patch. Change-Id: I00f38d12f55abe20fa708f6349073da658622f8d Partial-bug: #1477199
* Fix DisplayCommandBase comments for cliff Command subclass testsTang Chen2016-02-091-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As bug #1477199 describes, the wrong comment below is all over the unit test code of OSC. # DisplayCommandBase.take_action() returns two tuples There is no such class named DisplayCommandBase in OSC. It is in cliff. All OSC command classes inherit from the base classes in cliff, class Command, class Lister and class ShowOne. It is like this: Object |--> Command |--> DisplayCommandBase |--> Lister |--> ShowOne take_action() is an abstract method of class Command, and generally is overwritten by subclasses. * Command.take_action() returns nothing. * Lister.take_action() returns a tuple which contains a tuple of columns and a generator used to generate the data. * ShowOne.take_action() returns an iterator which contains a tuple of columns and a tuple of data. So, this problem should be fixed in 3 steps: 1. Remove all DisplayCommandBase comments for tests of classes inheriting from class Command in cliff as it returns nothing. 2. Fix all DisplayCommandBase comments for tests of classes inheriting from class Lister in cliff. Lister.take_action() returns a tuple and a generator. 3. Fix all DisplayCommandBase comments for tests of classes inheriting from class ShowOne in cliff. ShowOne.take_action() returns two tuples. This patch finishes step 1 in all but identity tests. There are too many such comments in identity tests. So fix them all in another patch. Change-Id: I9849baa8141ea8af2042a69afd540b77ce6ae6bd Partial-bug: #1477199
* Refactor abstract columns and datalist out in image and objectSaiKiran2016-01-231-45/+23
| | | | | | | | | | | test cases columns and datalist has been set in each test case in image and object which is not necessary. This patch abstract it out and remove all redundant code. Change-Id: Ie6aa3fa27ab2a468c67da31209107517259631c2 Related-Bug: 1532384
* Change --owner to --project in image commandsDean Troyer2016-01-151-3/+6
| | | | | | | | | | * image create and image set now use --project to specify an alternate project to own the image * --owner is still silently accepted but deprecated, add warning messages * --project and --owner are mutually exclusive to prevent precedence issues Closes Bug: 1527833 Change-Id: Iccb1a1d9175ef9b5edcd79d294607db12641c1f0
* Add status column for "openstack image list"xiexs2015-11-291-10/+15
| | | | | | | | | Actually, the status column is useful for the user. So, it`s better to output this info by default (or, user had to specify the extra option, i.e. --long). Change-Id: Id2a9f86f0de5310f8f5ff9a46bf1b7411094b519 Closes-Bug: #1519181
* image set should not show the resourceSteve Martinelli2015-10-061-10/+2
| | | | | | | | the rest of OSC set commands do not show the resource after it has been updated. unless the update fails then we report back a failure, otherwise the user should assume everything went fine. Change-Id: I2bd4188450c3853b4a1bc25f80fc9450cda32bdd
* Merge "Move update code from image create command"Jenkins2015-07-021-67/+65
|\
| * Move update code from image create commandMarek Aufart2015-07-021-67/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Openstack image create command updates existing image (with same name) by default. That might be confusing since glance allows create multiple images with same names and may lead to unwanted image update by image create command. Image update code was moved from image create action to image set action. BackwardsIncompatibleImpact Change-Id: I1686c6544c366262efab9e33c066d5f8a667f707 Closes-Bug: #1461817
* | Add functional tests for image setTerryHowe2015-06-161-2/+4
|/ | | | | | | | | | | | | | | | This patch includes functional tests for image set and it includes a change to use the OSC utils.format_dict method to format the properties. This will give a more user friendly format to the image commands and it gives a more consistent testable format to the output. Instead of: {u'a': u'b', u'c': u'd'} The user will see: a=b, c=d Change-Id: Ib396316586ffc5dbab231064d5b6dc9425507934
* Add missing properties to image set commandAmey Bhide2015-05-251-0/+9
| | | | | | | | Enable user to update the following image properties from OSC: container-format, disk-format, size Closes-Bug: #1446362 Change-Id: Id9f40f15702e8f14f0327a37fcc7d7971338c258
* Add image show testsDean Troyer2015-05-011-0/+33
| | | | | | | | | Image v2 uses warlock objects rather than the usua Resource objects so we need to test for those. This adds a subset of the Image v2 schema that should be enough to test for proper warlock image handling. Depends-On: Ic95db2f63d9f5f37e29f0d7e048397da311fbf8c Change-Id: Ib89cce87f110a554f40e726718e31d39b500a6ae
* Handle the pagination for image listTerryHowe2015-04-201-7/+13
| | | | | | | Handle the paginatiion for image list. We were sorting the data here, so nothing lost for the generator. Change-Id: I2d7d4b3d5c9f650953f309c971ac53b64f6f7f77
* Add sort support to image listzhiyuan_cai2015-02-061-0/+29
| | | | | | | | | | Add sort support to image list by sorting items in the client side. The parameter syntax follows this spec[1]. [1] https://review.openstack.org/#/c/145544/ Change-Id: I42b487d18f00f937db1938daa46487cea2a896ab Closes-Bug: #1410251
* Add filter to image listDean Troyer2015-01-271-2/+51
| | | | | | | | | | | | | | | * Hides previously broken --page-size option * Adds --property to image list for filtering on properties * Adds Visibility, Protected, Owner, Properties/Tags to --long output * Adds api.utils.simple_filter() for selecting matches out of a list of objects * Adds tests for all of the above * Updates image docs There are additional filtering options to be added in later reviews. Change-Id: I32feff0ad61aae749b33621c817658d7dc90c3aa Closes-bug: 1401902
* fix the wrong order of assertEqual argswanghong2015-01-271-4/+4
| | | | | | Let's fix them thoroughly. Change-Id: I8a1f042fb614b05c9836a49041f3883638b870b0
* Begin low-level API for Image v1 and v2Dean Troyer2015-01-201-45/+122
| | | | | | | | | image list for v1 and v2: * Add --public|--private to command parsers * Implement local public/private filtering for v1 image_list() * Pass public/private filter to server for v2 image_list() Change-Id: Ie7c24ea2d1bf2b3b1b7fa342eb45fee45894634d
* add multi-delete support for compute/image/net/volumewanghong2014-12-231-1/+1
| | | | | | | | | | | | | | This is part1, add support for these objects: compute.server imagev1.image imagev2.image network.network volume.volume volume.backup volume.snapshot Closes-Bug: #1400597 Change-Id: Ice21fee85203a8a55417e0ead8b509b8fd6705c1
* Close files on image createDean Troyer2014-10-141-5/+12
| | | | | | | The file opened for --file was never closed. Close it if it is a file object. Change-Id: I7bd120a2413de42339771d01e8fd1894d38c3011
* Add more columns to image list outputSteve Martinelli2014-07-251-0/+45
| | | | | | | | Add disk_format, container_format, size and status to image list command. Added tests as well. Change-Id: I8e3822c6d46d0020fc706955c026549f6c635587 Closes-Bug: #1348475
* Python 3: do not use __builtin__Cyril Roelandt2014-07-031-1/+1
| | | | | | Use six.moves.builtins instead, this works with both Python 2 and 3. Change-Id: I57e7257d4f06c805f26383e0778ad104d50ea139
* Image create and set command updates and testsDean Troyer2014-06-162-47/+382
| | | | | | | | | | | | | Refactor image create and set commands to properly handle properties. This is particularly tricky with exclusive booleans as in this case leaving both choices off the command line should NOT assume a default value but leave the existing value unchanged. Properties were not being updated correctly in the 'image set' command. Refactor it to use the same pattern as in other SetXxx commands. Add tests for arg handling. Change-Id: I123a64c9b4feecab25a3e2013cc047f55b1c9967
* Add --volume option to image create commandTerry Howe2014-03-051-0/+76
| | | | | | | | | | | Add ability to create an image from a volume. * Added --volume command to image create * Added --force option to image create * Added block to access volume manager in image create * Tests added for the volume option Change-Id: I3910a2b5e04acd0d15dd230747ba6ebca07aa316 Closes-Bug: #1207615
* Remove copyright from empty filesAlexander Ignatov2014-01-201-14/+0
| | | | | | | | | According to policy change in HACKING: http://docs.openstack.org/developer/hacking/#openstack-licensing empty files should no longer contain copyright notices. Change-Id: Iba09a00f24dfbd1cd03c1c9f70ea216788e64d93 Closes-Bug: #1262424
* Complete basic test infrastructureDean Troyer2013-11-183-0/+123
This finally gets all of the API tests into a common framework regarding test classes and so forth. Change-Id: If675347129c50dcba0bfc5b6c58f5a2ca57ff46c