summaryrefslogtreecommitdiff
path: root/ceilometerclient/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix from_response method to process response from requests2.6.1Andrey Kurilin2016-09-071-0/+16
| | | | | | | | | | | | | | | | | SessionClient uses requests library. It's response class doesn't have "status" property[1], so in case of any errors(with status code > 400), from_response method is called and raises AttributeError. Also, HTTPClient implementation uses requests lib by default[2](if 'http' argument was not transmitted), so from_response method will raise AttributeError too. [1] - http://docs.python-requests.org/en/master/api/#requests.Response.status_code [2] - https://github.com/openstack/python-ceilometerclient/blob/2.6.0/ceilometerclient/openstack/common/apiclient/client.py#L99-L100 Change-Id: Id8fb2f386e8101951716f30a6365c9aa15bd4b24 Closes-Bug: #1620974 (cherry picked from commit 1b1917ab9b56fe92235ce336d3df3e7a8c1c81d2)
* Merge "Correct the parameters's position of assertEqual"2.6.0Jenkins2016-08-087-39/+39
|\
| * Correct the parameters's position of assertEqualxiaozhuangqing2016-07-297-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | assertEqual using should be assertEqual(expected, actual) misplace have two impacts: 1.giving confusing messages when some tests failed. 2.mislead other developer,new test modules may follow these wrong pattern see Partial-Bug https://bugs.launchpad.net/oslo.config/+bug/1604213 Change-Id: I4467d5efb1eed9f4c473c947c93afcfaf9be6ea6
* | Remove keystoneclient dependencyJulien Danjou2016-07-282-67/+0
|/ | | | Change-Id: I3589eca8fd6a581e57524cffa8a8f1278358f38c
* Add support for Python 3.5Julien Danjou2016-07-271-66/+5
| | | | | | | This fixes a test that check too much of the output formatting. Just test that some of the values we expect are there. Change-Id: I43a2c2d017bc99ef045ff2e4c5943f1607343ec1
* base.Resource not define __ne__() built-in functionyuyafei2016-07-041-1/+1
| | | | | | | | | | | Class base.Resource defines __eq__() built-in function, but does not define __ne__() built-in function, so self.assertEqual works but self.assertNotEqual does not work at all in this test case in python2. This patch fixes it by defining __eq__() built-in function of class base.Resource. Also fixes spelling errors:resoruces. Change-Id: I8a4e09e277a14a16105feab81ba8d07ceee5b47f Closes-Bug: #1586268
* Merge "Switch to keystoneauth"Jenkins2016-06-233-16/+16
|\
| * Switch to keystoneauthClenimar Filemon2016-06-013-16/+16
| | | | | | | | | | | | | | keystoneclient.auth is deprecated in favour of keystoneauth. This patch updates Ceilometerclient accordingly. Change-Id: Id4b14cbccfabfeaa5322f7ae5702261d0ed9cca2
* | Ignore aodh_endpoint argumentrabi2016-06-071-1/+18
|/ | | | | | | | | When using keystone session, we seem to pass all **kwargs to SessionClient for metering. We should drop the 'aodh_endpoint' from kwargs. Change-Id: Iaf28d4a525d49f62a0ae635dc1102cc1f0308c74 Closes-Bug: #1589425
* Correct the usage of the method assertEqual()hexin2016-05-191-10/+10
| | | | | | | The first argument of the method assertEqual() should be the expected value. Change-Id: I8ea18641e7563e6d7b2779888759d761c9a843f8
* Update to hacking 0.11.0ZhiQiang Fan2016-05-132-5/+0
| | | | Change-Id: I858a418fa5202ec4fc0fc17f462b983f7864bcac
* Switch from deprecated tempest-lib to tempestJulien Danjou2016-04-121-1/+1
| | | | Change-Id: I2e94b8102ad19500068cc2688d11293e4e9b8aed
* Fix the disorder of items of Traits in the output of event-listxialinjuan2016-03-231-4/+6
| | | | | | | | When use the command ceilometer event-list, the output is not alwarys ordered. This patch fix it. Closes-Bug: #1553932 Change-Id: I3af0fb25bd09ea9f15584219f07dd24ebb77c1cc
* Merge "remove default value of repeat-actions"Jenkins2016-03-142-0/+31
|\
| * remove default value of repeat-actionsZhiQiang Fan2016-03-102-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I94468ff649dd4367848c74e94a3feb08494bb223 fixes problem that ceilometeclient incorrectly reset repeat-actions when update any attribute. I53f3af447a8f814388985f6e4ab57a8ffec18a2a reverts most of the above change, which leading to bug 1539092. Because repeat-actions has default value False, no matter we set it or not, it will replace this bit when we get alarm from API. The unit test doesn't cover such case, so this change still succeeds in CI test. We don't need to revert it again, because the redundant code for create and update is not needed, repeat-actions has default value (False) in API side, so the proper way is simply removing the default value in CLI side. Change-Id: I39c28294db3e55141bb8a2024a6ddfdf8acf5e0d Closes-Bug: #1539092
* | Decouple ceilometerclient without aodh services runningliusheng2016-03-081-0/+10
|/ | | | | | | | | Currently, the ceilometerclient will be broken if aodh services not running, it will be worse if users don't want alarming service and they must start the aodh services. Change-Id: Idf7468f28cee001262b67b6e110357ffc971535a Closes-Bug: #1550095
* Enhances client to support unique meter retrievalRohit Jaiswal2016-02-051-1/+21
| | | | | | | | | | | | | | meter list API is enhanced to support a unique param If specified as True, it returns a unique list of meters. This patch enhances the ceilometer-client to support the unique argument in the shell and the client bindings. DocImpact Closes-Bug: #1506959 Change-Id: I011ca725c25e1cdbe9891c3719f13f5cd34142ea
* Merge "Fix to disable meter-links from CLI"Jenkins2016-01-191-4/+0
|\
| * Fix to disable meter-links from CLIakanksha2016-01-081-4/+0
| | | | | | | | | | | | | | | | | | Removes the option of meter-links from CLI.Since meter-links are never shown. Change-Id: I3949bb6d77786926f22506d97d988f73fa614958 Closes-Bug: #1528318
* | fix project_id and user_id fields not set when create gnocchi alarmxialinjuan2016-01-171-0/+497
| | | | | | | | | | | | | | | | | | | | | | | | | | When using command alarm-gnocchi-* the project_id and user_id are not set. The patch fix it and add related tests: 1.ceilometer gnocchi alarm create/update test cases 2.check gnocchi alarm create/update command args test cases 3.check update alarm without alarm-id 4.check shadowed args are restored Closes-Bug: #1506509 Change-Id: If6a8cfd9bc52b3eeff99dfcfdee2f4da7220674b
* | Merge "change the dict output format to make consistency under py27 and py34"Jenkins2016-01-151-17/+48
|\ \
| * | change the dict output format to make consistency under py27 and py34xialinjuan2016-01-141-17/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the command output in ceilometer cli, if it is a dict and it has items which is list type, originally it won't handle the items in the list. As to under py27, the string type in the list is unicode, the string always look like u"http://alarm", while under py34 the string is "http://alarm", this cause output inconsistency. This patch will handle this inconsistency. Change-Id: I5e7cf4052f68e5a434bcf86242b11365b34750a0
* | | Merge "Only token or creds are required."2.2.1Jenkins2016-01-131-1/+1
|\ \ \ | |/ / |/| |
| * | Only token or creds are required.Mehdi Abaakouk2016-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When token is provided and not the endpoint, the client works, because keystoneauth/keystoneclient will use the service_type to discover the endpoint. Closes-bug: #1533712 Change-Id: I0cf1ba52f656a450d358b2356df67d004f9aba7d
* | | 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
|\