summaryrefslogtreecommitdiff
path: root/ceilometerclient/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Don't copy the auth_plugin for aodh"2.2.0Jenkins2016-01-123-114/+86
|\
| * Don't copy the auth_plugin for aodhMehdi Abaakouk2016-01-073-114/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | We must not copy a keystone session object or auth_plugin object. This change simplifies the aodh redirection code by: * sharing the keystone session object between aodh and ceilometer client * creating a new AuthPlugin() for the aodh client instead of copying the ceilometer one and then change its content. Closes-bug: #1531452 Change-Id: I2b2195e32c5dd74136237f7166c9c0d325434611
* | Use assertTrue/False instead of assertEqual(T/F)Swapnil Kulkarni (coolsvap)2016-01-072-5/+5
|/ | | | | | | | The usage of assertEqual(True/False, ***) should be changed to a meaningful format of assertTrue/False(***). Change-Id: Iabf8d017b47025309f186afb5e30b8ad990c2448 Closes-Bug:#1512207
* Replace assertEqual(None, *) with assertIsNone in testsShuquan Huang2015-12-171-1/+1
| | | | | | | | Replace assertEqual(None, *) with assertIsNone in tests to have more clear messages in case of failure. Change-Id: I36db8bdcb67b8cc0a3bf1f063b4a7b42955b100b Closes-bug: #1280522
* Remove duplicated assertChaozhe.Chen2015-12-031-1/+0
| | | | Change-Id: I7159129411254a940122a88941a642feb6d72ef2
* Merge "Fix the parameter order of assertEqual in ceilometerclient"Jenkins2015-12-022-21/+21
|\
| * Fix the parameter order of assertEqual in ceilometerclientSteve Wilkerson2015-12-012-21/+21
| | | | | | | | | | | | | | | | | | On assertEqual, the parameter order should be (expected, actual). Some of the tests in ceilometer client were written with invalid parameter orders. This patch fixes those tests. Change-Id: I9a7a81bdb0d9224f2b9cd53b7fb6eaf5ed7a582a Partial-Bug: 1277104
* | Fix Resource.__eq__ mismatch semantics of object equalRui Chen2015-12-011-0/+45
|/ | | | | | | | | | | | The __eq__ of apiclient.base.Resource will return True, if the two objects have same id, even if they have different other attributes value. The behavior is weird and don't match the semantics of object equal. The objects that have different value should be different objects. Fix this issue and add some test cases in this patch. Change-Id: Ieb28aa179bda945686e0d9c2f341c373ce2bab74 Closes-Bug: #1499369
* Remove double API requestsMehdi Abaakouk2015-11-201-0/+11
| | | | | | | | When a keystone session object is used API call are done twice. This change fixes that. Change-Id: I79815520b996bce954fe531193f1a0229ef30060
* Catch exception raised by keystoneauth1Mehdi Abaakouk2015-11-201-1/+2
| | | | | | | | | We must support session object that comes from keystoneauth1 and keystoneclient. This change adds code path for keystoneauth1 when it misses. Change-Id: I1164a0a0745605b6bc4fd1fc8fb2813c7e40fb9b
* Fix to enable meter-links on resource-list CLIRohit Jaiswal2015-10-232-1/+50
| | | | | | | | | | This adds an optional param to resource-list CLI to enable meter-links. By default, meter links are not generated, this patch adds an optional param to generate links. Change-Id: I308b94c8a57833cf30b4815ecec2ff9a50e91af6 Closes-Bug: #1508709
* drop v1 clientgordon chung2015-10-217-663/+0
| | | | | | | | | | we dropped v1 back in Juno. as icehouse is EOL and the client follows stable/branches, v1 is completely inaccessible and can be removed Change-Id: If4c6c07e65a6c47f47c59de6c99e8c40ef4e63cb Co-Authored-By: ZhiQiang Fan <aji.zqfan@gmail.com> Closes-Bug: #1389331
* Merge "print sample id for query-samples"Jenkins2015-10-201-10/+10
|\
| * print sample id for query-samplesZhiQiang Fan2015-10-151-10/+10
| | | | | | | | | | | | | | | | | | Provide sample id can make it possible for end user to query particular sample by its id, this is needed because we don't show everything in the list. Change-Id: I06bfc2de1a4e9a24892b2e36b6d2137e1b38cb27 Closes-Bug: #1506745
* | Move to keystone session objectMehdi Abaakouk2015-10-072-5/+26
|/ | | | | | | | | | | | ceilometer client is a rare client that doesn't allow to use a keystoneclient/keystoneauth session object. This change fixes that and will allow to remove the deprecated apiclient code in the future. Depends-On: I43223a8b38ff1f4ef30c1d2345a28de6ade51863 Depends-On: I7cbe0afa12c9d11ce2eaed1f4d29f41507e273f8 Change-Id: I4804c45c2ba69982163503ba5d9d4eba86f904fe
* add limit support1.5.0gordon chung2015-09-091-1/+37
| | | | | | | | limit is now a mandatory condition when querying. this patch allows users to control this value. Change-Id: Ied5f80dc8cfe8b5f85e60fb8ca1d4a8f26663456 Closes-Bug: #1493511
* do not generate meter links on resource-listgordon chung2015-09-081-4/+4
| | | | | | | | meter links are not accessible via resource_list and add significant overhead to query. we shouldn't generate these anymore. Change-Id: Ib20f410a70171aa09e4ebbbb748a5ce495fc6a43 Closes-Bug: #1493400
* Use new location of subunit2htmlRyota MIBU2015-09-041-1/+1
| | | | | | | | | The previous location is going away, this location is preferred. This patch is copied from https://review.openstack.org/#/c/218165/ . Change-Id: Idd9cc58a845e82bc679d49e5bfb22644a9c67364 Closes-Bug: #1489404
* Don't try to get aodh endpoint if auth_url didn't providedliu-sheng2015-08-251-0/+9
| | | | | | | | | | | | This change includes: * Allow users of ceilometerclient specifying aodh_endpoint explicitly * If aodh_endpoint didn't provided and users just provide ceilometer endpoint and token, no auth_url, we assume aodh is unavailable and avoid trying to get aodh endpoint. Change-Id: Idd0ce60058d23507a99b89926e461d19db267ca2 Closes-Bug: #1488290
* Merge "Add ceilometerclient support for api-no-pipeline"1.4.0Jenkins2015-08-102-1/+33
|\
| * Add ceilometerclient support for api-no-pipelineliu-sheng2015-06-262-1/+33
| | | | | | | | | | | | | | | | | | | | | | * Add --direct flag for ceilometer sample-create and sample-create-list commands to support this feature * Add parameter for ceilometerclient.v2.samples.create() and ceilometerclient.v2 samples.create_list() to support this feature Partially implements: blueprint api-no-pipeline Change-Id: Ia3d787bbeaf360ddc198cb4ec183d83a5e76203a
* | tenant_id not required with keystone v3Rohit Jaiswal2015-07-311-1/+2
| | | | | | | | | | | | | | | | | | | | Ceilometer-client requires tenant_id when authenticating with keystone v3. This fix removes this requirement. Change-Id: I36bf3f7a75713976c56dd95b4fd22da4e64d01df Closes-Bug: 1440463
* | Add support for client redirecting to aodh endpoint if availableliu-sheng2015-07-223-27/+116
| | | | | | | | | | | | | | | | Currently, alarm module of ceilometer has been decided to be splitted out of ceilometer tree. To keep compatibility for others upstream users (such as Heat), we need to redirect alarm related request to aodh endpoint. Change-Id: Id13b56eef55f807d5ad2026f225c93fd5585521e
* | Fix unit tests failing caused by new Mock releaseIlya Tyaptin2015-07-101-6/+11
| | | | | | | | | | | | | | | | Since the mock 1.1.1 calling of function 'assert_called' and 'assert_called_once' raises the AttributeError. In current patchset calling of these functions is fixed Change-Id: I5c21bb3f6cfd8cc095a277ead80794e97bb63c72
* | Add alarm severity in alarm-history outputRohit Jaiswal2015-06-241-0/+1
|/ | | | | | | | | | | Info about alarm's severity is missing from the detail column for creation and deletion type of alarm-history call. This fix adds that. Change-Id: I669126596ef7391530e7822c2807ffca7c6a1de1 Closes-Bug: 1468295
* Merge "Explicit error for wrong resource metadata format"1.3.0Jenkins2015-06-181-0/+10
|\
| * Explicit error for wrong resource metadata formatliu-sheng2015-06-171-0/+10
| | | | | | | | | | | | | | | | | | When creating sample with wrong resource metadata format, Ceilometer CLI will return a ValueError about json decoding, this change provide a more explicit error info. Change-Id: I18e757ddb319fbf0ffad13c07528355785ea5e9a Closes-Bug: 1465193
* | Removes whitespace from CLI queriesRohit Jaiswal2015-06-161-0/+14
|/ | | | | | | | | | Strips leading and trailing whitespaces from CLI query field and value parameter before building url. Closes-Bug: 1464694 Change-Id: Ibe99747e22afe05eee187d59aaf0603f58e91373
* Add capability for creating array of samplesAleksey Ripinen2015-06-082-0/+72
| | | | | | | | | | Added method for creating array of samples to samples manager. Added shell command for creating array of samples. Added tests for this changes. It is made for Rally tests that use big data arrays. So now only one function may be called instead of numerous calls simple create function. Change-Id: I01ba4f0c0db40c95ef72dadaa34b3fafc034e417
* Merge "Catch missing 404 exceptions in client"Jenkins2015-06-031-1/+1
|\
| * Catch missing 404 exceptions in clientJuan Antonio Osorio Robles2015-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever an entity wasn't found, the ceilometerclient would issue a NotFound exception. Which is fine, except that it's not the exception that was being expected in the client at all. This exception was defined in the apiclient in the openstack/common directory. So, instead this exception is now being caught in the manager, and now the appropriate exception is being raised. There were some functions where, if the entity was not to be found, a 404 exception would be raised, which was never caught by the client since it was expecting the function to return None, instead of raising. This CR fixes that. Closes-Bug: #1451833 Change-Id: I47b34af2df9c85f86ba1f7f4d7b2951f8d27f96c
* | Merge "[unittest] Increase client and shell modules cover"Jenkins2015-06-033-13/+339
|\ \ | |/
| * [unittest] Increase client and shell modules coverIlya Tyaptin2015-05-113-13/+339
| | | | | | | | | | | | | | Add tests to increase unittest coverage of ceilometerclient.client, ceilometerclient.shell, ceilometerclient.v2.shell. Change-Id: I83a64ee31d6068a5903ef85ec85d5780828a24d7
* | Merge "move capabilities ut code to unit dir"Jenkins2015-05-291-0/+0
|\ \ | |/ |/|
| * move capabilities ut code to unit dirZhiQiang Fan2015-04-231-0/+0
| | | | | | | | | | | | | | The unit test code for capabilities command are left alone, it should be under unit directory Change-Id: I6c9d4e75b44aeba8bd5e79b3c9cf531b928499b8
* | Merge "Added missing ceilometer CLI tests"Jenkins2015-05-071-5/+42
|\ \
| * | Added missing ceilometer CLI testsraiesmh082015-04-141-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds following missing Ceilometer CLI tests - 1. help 2. bash completion In addition to this following optional arguments are also verified. 1. --debug It also modifies existing code to check outputs of different tests. Earlier these were uploaded under - https://review.openstack.org/#/c/100190/ Change-Id: I2a00918e4ecbaac7d08f07ebaaa587dde7d8eee5
* | | remove useless event unit test codeZhiQiang Fan2015-05-061-2/+0
| | | | | | | | | | | | | | | | | | | | | In v2.test_shell.ShellEventListCommandTest, we specify traits twice, the first one should be removed. Change-Id: Iedd7c6161165816b9e76c44ef0f2ae6bf6016204
* | | Merge "Allow changing project-id and user-id by alarm-threshold-update"Jenkins2015-05-041-2/+4
|\ \ \ | |_|/ |/| |
| * | Allow changing project-id and user-id by alarm-threshold-updateJiří Suchomel2015-04-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ceilometer alarm-threshold-update should support updating project-id and user-id, but the update function was silently ignoring changes of these options. Change-Id: I33231bff44b90f3c58e5ef1646349b6dc63a3ce7 Closes-Bug: 1395932
* | | Merge "print user friendly error message for alarm update time constraints"Jenkins2015-04-161-0/+17
|\ \ \ | |/ / |/| |
| * | print user friendly error message for alarm update time constraintsZhiQiang Fan2015-04-021-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if we update an alarm with wrong time constraint which doesn't get name defined, then the shell only prints a very simple string 'name'. This is because our code assume name field has always been specified, however it is not true, then KeyError exception will be raised but not handled well, finally user only gets an implicit message. This patch uses dict.get() for name field, and sends request (may be broken) to ceilometer api, then extracts error message from response. Change-Id: I086c4ec790acc22767ba7f5e43dbcf73f3af5dff Closes-Bug: #1439207
* | | Merge "Add CLI for Capabilities REST API"1.1.0Jenkins2015-04-162-0/+101
|\ \ \
| * | | Add CLI for Capabilities REST APIZhiQiang Fan2015-04-042-0/+101
| |/ / | | | | | | | | | | | | | | | Implements blueprint capability-cli Change-Id: I23fe9c0bc9c27e04e3e0133fc84da7cf1f87321f
* | | Add timeout for keystoneclient sessionZhiQiang Fan2015-04-142-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we only apply timeout on ceilometer api, but not on keystone api as well, this is not consistent. Keystone api may be slow, or worse, stuck, then ceilometerclient will not return timely. This issue has caused availability problem in our environment when ceilometer alarm service has been running for a long time. Change-Id: I0d5f82ff9cf4132a1de2f0b649908483326e116e Closes-Bug: #1436249
* | | add region_name to auth plugin parametersZhiQiang Fan2015-04-141-0/+1
| |/ |/| | | | | | | | | | | | | | | If endpoint is not specified, then auth plugin will request to keystone to get target endpoint, however, we don't provide region name for it, this will cause critical issue in multiple region scenario. Change-Id: I99ceafec25072988435018ca1affbd778ca9b22f Closes-Bug: #1439553
* | ceilometerclient insecure argument no longer worksMatthew Edmonds2015-04-071-0/+9
|/ | | | | | | | The os_insecure argument needs to be parsed and passed to the auth plugin for non-shell usage. Change-Id: Id45a680396a9b646b273d971a0f6c274e95019a6 Closes-Bug: #1438750
* Set auth_plugin in __init__Chris Dent2015-03-201-0/+5
| | | | | | | | This avoids auth_plugin being undefined when calling self.get_base_parser without self.main having been called. Closes-Bug: #1434264 Change-Id: Ic3a898ccecb865ff4e88d82538bcb04001d623db
* Merge "support specify user-id when create sample and alarm"Jenkins2015-03-201-14/+22
|\
| * support specify user-id when create sample and alarmZhiQiang Fan2015-03-201-14/+22
| | | | | | | | | | | | | | | | | | | | The change of I9ba984f804aecee5b63e5a86e699733040dee245 enables us to specify os-user-id in CLI, but it shadows the user-id when creating sample and alarm, this patch fixes it as what we've done for project-id. Change-Id: Ic3ce5dc8e1aea49b3e41fe495be4921fbf85ea5a ref-change: I0ce2416dccd61eb50584799e6df0b8c45d44cdda